Skip to main content
Participant
December 21, 2008
Question

CFINVOKE webservice parameters

  • December 21, 2008
  • 1 reply
  • 594 views
Hi, I am trying to consume a web service and having some problems passing the parameters to it. I have used a web service successfully before where the wsdl looked like this:

<GetUserDetails xmlns=" http://zesty.com/webservices">
<username>string</username>
<password>string</password>
<guidString>string</guidString>
</GetUserDetails>

and the coldfusion code to access it looked like this:

<cfinvoke webservice="https://mobiledatacapture.zesty.com/alphatest.asmx?wsdl" method="GetUserDetails"
returnvariable="zuser">
<cfinvokeargument name="username" value="#username#">
<cfinvokeargument name="password" value="#password#">
<cfinvokeargument name="guidString" value="#zestyGUID#">
</cfinvoke>

where username, password and zestyGUID were just strings and this worked fine.

Now they have added another method to the service that has a WSDL that looks like this:

<SubmitResidueTests xmlns=" http://zesty.com/webservices">
<ResidueTests>
<ResidueTest>
<Label>string</Label>
<KPIN>int</KPIN>
<ResidueTypeCode>R or O or X or C or G or L</ResidueTypeCode>
<CollectionDate>dateTime</CollectionDate>
<DispatchDate>dateTime</DispatchDate>
</ResidueTest>
<ResidueTest>
<Label>string</Label>
<KPIN>int</KPIN>
<ResidueTypeCode>R or O or X or C or G or L</ResidueTypeCode>
<CollectionDate>dateTime</CollectionDate>
<DispatchDate>dateTime</DispatchDate>
</ResidueTest>
</ResidueTests>
</SubmitResidueTests>


So i thought that i would create an xml variable using cfxml and invoke it like this:

<cfinvoke webservice="https://mobiledatacapture.zesty.com/alphatest.asmx?wsdl" method="SubmitResidueTests" returnvariable="retVar">
<cfinvokeargument name="ResidueTests" value="#local.xmlRet#">
</cfinvoke>

where #local.xmlRet# is an xml variable (<cfxml variable="local.xmlRet"...)

but this gives me an error message:

(Web service operation SubmitResidueTests with parameters {ResidueTests={ 3813 O 18-06-2008 22-12-2008 5369 O 23-04-2008 22-12-2008 }} cannot be found.)

Can anyone tell me how to access a web service like this, or what I am doing wrong? Thanks very much, and appreciate any help anyone can offer What is confusing me is how the parameters in this wsdl are encapsulated within the <ResidueTests> and how to pass multiple types of this object to the web service.
    This topic has been closed for replies.

    1 reply

    Inspiring
    December 21, 2008
    Use the method you had success with earlier.
    MK_UltraAuthor
    Participant
    December 22, 2008
    Ok... the first method was passing just strings, but I'm not sure how to format it for the second method, because of the <ResidueTests></ResidueTests> tag that the arguments for the second method are encapsulated in. I have spoke to the .NET developer who wrote it and he said the way in .NET was to send an array ResidueTests [ ], but wasn't sure what the analogous method in coldfusion would be. Sorry if I am misunderstanding something obvious here. Thanks for your reply.