I need to process an XML object (truly an object, according to is_object()) that is sent to me via SOAP (I’m the SoapServer). I able to process the XML object when I create a test SoapClient using PHP, perfectly of course. When my client (not in PHP) sends the XML object, the processing fails. Problems occur in multiple places at for (what I'm guessing are) different reasons. My client is able to send simple and complex data types. He can receive either as well.
I’ve had utter failures at the validating when he sends a simple data type and therefore the rest fails.
When he sends the complex data, the failure occurs when the <Addresses> node contains more than 1 <Address> (like the XML example).
The function that uses the XMLWriter, returns a string which is processed on the client as a binary string. Not much of a problem other than all of the leading “<” are translated to “<”.
I’m at a loss as to why this fails from the non-PHP client and works so well for the PHP client.
Here is what I need to do:
SoapServer receives an XML object
XML object is validated and a pass/fail value is appended to the appropriate nodes of the XML object
XML object is processed based upon the pass value into a MySQL db
A return XML string is generated using XMLWriter.
XML generally looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<PIEXL>
<NewCompanies>
<Company>
<CompanyID>0</CompanyID>
<CompanyName>First Zero Company</CompanyName>
<AddressShipID>6767</AddressShipID>
<AddressBillID>7676</AddressBillID>
<PIECESKey>0</PIECESKey>
<ModStamp>1</ModStamp>
<Addresses>
<Address>
<AddressID>6767</AddressID>
<CompanyID>0</CompanyID>
<CompanyName>First Zero Company</CompanyName>
<Attention/>
<Address1>123 Main St.</Address1>
<Address2>Suite A</Address2>
<Address3/>
<City>Moore</City>
<State>SC</State>
<Zip>12345</Zip>
<Zip4/>
<Country/>
<Phone>8641234567</Phone>
<Fax/>
<Email/>
<StoreID/>
<WebView>false</WebView>
<Deleted>false</Deleted>
<PIECESKey>0</PIECESKey>
<ModStamp>1</ModStamp>
</Address>
<Address>
<AddressID>7676</AddressID>
<CompanyID>0</CompanyID>
<CompanyName>First Zero Company</CompanyName>
<Attention/>
<Address1>123 Main St.</Address1>
<Address2>Suite B</Address2>
<Address3/>
<City>Seneca</City>
<State>SC</State>
<Zip>29678</Zip>
<Zip4/>
<Country/>
<Phone>8641234567</Phone>
<Fax/>
<Email/>
<StoreID/>
<WebView>false</WebView>
<Deleted>false</Deleted>
<PIECESKey>0</PIECESKey>
<ModStamp>1</ModStamp>
</Address>
</Addresses>
</Company>
</NewCompanies>
</PIEXL>
Any help or better suggestions are greatly appreciated.