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)

Issues consuming a Net webservice

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Issues consuming a .Net webservice.
Joshua Spangler
05/12/08 02:57 P
I forgot to mention this is in CF7 standard.
Joshua Spangler
05/12/08 03:00 P
Issues consuming a .Net webservice.
Joshua Spangler
05/12/08 02:58 P
Joshua,
Niski, Brian
05/13/08 03:03 P
> Here is a link to the wsdl file:
Dave Watts
05/13/08 02:24 P
>> Here is a link to the wsdl file:
Joshua Spangler
05/13/08 04:18 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joshua Spangler
05/12/2008 02:57 PM

Issues consuming a .Net webservice. Here is a snippet from the wsdl file for the method I am calling. <s:element name="GetLogFileContent"> <s:complexType>   <s:sequence>    <s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string"/>   </s:sequence> </s:complexType> </s:element> Whenever I call the webservice with this code: <cfset results2 = ws.GetLogFileContent(results.LogFileName)> I get the following error message: Web service operation "GetLogFileContent" with parameters {UpdateTestimonial_7f8f3d18-c617-434d-8a5d-f33034a8799e.log} could not be found. I have tried this way as well: <cfset tempStruct     = StructNew()> <cfset tempStruct.fileName   = results.LogFileName> <cfset results = ws.GetLogFileContent(tempStruct)> With the following error as a result: Web service operation "GetLogFileContent" with parameters {{FILENAME={UpdateTestimonial_9b1589ec-85c4-416a-97a8-92f5ceb77402.log}}} could not be found. I have also tried using the cfinvoke tag with similar results: <cfinvoke webservice="#WSurl#" method="GetLogFileContent" returnvariable="results">     <cfinvokeargument name="fileName" value="#results.LogFileName#"/> </cfinvoke> or <cfinvoke webservice="#WSurl#" method="GetLogFileContent" returnvariable="results" fileName="#results.LogFileName#"> </cfinvoke> I can successfully call it like this, but would prefer not to have to deal with the xml: <cfsavecontent variable="xmlGetLogFileContentRequest"> <cfoutput> <?xml version="1.0" encoding="utf-8"?> <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:Body>     <GetLogFileContent xmlns="http://tempuri.org/">;       <fileName>#results.LogFileName#</fileName>     </GetLogFileContent>   </soap:Body> </soap:Envelope> </cfoutput> </cfsavecontent> <cfhttp url="#WSurl#" port="8080" method="post" timeout="3" charset="utf-8">   <cfhttpparam type="xml" value="#Trim(xmlGetLogFileContentRequest)#" /> </cfhttp> Can anyone help with how to call this method using createObject or cfinvoke? I have successfully called another method of the webservice that takes a structure as a parameter: <cfset testimonialStruct = StructNew()> <cfset testimonialStruct.Id        = 1> <cfset testimonialStruct.Title      = "test Title2"> <cfset testimonialStruct.Description  = "test Desc"> <cfset testimonialStruct.Author      = "test Author"> <cfset testimonialStruct.IsActive    = true> <cfset ws = createObject("webservice", "#WSurl#")> <cfset results = ws.UpdateTestimonial(testimonialStruct)> Here is a snippet from the wsdl for this method. <s:element name="UpdateTestimonial"> <s:complexType>   <s:sequence>    <s:element minOccurs="0" maxOccurs="1" name="testimonial" type="tns:TestimonialInfo"/>   </s:sequence> </s:complexType> </s:element> <s:complexType name="TestimonialInfo"> <s:complexContent mixed="false">   <s:extension base="tns:DataBase">    <s:sequence>     <s:element minOccurs="1" maxOccurs="1" name="Id" type="s:int"/>     <s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string"/>     <s:element minOccurs="0" maxOccurs="1" name="Description" type="s:string"/>     <s:element minOccurs="0" maxOccurs="1" name="Author" type="s:string"/>     <s:element minOccurs="1" maxOccurs="1" name="IsActive" type="s:boolean"/>    </s:sequence>   </s:extension> </s:complexContent> </s:complexType> Thanks, Josh

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joshua Spangler
05/12/2008 03:00 PM

I forgot to mention this is in CF7 standard.

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joshua Spangler
05/12/2008 02:58 PM

