Skip to main content
September 13, 2007
Question

wsdl problem - why do i need to name output vars?

  • September 13, 2007
  • 1 reply
  • 240 views
I have a web service that is working (WSDL: http://getanagram.com/wsdevel.wsdl). I can access it from ColdFusion but not in the standard way. See below for examples. The problem is that I don't want to specify the output variables up front inside the call to the web service. I want the two output variables to go into a single struct like all the coldfusion documentation implies.

I'd like to be able to access it this way:

<cfinvoke
webservice=" http://getanagram.com/wsdevel.wsdl"
method="GetTypeScores"
returnvariable="foo">
<cfinvokeargument name="text" value="123 456 7890"/>
</cfinvoke>
Output: <cfoutput>#foo#</cfoutput>

But I get the error "Web service operation "GetTypeScores" with parameters {text={123 456 7890}} could not be found."

Accessing it this way works PERFECTLY without errors but requires I name the output variables in the call, which I do not want:

<cfscript>
ws = CreateObject("webservice", " http://getanagram.com/wsdevel.wsdl");
ws.GetTypeScores(text='123 456 7890',ContactScore="ContactScore",EventScore="EventScore");
</cfscript>
Contact Score: <cfdump var="#ContactScore#" /><br>
Event Score: <cfdump var="#EventScore#" />

Exactly why is this happening?
    This topic has been closed for replies.

    1 reply

    Inspiring
    September 15, 2007
    aparsons wrote:
    > I have a web service that is working (WSDL:
    > http://getanagram.com/wsdevel.wsdl). I can access it from ColdFusion but not in
    > the standard way. See below for examples. The problem is that I don't want to
    > specify the output variables up front inside the call to the web service. I
    > want the two output variables to go into a single struct like all the
    > coldfusion documentation implies.
    >
    > I'd like to be able to access it this way:
    >
    > <cfinvoke
    > webservice=" http://getanagram.com/wsdevel.wsdl"
    > method="GetTypeScores"
    > returnvariable="foo">
    > <cfinvokeargument name="text" value="123 456 7890"/>
    > </cfinvoke>
    > Output: <cfoutput>#foo#</cfoutput>

    The web service requires those parameters so you need to send them
    (nothing wrong with CF here):
    <element name="TypeScores">
    <complexType>
    <sequence>
    <element name="ContactScore" type="xsd:int" minOccurs="1"
    maxOccurs="1"/>
    <element name="EventScore" type="xsd:int" minOccurs="1"
    maxOccurs="1"/>
    </sequence>
    </complexType>
    </element>

    --
    <mack />