House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Search cf-talk

July 04, 2009

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Home /  Groups /  ColdFusion Talk (CF-Talk)

Coldfusion/SOAP/Complex datatypes

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
graham bates
05/12/2008 12:58 PM

I am struggling to find a clear example of how to interface CF 7 with a web service, and was wondering if anyone here has managed to achieve what I am trying to acheieve. The SOAP API takes the form of; <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">; <soap:Header>   <CredentialSoapHeader xmlns="http://tempuri.org/">;     <Username>string</Username>     <Password>string</Password>   </CredentialSoapHeader> </soap:Header> <soap:Body> <GetPageViewByCustom xmlns="http://tempuri.org/">; <pageList>   <int>int</int>   <int>int</int> </pageList> <startTime>dateTime</startTime> <endTime>dateTime</endTime> <timeBreakdown>int</timeBreakdown> </GetPageViewByCustom> </soap:Body> </soap:Envelope> What I am struggling with is forming complex objects of, for example, type [timeBreakDown] in CF, I am continuously told Web service operation 'myMethod()' with parameters {args} could not be found.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jeff Becker
05/12/2008 05:29 PM

Best of luck to you.. When I tried dealing with complex types.. it was rather... complex to say the least.. This was one area where documentation or examples would really help. Take a look at: http://www.mischefamily.com/nathan/index.cfm/2007/2/8/ColdFusion-and-ASPNET-Web-Service-Interoperability-Part-III Hopefully the above helps.  It helped us to some degree. Jeff

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kris Jones
05/12/2008 05:55 PM

Graham, There was thread on this very recently. Take a look at: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:52942 http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56249 http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:304612 http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:304692 While the original question had to do with SAP web-services, there was info in the discussion that might help you. Cheers, Kris

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
graham bates
05/15/2008 05:42 AM

I finally got somewhere with this. It was most confusing because I didn’t appreciate the complex data types were not just, for example, coldfusion arrays but java classes specific to this web service which happened to be an array. So, what I did, was run the wsdl2java program against the web service, in order to see the java source files which allow you to see the data types of the parameters. I then ran a cfinvoke on the webservice and looked in my cffusion directory, found a newly created directory called “stubs” and zipped up all of the class files that had been generated , renamed it as a jar file, and placed that file in my coldfusion java class path. I then created java objects in coldFusion of those data types, eg <cfset ArrayOfInt = CreateObject("java", "org.tempuri.ArrayOfInt")> Doing a cfdump on the object allowed me to understand how to instantiate the variables with the right data. Then, I wrote small amout of xml defining the SOAP header (user name and password etc) , converted it via xmlparse into xml_obj and then pulled the whole thing together like the following; <cfset args.pageList = ArrayOfInt> <cfscript> ws = CreateObject("webservice", "http://webservice.com/ blah.asmx?wsdl"); addSOAPRequestHeader(ws, "http://tempuri.org/", "dummy_string", xml_obj); gb=ws.GetMetricTimeByCustom(pageList=args.pageList,startTime=args.startTime,endTime=args.endTime,timeBreakdown=args.timeBreakdown,dataType=args.dataType); </cfscript> <cfset xml_obj = xmlparse(gb.getXmlDocument())> <cfdump var="#xml_obj#"> Hopefully this will save people some time. ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists