简体   繁体   English

在PHP Soap Client中使用wsHttpBinding

[英]Consume wsHttpBinding with PHP Soap Client

is there a way to use wsHttpBinding with the PHP Soap Client? 有没有办法将wsHttpBinding与PHP Soap Client一起使用? It did not work on my website on the first attempts. 第一次尝试时,它在我的网站上不起作用。 I had to change the connection to basicHttpBinding . 我不得不将连接更改为basicHttpBinding

The main reason to do this is that (as I understand) the wsHttpBinding uses newer Soap Standards and has some kind of security implemented. 这样做的主要原因是(据我了解) wsHttpBinding使用了较新的Soap Standards,并实现了某种安全性。 Also the order of the response should be the same as the order of the requests. 响应的顺序也应与请求的顺序相同。

Thanks in advance 提前致谢

basicHttpBinding use SOAP 1.1 and wsHttpBinding use SOAP 1.2 basicHttpBinding使用SOAP 1.1,而wsHttpBinding使用SOAP 1.2

By default SoapClient use SOAP 1.1 but you can modify that. 默认情况下,SoapClient使用SOAP 1.1,但是您可以对其进行修改。

$wsdl = "...url_to_your_wsdl...";
$client = new SoapClient($wsdl, array("soap_version" => SOAP_1_2));

http://php.net/manual/en/soapclient.soapclient.php http://php.net/manual/en/soapclient.soapclient.php

As far as I know PHP Soap Client does not support entire WS standard (WS-Security in particular). 据我所知,PHP Soap Client不支持整个WS标准(特别是WS-Security)。 You should try to use some 3rd party frameworks like this: 您应该尝试使用某些第三方框架,例如:

http://wso2.com/products/web-services-framework/php/ http://wso2.com/products/web-services-framework/php/

Hope it helps, 希望能帮助到你,

If you configure WsHttpBinding to have no security or transport security then it should be possible. 如果将WsHttpBinding配置为不具有安全性或传输安全性,则应该可以。 the desired soap will be simple and you can create it even by concatenating strings. 所需的肥皂将很简单,您甚至可以通过串联字符串来创建它。 otherwise I don't think php supports the newset security standards. 否则,我认为php不支持新的安全性标准。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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