I've been working with the soap client in php and I've successfully been able to make a couple of soap calls to remote servers. These were done with tutorials and so many of the steps were laid out for me. Right now, however, I am trying to send a soap call to another server at
http://ift.tt/1n3nlZx I'm using SoapUI which allows me to see the xml of a correct request. Which I will post below.
<soapenv:Envelope xmlns:xsi="http://ift.tt/ra1lAU" xmlns:xsd="http://ift.tt/tphNwY" xmlns:soapenv="http://ift.tt/sVJIaE" xmlns:soap="http://ift.tt/1n3nmfL">
<soapenv:Header/>
<soapenv:Body>
<soap:Method1 soapenv:encodingStyle="http://ift.tt/wEYywg">
<bstrParam1 xsi:type="xsd:string">Hello</bstrParam1>
<bstrParam2 xsi:type="xsd:string">World</bstrParam2>
</soap:Method1>
</soapenv:Body>
</soapenv:Envelope>
When this soap call is sent it returns "Your input parameters are Hello and World".
Now, however, I am trying to convert what I did via xml into php. I've written
$wsdl = "http://ift.tt/1n3nlZx";
$client = new SoapClient($wsdl, array(
"trace"=>1,
"exceptions"=>0));
$parameters = array('bstrParam1'=>'Hello', 'bstrParam2'=>'World');
$return = $client->Method1($parameters);
This however returns something nasty: SoapFaultObject type: Mismatch
Am I misreading the xml file that SoapUI gave to me? How could I convert the xml file above (which I know works) into php?
No comments:
Post a Comment