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



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305103
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to