Question
CFINVOKE webservice parameters
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.
<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
