简体   繁体   中英

php WSDL (SOAP) client

I have a problem co communicate with SOAP service in php: My code for client:

$url = "https://XXXX.com/DataService.svc?singleWsdl";
$client = new SoapClient($url);
var_dump($client->__getFunctions()); // ExportScheduleData(ExportScheduleData $parameters)
$aclient->ExportScheduleData(array());

I got:

Uncaught SoapFault exception: [HTTP] Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'.

change soap version to 1.2:

$client = new SoapClient($url, array('soap_version' => SOAP_1_2));

And request could not be completed: when I refresh page it still in loaging state - any errors or so.

===== update =====

Looks like service use WS-Security. They provide certificate file, but:

Warning: SoapClient::SoapClient(): Unable to set local cert chain file `C:\xampp\htdocs\workspace\sandbox.dev\public\sandbox.cer'; Check that your cafile/capath settings include details of your certificate and its issuer in C:\xampp\htdocs\workspace\sandbox.dev\public\sandbox.php on line 34

Resolved. Write a Java application for ws-secutity check and and query java app from php script. I use java tcp server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM