Problem with SOAP namespace
| From: | Martin Lefebvre | Date: | Wed, 02 Dec 2009 20:42:32 +0000 |
| Subject: | Problem with SOAP namespace | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-30182@lists.php.net to get a copy of this message | ||
Good afternoon,
I apologize in advance if this is not the right list. If not, it'd be
great if someone could forward me to the correct one.
I'm having an issue with generating a SOAP request using pear-soap
that my web service provider can process. The WSDL and the server are
provided by a 3rd company, and are part of (I think that's what they
call it) the OSA/ParlayX API/framework.
The code I'm using to generate the request from WSDL is:
<?php
require_once "SOAP/Client.php";
$url = "http://XXX.XX.XXX.XX:9012/SendMessageService/b7b5c92e82a22a9a2e9275f10bbfed66?wsdl";
$WSDL = new SOAP_WSDL($url);
$client = $WSDL->getProxy();
$client->setOpt('user','username');
$client->setOpt('pass','password');
$client->setEncoding("ISO-8859-1");
$params = array(
'senderAddress' => "tel:+18885551212",
'subject' => "This is a test",
'priority' => "High",
'addresses' => "tel:+18885551212",
'message' => "Test"
);
$res = $client->call("sendMessage", $params,
"http://www.csapi.org/schema/parlayx/multimedia_messaging/send/v2_5/local");
?>
This code generates the following request, which the SOAP server I
send it to cannot process:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://www.csapi.org/schema/parlayx/multimedia_messaging/send/v2_5/local"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns4:sendMessage>
<senderAddress xsi:type="xsd:string">tel:+18885551212</senderAddress>
<subject xsi:type="xsd:string">This is a test</subject>
<priority xsi:type="xsd:string">High</priority>
<addresses xsi:type="xsd:string">tel:+18885551212</addresses>
<message xsi:type="xsd:string">Test</message>
</ns4:sendMessage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I have tested the request above in SOAPui as well, and the server was
unable to process it. However, if I change it to either of the
following two requests, it works.
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://www.csapi.org/schema/parlayx/multimedia_messaging/send/v2_5/local"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns4:sendMessage>
<ns4:senderAddress xsi:type="xsd:string">tel:+18885551212</ns4:senderAddress>
<ns4:subject xsi:type="xsd:string">This is a test</ns4:subject>
<ns4:priority xsi:type="xsd:string">High</ns4:priority>
<ns4:addresses xsi:type="xsd:string">tel:+18885551212</ns4:addresses>
<ns4:message xsi:type="xsd:string">Test</ns4:message>
</ns4:sendMessage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://www.csapi.org/schema/parlayx/multimedia_messaging/send/v2_5/local"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns4:sendMessage
xmlns="http://www.csapi.org/schema/parlayx/multimedia_messaging/send/v2_5/local">
<senderAddress xsi:type="xsd:string">tel:+18885551212</senderAddress>
<subject xsi:type="xsd:string">This is a test</subject>
<priority xsi:type="xsd:string">High</priority>
<addresses xsi:type="xsd:string">tel:+18885551212</addresses>
<message xsi:type="xsd:string">Test</message>
</ns4:sendMessage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
so my question is, how can I force pear-soap to use any of the 2
requests that seem to work? I also noticed that the PHP SoapClient
class seems to generate the 1st of the two working requests.
Thank you
--
Martin Lefebvre
eMail: dadexter@gmail.com