bradley525
asked on
Change Namespace SOAP
Hello I am sending XML using SOAP and I need to change the namespace. Below is the code I am using and the results I am getting and what I need to change it to..Any help would be greatly appreciated.
Thanks
Current Script
The request comes out as
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://dfwebservice.net/"><env:Body>
<RemittanceRequest>
<RequestType>BranchListReq uest</Requ estType>
<agent>BWS</agent>
<userid>wbsuser</userid>
<password>pass@wbs</passwo rd>
</RemittanceRequest>
</env:Body>
</env:Envelope>
But I need the request to come out as
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<RemittanceRequest>
<RequestType>BranchListReq uest</Requ estType>"
<agent>BWS</agent>"
<userid>wbsuser</userid>"
<password>pass@wbs</passwo rd>
</RemittanceRequest>
</soap:Body>
</soap:Envelope>
Thank you for your help!
Thanks
Current Script
<?php
$client = new SoapClient('http://www.dfwebservice.net/DfcsRemittance.asmx?WSDL', array('soap_version' => SOAP_1_2, 'trace' => 1,
'use' => SOAP_LITERALL,
'style' => SOAP_DOCUMENT,
'encoding'=>' UTF-8'));
$typedVar = new SoapVar("mystring", XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema");
$params = '<RemittanceRequest><RequestType>BranchListRequest</RequestType><agent>BWS</agent><userid>wbsuser</userid><password>pass@wbs</password></RemittanceRequest>';
$params = new SoapVar($params, XSD_ANYXML);
$result = $client->GetBranchListXML($params);
echo "REQUEST:\n" . $client->__getLastRequest() . "\n";
echo "Response:\n" . $client->__getLastResponse() . "\n";
print_r($result);
The request comes out as
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://dfwebservice.net/"><env:Body>
<RemittanceRequest>
<RequestType>BranchListReq
<agent>BWS</agent>
<userid>wbsuser</userid>
<password>pass@wbs</passwo
</RemittanceRequest>
</env:Body>
</env:Envelope>
But I need the request to come out as
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<RemittanceRequest>
<RequestType>BranchListReq
<agent>BWS</agent>"
<userid>wbsuser</userid>"
<password>pass@wbs</passwo
</RemittanceRequest>
</soap:Body>
</soap:Envelope>
Thank you for your help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It's got its own web sites. None of my experiences with SOAP (of any sort) have been good at all. This is a pretty universal condition. Most of the major internet players have abandoned SOAP because of all the trouble it causes for developers. Some links that you may want to explore...
http://sourceforge.net/projects/nusoap/
https://code.google.com/p/nusoap-for-php5/issues/list
http://www.scottnichol.com/nusoapintro.htm
http://www.nusphere.com/php_script/nusoap.htm
http://www.greenacorn-websolutions.com/php/working-with-nusoap.php
http://sourceforge.net/projects/nusoap/
https://code.google.com/p/nusoap-for-php5/issues/list
http://www.scottnichol.com/nusoapintro.htm
http://www.nusphere.com/php_script/nusoap.htm
http://www.greenacorn-websolutions.com/php/working-with-nusoap.php
ASKER