Hi there. I hope someone can help me with this problem before I slowly go
insane.
 
I am trying to consume a webservice, where the input parameter is defined as
a collection.
 
The documentation looks like this:
 
<?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>
    <DummyTestMethod4 xmlns="http://www.at2.com.au/Member/webservices/";>
      <testCollection>
        <testStruct>
          <_testStruct>
            <strTest>string</strTest>
            <bolTest>boolean</bolTest>
          </_testStruct>
          <_testStruct>
            <strTest>string</strTest>
            <bolTest>boolean</bolTest>
          </_testStruct>
        </testStruct>
      </testCollection>
    </DummyTestMethod4>
  </soap:Body>  
</soap:Envelope>
 
Alternatively, the wsdl file looks like this:
 
<s:element name="DummyTestMethod4">
 <s:complexType>
  <s:sequence>
     <s:element minOccurs="1" maxOccurs="1" name="testCollection"
type="s0:_testCollection" /> 
    </s:sequence>
   </s:complexType>
</s:element>
 
<s:complexType name="_testCollection">
 <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="testStruct"
type="s0:ArrayOf_testStruct" /> 
   </s:sequence>
</s:complexType>
 
<s:complexType name="ArrayOf_testStruct">
 <s:sequence>
    <s:element minOccurs="0" maxOccurs="unbounded" name="_testStruct"
type="s0:_testStruct" /> 
    
 </s:sequence>
</s:complexType>
 
<s:complexType name="_testStruct">
  <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="strTest" type="s:string" />

    <s:element minOccurs="1" maxOccurs="1" name="bolTest" type="s:boolean"
/> 
   </s:sequence>
</s:complexType>
 
 
 
I would have assumed that I needed to create the parameter as follows:
 
<cfset stCollection=StructNew()>    
<cfset stTest=StructNew()>
<cfset aTest=ArrayNew(1)>
<cfloop index="Count" from="1" to="2">
 <cfset stInner=StructNew()>
 <cfset stInner.strTest="foo">
 <cfset stInner.bolTest="false">
 <cfset ArrayAppend(aTest,stInner)>
</cfloop>
<cfset stTest.testStruct=aTest>
<cfset stCollection.testCollection=stTest>
 
<cfinvoke
webservice="http://www.at2.com.au/member/webservices/wsCreateMember.asmx?wsd
l"
   method="DummyTestMethod4"
   returnvariable="returnVar">
   
 <cfinvokeargument name="testCollection" value="#stCollection#">
 
</cfinvoke>
 
 
 
However I get the following error message:
 
Web service operation "DummyTestMethod4" with parameters
{testCollection={{TESTCOLLECTION={{TESTSTRUCT={[{STRTEST={foo},BOLTEST={fals
e}}, {STRTEST={foo},BOLTEST={false}}]}}}}}} could not be found. 
 
In fact, no matter how I use structures and arrays to create a parameter for
this web service, I get the same error. It's driving me insane.
 
Anyone able to help me here please?
 
Garry
 
 
 
 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221304
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to