Complex Data type in Parameter

Jun 26, 2013 at 9:30 AM
Hi,
I was just tying to use use soap client in my project, but could not get how to use complex type as parameter. Can anyone have any Idea?

Good piece of code!

Thanks
Coordinator
Oct 17, 2013 at 7:49 AM
Edited Oct 17, 2013 at 9:30 AM
It doesn't handle by default complex type yet.
But you can do this :

WSDL method
POST /dnet/achws.asmx HTTP/1.1
Host: tstsvr.achworks.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CheckCompanyStatus xmlns="http://achworks.com/">
      <InpCompanyInfo>
        <SSS>string</SSS>
        <LocID>string</LocID>
        <Company>string</Company>
        <CompanyKey>string</CompanyKey>
      </InpCompanyInfo>
    </CheckCompanyStatus>
  </soap12:Body>
</soap12:Envelope>
SoapClient usage :
Soap.SoapClient client =new Soap.SoapClient();
//load wsdl to get operation parameters
client.LoadWSDL("http://tstsvr.achworks.com/dnet/achws.asmx?wsdl",false);

// invoke operation with inline parameter (complex type def)
var response = client.Invoke("CheckCompanyStatus", "<SSS>TST</SSS><LocID>9505</LocID><Company>MYCOMPANY</Company><CompanyKey>SASD%!%$DGLJGWYRRDGDDUDFDESDHDD</CompanyKey>");