Issues consuming a .Net webservice. Here is a snippet from the wsdl file for the method I am calling. <s:element name="GetLogFileContent"> <s:complexType>   <s:sequence>    <s:element minOccurs="0" maxOccurs="1" name="fileName" type="s:string"/>   </s:sequence> </s:complexType> </s:element> Whenever I call the webservice with this code: <cfset results2 = ws.GetLogFileContent(results.LogFileName)> I get the following error message: Web service operation "GetLogFileContent" with parameters {UpdateTestimonial_7f8f3d18-c617-434d-8a5d-f33034a8799e.log} could not be found. I have tried this way as well: <cfset tempStruct     = StructNew()> <cfset tempStruct.fileName   = results.LogFileName> <cfset results = ws.GetLogFileContent(tempStruct)> With the following error as a result: Web service operation "GetLogFileContent" with parameters {{FILENAME={UpdateTestimonial_9b1589ec-85c4-416a-97a8-92f5ceb77402.log}}} could not be found. I have also tried using the cfinvoke tag with similar results: <cfinvoke webservice="#WSurl#" method="GetLogFileContent" returnvariable="results">     <cfinvokeargument name="fileName" value="#results.LogFileName#"/> </cfinvoke> or <cfinvoke webservice="#WSurl#" method="GetLogFileContent" returnvariable="results" fileName="#results.LogFileName#"> </cfinvoke> I can successfully call it like this, but would prefer not to have to deal with the xml: <cfsavecontent variable="xmlGetLogFileContentRequest"> <cfoutput> <?xml version="1.0" encoding="utf-8"?> <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:Body>     <GetLogFileContent xmlns="http://tempuri.org/">;       <fileName>#results.LogFileName#</fileName>     </GetLogFileContent>   </soap:Body> </soap:Envelope> </cfoutput> </cfsavecontent> <cfhttp url="#WSurl#" port="8080" method="post" timeout="3" charset="utf-8">   <cfhttpparam type="xml" value="#Trim(xmlGetLogFileContentRequest)#" /> </cfhttp> Can anyone help with how to call this method using createObject or cfinvoke? I have successfully called another method of the webservice that takes a structure as a parameter: <cfset testimonialStruct = StructNew()> <cfset testimonialStruct.Id        = 1> <cfset testimonialStruct.Title      = "test Title2"> <cfset testimonialStruct.Description  = "test Desc"> <cfset testimonialStruct.Author      = "test Author"> <cfset testimonialStruct.IsActive    = true> <cfset ws = createObject("webservice", "#WSurl#")> <cfset results = ws.UpdateTestimonial(testimonialStruct)> Here is a snippet from the wsdl for this method. <s:element name="UpdateTestimonial"> <s:complexType>   <s:sequence>    <s:element minOccurs="0" maxOccurs="1" name="testimonial" type="tns:TestimonialInfo"/>   </s:sequence> </s:complexType> </s:element> <s:complexType name="TestimonialInfo"> <s:complexContent mixed="false">   <s:extension base="tns:DataBase">    <s:sequence>     <s:element minOccurs="1" maxOccurs="1" name="Id" type="s:int"/>     <s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string"/>     <s:element minOccurs="0" maxOccurs="1" name="Description" type="s:string"/>     <s:element minOccurs="0" maxOccurs="1" name="Author" type="s:string"/>     <s:element minOccurs="1" maxOccurs="1" name="IsActive" type="s:boolean"/>    </s:sequence>   </s:extension> </s:complexContent> </s:complexType> Thanks, Josh

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/12/2008 03:47 PM

----- Excess quoted text cut - see Original Post for more ----- That's not the snippet that matters. This snippet defines an element. It doesn't define the operation. Can you post the entire WSDL? Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Training: Adobe/Google/Paperthin Certified Partners http://training.figleaf.com/ WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers! http://www.webmaniacsconference.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joshua Spangler
05/13/2008 01:13 PM

----- Excess quoted text cut - see Original Post for more ----- Thanks Dave, Here is a link to the wsdl file: http://www.dynanetsystems.com:8080/educatesiteproxy/educatesiteproxyTest.asmx?wsdl Josh

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Niski, Brian
05/13/2008 03:03 PM

Joshua, I just used Dreamweaver to create a proxy to your web service.  It built the CFINVOKE tag as I pasted below.  Then I noticed that the proxy didn't create a return variable.  I cannot explain how this works, but if you set the values as I have in this example (they equal themselves with no pound signs) you will be able to access your web service. <cfinvoke webservice="http://www.dynanetsystems.com:8080/educatesiteproxy/educates iteproxyTest.asmx?wsdl" method="getLogFileContent">   <cfinvokeargument name="fileName" value=""/>   <cfinvokeargument name="getLogFileContentResult" value="getLogFileContentResult"/>   <cfinvokeargument name="text" value="text"/> </cfinvoke> <cfdump var="#getLogFileContentResult#"> <cfdump var="#getLogFileContentResult.getReturnCode()#"> <cfdump var="#getLogFileContentResult.ReturnCode.Value#"> Brian >> Here is a snippet from the wsdl file for the method I am calling. > >That's not the snippet that matters. This snippet defines an element. It ----- Excess quoted text cut - see Original Post for more ----- Thanks Dave, Here is a link to the wsdl file: http://www.dynanetsystems.com:8080/educatesiteproxy/educatesiteproxyTest .asmx?wsdl Josh

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/13/2008 02:24 PM

> Here is a link to the wsdl file: > http://www.dynanetsystems.com:8080/educatesiteproxy/educatesit > eproxyTest.asmx?wsdl Are you able to call the service from a .NET client? Is there a test client that you've been provided with? There doesn't appear to be anything wrong with the code you have. If you use a recording proxy, does the request you're making look like the one shown here? http://www.dynanetsystems.com:8080/educatesiteproxy/educatesiteproxyTest.asm x?op=GetLogFileContent Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Training: Adobe/Google/Paperthin Certified Partners http://training.figleaf.com/ WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers! http://www.webmaniacsconference.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group

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

Mailing Lists