Reputation: 981
I tried to consume a webservice. Need to use a method with parameters but don't show up in th soap request.
`
$poli = new SoapClient($wsdl_url, array('trace'=>true));
$params =array(
'param1'=>'val1',
'param2'=>'val2'
);
try {
var_dump($poli->__soapCall('InitiateTransaction', array('parameters' => $params)));
}
catch(SoapFault $fault) {
die($fault->faultstring . " REQUEST: " . $this->poli->__getLastRequest() . "<br/> RESPONSE: " . $this->poli->__getLastResponse());
}`
also I tried:
var_dump($poli->InitiateTransaction(array('parameters' => $params)));
with the same result, no parameters in the soap envelope:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://merchantapiservice.services.poli.centricom.com/">
<SOAP-ENV:Body>
<ns1:InitiateTransaction/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Please help :)
Upvotes: 2
Views: 652
Reputation: 1634
Can you post the real wsdl url so i can see inside the web service definition? Per my experience, when this happened to me in the past was because the parameter(s) that i was passing didn't match the wsdl definition. That could be because i typed the wrong param name or passed the parameter on a different position than the one specified in the wsdl. Because of this the class SoapClient can't create the right envelope.
Upvotes: 1