I’m fairly new to soap but I’m trying to get it working with PHP5. I’ve searched google but have come up with nothing, part of the problem is I’m not even sure what to search for.
Basically we were given the following soap example
<?xml version="1.0" encoding="utf-8"?>
<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>
<PingHomeImprovementRequest xmlns="http://Reply.LeadMarketPlace.Services.Ping.ServiceContracts/2007/10/ServiceContracts">
<HILead>
<LCPId>999</LCPId>
<Zipcode>91786</Zipcode>
<Exclusive>Y</Exclusive>
<Categories>
<Category CategoryId="88" Name="Roofing"/>
</Categories>
<>Y</Exclusive>
<DefaultProjectInfo>
<TimeFrame>Timing is Flexible</TimeFrame>
<BudgetRange>future use</BudgetRange>
<ProjectStatus>Ready to Hire</ProjectStatus>
<AdditionalInfo>I have a leaky roof</AdditionalInfo>
</DefaultProjectInfo>
</HomeImprovementLead>
</PingHomeImprovementRequest>
</soap:Body>
</soap:Envelope>
I used the following PHP5 code
$option=array('trace'=>1);
$client = new SoapClient("http://services.reply.com/pingservice/PingService.asmx?WSDL", $option);
$client->__soapCall("PingHomeImprovement", array(
'LCPId'=>'999',
'Zipcode'=>'02889',
'Exclusive'=>'Y',
'Categories'=>array('Category'=>array('CategoryId'=>'88', 'Name'=>'Roofing')),
'DefaultProjectInfo'=>array('TimeFrame'=>'Timing is Flexible', 'BudgetRange'=>'Requesting a quote', 'ProjectStatus'=>'Ready to Hire', 'AdditionalInfo'=>'I have a leaky roof')
)
);
echo 'Request: '.$client->__getLastRequest().'';
But the __getLastRequest outputs this Soap XML:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://Reply.LeadMarketPlace.Services.Ping.ServiceContracts/2007/10/ServiceContracts">
<SOAP-ENV:Body>
<ns1:PingHomeImprovementRequest/>
<param1>02889</param1>
<param2>Y</param2>
<param3>
<item>
<key>Category</key>
<value>
<item>
<key>CategoryId</key>
<value>88</value>
</item>
<item>
<key>Name</key>
<value>Roofing</value>
</item>
</value>
</item>
</param3>
<param4>
<item>
<key>TimeFrame</key>
<value>Timing is Flexible</value>
</item>
<item>
<key>BudgetRange</key>
<value>Requesting a quote</value>
</item>
<item>
<key>ProjectStatus</key>
<value>Ready to Hire</value>
</item>
<item>
<key>AdditionalInfo</key>
<value>I have a leaky roof</value>
</item>
</param4>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
How do I format the SOAP envelope to match the example provided? Thanks for any help.