Jump to content

[SOLVED] SOAP complexType


ionik

Recommended Posts

Hello!

 

Working with SOAP for a client and they need us to interact with a API using SOAP.

 

Issue I seem to be having is that when I talk back to their server it doesn't recognize the information I'm giving (I presume as I get a proper response)

 

I'm not to familiar with SOAP but from my understanding, I need to send the data for the complexType Partner as an Object, for the createWorkOrder function...

 

They gave us a C snippet for this which works ...... and the parser for this I believe is written in C also, we have contacted the companies support on this to get help but they are outsourced to India and are quite possibly, the most rude sonsa**** we have ever talked to and simply told us they "I dont know PHP im not Program Expert go find elsewhere some help" .....quoted

 

This is the PHP code being used...

$client = new SoapClient("http://qasecure.ars.com/leadws/leadws.asmx?WSDL",array("trace" => true));

echo '<pre>';

$Partner = new stdClass();

$Partner->partnerName = "Test";

$Partner->partnerPassword = "Test";

// Dump out our response

var_dump($client->createWorkOrder(array($Partner, null));

// Responds with Invalid ID
echo '</pre>';

 

And the SOAP XML Data

<s:element name="createWorkOrder">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="Partner" type="tns:partner" />
            <s:element minOccurs="0" maxOccurs="1" name="WorkOrder" type="tns:workorder" />
          </s:sequence>

        </s:complexType>
      </s:element>
      <s:complexType name="partner">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="partnerId" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="partnerName" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="partnerPassword" type="s:string" />
        </s:sequence>
      </s:complexType>

      <s:complexType name="workorder">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="dispatchId" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="branchcode" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="servicecode" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="sourcecode" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="promocode" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="promodesc" type="s:string" />
          <s:element minOccurs="1" maxOccurs="1" name="serviceDate" type="s:dateTime" />

          <s:element minOccurs="0" maxOccurs="1" name="specialInstructions" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" name="address" type="tns:serviceAddress" />
          <s:element minOccurs="0" maxOccurs="1" name="customer" type="tns:customer" />
          <s:element minOccurs="0" maxOccurs="1" name="work" type="tns:workDetails" />
        </s:sequence>
      </s:complexType>

 

Link to comment
https://forums.phpfreaks.com/topic/159245-solved-soap-complextype/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.