简体   繁体   English

适用于PHP的Wso2 Web服务框架以及SSL客户端和HTTP发送者的问题

[英]Wso2 Web Services Framework for PHP and issues with ssl client and http sender

I am using Wso2 Web Services Framework (WSF) for PHP together with Zend Server CE 5.5 and for some reason issues occurs at the end stage of the connection phase to the Web Service. 我将PHP的Wso2 Web服务框架(WSF)与Zend Server CE 5.5一起使用,由于某些原因,在与Web Service的连接阶段结束时会出现问题。

The Web Service (built in .NET I believe) accepts calls over HTTPS with no user/password authentication needed and no need for a client certificate. Web服务(我相信是内置于.NET中)可以通过HTTPS接受呼叫,而无需用户/密码身份验证,也不需要客户端证书。 I also make use of WSDL with the WSClient. 我还将WSDL与WSClient一起使用。

So, when connecting, I simply set the parameters below: 因此,在连接时,我只需设置以下参数:

$settings = array(
    "wsdl" => realpath(dirname(__FILE__) . "/resources/wsdl.xml"),
    "classmap" => $classMap, // classMap maps the WSDL names to corresponding PHP classes
    "CACert" => realpath(dirname(__FILE__) . "/resources/cert.pem"),
    "timeout" => 40,
    "useSOAP" => "1.2",
    "useWSA" => 1.0
);

The policy found inside the WSDL is the following: 在WSDL中找到的策略如下:

<wsp:Policy wsu:Id="BasicHttpBinding_IApplication_policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <wsp:ExactlyOne>
    <wsp:All>
      <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
        <wsp:Policy>
          <sp:TransportToken>
            <wsp:Policy>
              <sp:HttpsToken RequireClientCertificate="false"/>
            </wsp:Policy>
          </sp:TransportToken>
          <sp:AlgorithmSuite>
            <wsp:Policy>
              <sp:Basic256/>
            </wsp:Policy>
          </sp:AlgorithmSuite>
          <sp:Layout>
            <wsp:Policy>
              <sp:Strict/>
            </wsp:Policy>
          </sp:Layout>
        </wsp:Policy>
      </sp:TransportBinding>
    </wsp:All>
  </wsp:ExactlyOne>
</wsp:Policy>

In the wsf_php_client.log I find that no connection is made, but it's difficult to pinpoint exactly where the issue lies. wsf_php_client.log我发现没有建立连接,但是很难准确地找出问题所在。 Is the [info] line in the log what initiates the [error] later? 日志中的[info]行是稍后引发[error]吗?

[warning] msg_ctx.c(1384) RampartClientConfiguration not set in message context
[info]  [ssl client] Client certificate chain filenot specified
[error] http_sender.c(1355) Error occurred in transport
[error] engine.c(171) Transport sender invoke failed
[error] wso2-wsf-php-src-2.1.0/src/wsf_wsdl.c(1226) [wsf_wsdl] Response envelope not found

At every stage, everything looks fine. 在每个阶段,一切看起来都很好。 I've had a look at the data returned by the function wsf_process_wsdl in wsf_wsdl.php and the data gathered looks fine. 我看了一下该函数返回的数据wsf_process_wsdlwsf_wsdl.php和收集的数据看起来不错。

I've dug through most wso2 forum threads that seem to at least touch my problem, but nothing is corresponding exactly to this. 我已经浏览了大多数wso2论坛线程,这些线程似乎至少解决了我的问题,但是与此完全不符。 I'm really running out of options to where the issue lies and how to solve it. 我真的没有办法解决问题所在和解决方法。 Am I missing something when setting up WSClient with its settings array? 使用其settings数组设置WSClient时,我是否缺少某些内容?

text/xml is the content type for SOAP 1.1 , and application/soap+xml is the content type for soap1.2 , Since you are setting the soap version as soap12, the message is likely to be sent as a soap12 message. text / xml是SOAP 1.1的内容类型,application / soap + xml是soap1.2的内容类型,由于您将soap版本设置为soap12,因此该消息很可能作为soap12消息发送。

From the error you have specified, it looks to me like the message failed to get to the endpoint. 从您指定的错误来看,我觉得该消息无法到达端点。 Can you check whether the endpoint specified in the wsdl is correct. 您可以检查wsdl中指定的端点是否正确。 Or you could specify the endpoint in the client options array. 或者,您可以在客户端选项数组中指定端点。

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

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