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

    Problem invoking CF webservice with complex type argument

      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">
      <element name="customerNumber" type="xsd:string"/>
      <element maxOccurs="unbounded" name="orderLine" type="impl:OrderLineInput"/>

      <complexType name="OrderLineInput">
      <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"/>

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

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

      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);

      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.


      Rick Law