Thanks for the reply, Mike.

I don't know if the instantiation is required.  I've used this code
before but not in cfscript syntax.  I might try it as CFML instead of
using cfscript.

Regarding the double data type, ColdFusion actually converts the CF type
of "numeric" to a double.  When I invoke the submitOrder service in my
CF page, CF automatically converts my argument value to the appropriate
data type as defined in the WSDL.

If there's something I've stated above that isn't right, please let me
know.

Rick...



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ferris, Mike
Sent: Monday, March 19, 2007 2:58 PM
To: Dallas/Fort Worth ColdFusion User Group Mailing List
Subject: RE: [DFW CFUG] Problem Invoking CF webservice with an array
ofcomplex type

Rick,

I may be missing something here.  You create the "objOrderLine"
component, but don't invoke or instantiate an init() or any other
method. You start assigning values to it as if it is a structure.

Also, you define the Price to be double, but send a string - "19.99".

Hope this helps.

Mike

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Monday, March 19, 2007 11:17 AM
To: [EMAIL PROTECTED]
Subject: [DFW CFUG] Problem Invoking CF webservice with an array of
complex type

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
[EMAIL PROTECTED], ....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
Lead Web Systems Engineer, MIS
The Thomson Corporation
801 Cherry St., Suite 1300
Fort Worth, TX 76102
p: 817-252-4091
e: [EMAIL PROTECTED]
ppc.thomson.com
 
 

_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.instantspot.com/
  www.teksystems.com/

CONFIDENTIALITY NOTICE: The information contained in this e-mail and
attached document(s) may contain confidential information that is
intended only for the addressee(s). If you are not the intended
recipient, you are hereby advised that any disclosure, copying,
distribution or the taking of any action in reliance upon the
information is prohibited. If you have received this e-mail in error,
please immediately notify the sender and delete it from your system.

_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.instantspot.com/
  www.teksystems.com/

_______________________________________________
Reply to DFWCFUG:
  [email protected]
Subscribe/Unsubscribe:
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
    http://www.mail-archive.com/list%40list.dfwcfug.org/
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
  www.instantspot.com/
  www.teksystems.com/

Reply via email to