Hi,
My first post for several years. Using PHP 5.2.6 on Debian.
I'm trying to connect to an external SOAP server where no WSDL file exists.
I've been unsuccessful in getting a response which I've put down to the message
being sent.
My code is:
$params = array(
'RequestSystem' =>
'PackTrackerTest',
'SenderName' => 'George',
'MessageId' => '1234'
);
$client = new SoapClient(null, array(
'soap_version' => 'SOAP_1_2',
'location' => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
'uri' => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
'trace' => TRUE, ));
$result =
$client->__soapCall("GetReferenceData",array("GetReferenceData"=>$params));
Which generates the following message:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="http://xml.apache.org/xml-soap"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:GetReferenceData>
<param0 xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">RequestSystem</key>
<value xsi:type="xsd:string">PackTrackerTest</value>
</item>
<item>
<key xsi:type="xsd:string">SenderName</key>
<value xsi:type="xsd:string">George</value>
</item>
<item>
<key xsi:type="xsd:string">MessageId</key>
<value xsi:type="xsd:string">1234</value>
</item>
</param0>
</ns1:GetReferenceData>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The SOAP server is expecting to get something like:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:v1="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX">
<soap:Body>
<v1:GetReferenceData>
<v1:RequestParameters>
<RequestParameters xmlns="">
<RequestSystem> PackTrackerTest
</RequestSystem>
<SenderName> George
</SenderName>
<MessageId>1024</MessageId>
</RequestParameters>
</v1:RequestParameters>
</v1:GetReferenceData>
</soap:Body>
</soap:Envelope>
Does anyone have any suggestions as to how I can format my xml message
accordingly?
MTIA
George
The information in this message is intended solely for the addressee and should
be considered confidential. Publishing Technology does not accept legal
responsibility for the contents of this message and any statements contained
herein which do not relate to the official business of Publishing Technology
are neither given nor endorsed by Publishing Technology and are those of the
individual and not of Publishing Technology. This message has been scanned for
viruses using the most current and reliable tools available and Publishing
Technology excludes all liability related to any viruses that might exist in
any attachment or which may have been acquired in transit.