NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Array's insert the <item> tag


Joined: 23 May 2008
Posts: 2
Reply with quote
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:

Code:

            <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:

Code:

$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:

Code:
         
          <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.
View user's profileFind all posts by lowrykunSend private message
Array's insert the <item> tag
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic