I'm trying to use NuSOAP to talk to a 3rd party Java web service. The WSDL is a little strange. I'm new to web services. I've been using soapUI to help diagnose errors.
The WSDL expects me to send it an array of parameters called cell. The sample XML Request looks like this:
<ns:cellsToPopulate>
<ns:cell>
<ns:headerId>*TITLE*</ns:headerId>
</ns:cell>
<ns:cell>
<ns:headerId>*IMAGE*</ns:headerId>
</ns:cell>
</ns:cellsToPopulate>
|
There are other things besides the cellToPopulate, so I created a new soapval and an array of cells:
$cell = array();
$cell[0] = array('ns1:cell' => array('ns1:headerId' => "*TITLE*"));
$cell[1] = array('ns1:cell' => array('ns1:headerId' => "*IMAGE*"));
$search = array(
'ns1:user' => array(
'ns1:userToken' => '####TOKEN####'
),
'ns1:search' => array(
'ns1:cellsToPopulate' => new soapval ('ns1:cellsToPopulate','ns1:cellsToPopulate',$cell),
'ns1:searchByCells' => array(
'ns1:cell' => array(
'ns1:headerId' => '*PRODUCT CODE*',
'ns1:value' => $SKU,
'ns1:operator' => '='
),
),
'ns1:numberMasterObjectsPerPage' => '10',
'ns1:andOrType' => 'and',
'ns1:pageInfo' => array(
'ns1:pageNumber' => '1'
),
),
'ns1:masterHeaderTypeID' => '*SKUS*'
);
|
This creates the following SOAP Request:
<ns1:search>
<ns1:cellsToPopulate xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="unnamed_struct_use_soapval[2]">
<item>
<ns1:cell>
<ns1:headerId xsi:type="xsd:string">*TITLE*</ns1:headerId>
</ns1:cell>
</item>
<item>
<ns1:cell>
<ns1:headerId xsi:type="xsd:string">*IMAGE*</ns1:headerId>
</ns1:cell>
</item>
</ns1:cellsToPopulate>
|
Notice that it adds the additional <item> tags to the cellsToPopulate as well as the additional Array and arrayType information. Without these, it works fine.
Is there a way to override this so that this information isn't added?
I looked in the nusoap.php file and noticed that this is added on line 580 with a comment about document/literal support (which is what this Java server supports).
BTW - if I remove the cell array and only send a single cell, then this works fine.
Any help would be appreciated.