2 dimentional array as a parameter for SoapHttpClientProtocol->Inv

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Max M. Power

    2 dimentional array as a parameter for SoapHttpClientProtocol->Inv

    I'm getting an InvalidOperatio nException calling Invoke with a method
    parameter object array that contains a two dimentional string array. More
    stack trace output below:

    // Create two dimentional array.
    System::String* tda[,] = new System::String*[2,2];
    tda[0,0] = "lastName";
    tda[0,1] = "Power";
    tda[1,0] = "firstName" ;
    tda[1,1] = "Max";

    // Create web method parameters including two dimentional array.
    System::Object* setParams = {"TestApp", "abc123", tda};

    // The next line causes a System.InvalidO perationExcepti on generating the
    XML document. The specified cast was not valid. at
    Microsoft.Xml.S erialization.Ge neratedAssembly .XmlSerializati onWriter1.Write 5_set(Object[]p)

    SoapHttpClientP rotocol->Invoke(S"set ", setParams);

    I'm using the two dimentional array because I'm trying to generate a SOAP
    request body that includes an array:

    <SOAP-ENV:Body>
    <m:set xmlns:m="urn:Sp ecialStation"
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
    <timeValue xsi:type="xsd:s tring">19191929 29</timeValue>
    <spaceNumber
    xsi:type="xsd:s tring">{87AB126 q-B19E-4F3B-9784-3F5D6k3D4F9E}</spaceNumber>
    <ns2:submittedP roperties
    xmlns:ns2="http ://schemas.xmlsoap .org/soap/encoding/" xsi:type="ns2:A rray"
    ns2:arrayType=" xsd:ur-type[6]">
    <item xmlns:ns3="urn: xml-soap-demo" xsi:type="ns3:p roperty">
    <attribute xsi:type="xsd:s tring">First.Va lue</attribute>
    <value xsi:type="xsd:s tring">Value123 </value>
    </item>
    <item xmlns:ns3="urn: xml-soap-demo" xsi:type="ns3:p roperty">
    <attribute xsi:type="xsd:s tring">Second.V alue</attribute>
    <value xsi:type="xsd:s tring">Value456 </value>
    </item>
    <item xmlns:ns3="urn: xml-soap-demo" xsi:type="ns3:p roperty">
    <attribute xsi:type="xsd:s tring">Third.Va lue</attribute>
    <value xsi:type="xsd:s tring">Value789 </value>
    </item>
    <item xmlns:ns3="urn: xml-soap-demo" xsi:type="ns3:p roperty">
    <attribute xsi:type="xsd:s tring">Forth.Va lue</attribute>
    <value xsi:type="xsd:s tring">Value012 </value>
    </item>
    <item xmlns:ns3="urn: xml-soap-demo" xsi:type="ns3:p roperty">
    <attribute xsi:type="xsd:s tring">Fifth.Va lue</attribute>
    <value xsi:type="xsd:s tring">Value345 </value>
    </item>
    <item xmlns:ns3="urn: xml-soap-demo" xsi:type="ns3:p roperty">
    <attribute xsi:type="xsd:s tring">Sixth.Va lue</attribute>
    <value xsi:type="xsd:s tring">Value678 </value>
    </item>
    </ns2:submittedPr operties>
    </m:set>
    </SOAP-ENV:Body>

Working...