September 06, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
ColdFusion Talk (CF-Talk)
Issues consuming a Net webservice
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 > Here is a snippet from the wsdl file for the method I am calling.Dave Watts 05/12/08 03:47 P >> Here is a snippet from the wsdl file for the method I am calling.Joshua Spangler 05/13/08 01:13 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 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 I forgot to mention this is in CF7 standard. 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 ----- 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/ ----- 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 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 > 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/ ----- Excess quoted text cut - see Original Post for more ----- Thanks for your help Dave. I was able to solve my problem from the comments in this thread: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56353 specifically the link to: http://www.mischefamily.com/nathan/index.cfm/2007/2/8/ColdFusion-and-ASPNET-Web-Service-Interoperability-Part-III Josh
|
Mailing Lists
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||