0 Replies Latest reply on Mar 19, 2007 9:18 AM by hecubus

    Problem invoking CF webservice with complex type argument

    hecubus
      I’m having trouble invoking a CF web service that has an argument that is an array of a CFC.

      I *think* I’m passing in the correct parameters and it appears that the WSDL is being generated properly, but for some reason it’s not liking the complex type argument that I’m passing in.

      Here is an example of the WSDL:

      <element name="submitOrder">
      <complexType>
      <sequence>
      <element name="customerNumber" type="xsd:string"/>
      <element maxOccurs="unbounded" name="orderLine" type="impl:OrderLineInput"/>
      </sequence>
      </complexType>
      </element>

      <complexType name="OrderLineInput">
      <sequence>
      <element name="Quantity" nillable="true" type="xsd:double"/>
      <element name="Product" nillable="true" type="xsd:string"/>
      <element name="Price" nillable="true" type="xsd:double"/>
      <element name="Discount" nillable="true" type="xsd:string"/>
      </sequence>
      </complexType>

      This is my code to invoke the web service and pass in the arguments:

      <CFSET arrOrderLine = ArrayNew(1)>
      <CFOBJECT component="OrderLineInput" name="objOrderLine">

      <cfscript>
      objOrderLine.Quantity = 1;
      objOrderLine.Product = “XYZ”;
      objOrderLine.Price = “19.99”;
      objOrderLine.Discount = “0”;

      ArrayAppend(arrOrderLine, objOrderLine);

      ws = CreateObject(“webservice”, “ http://localhost/components/Order.cfc?wsdl”);

      result = ws.submitOrder(customerNumber="ABC123", orderLine=arrOrderLine);
      </cfscript>

      I'm getting this error:
      Web service operation "submitOrder" with parameters {orderLine={coldfusion.runtime.Variable@7d9c0a}, ....could not be found.

      This usually indicates that I missed a parameter or it didn't like the parameters I passed in.

      If anybody can help me clue in on what I'm doing wrong, I'd greatly appreciate it.

      Thanks,

      Rick Law