webservice是https的双向认证,不知道为什么连接不上,或返回空值。
php代码
------------------------------------- $local_cert ="client.pem";
$location = "https://192.168.71.36:11443/cardgateway-web-service/wechat?wsdl";
ini_set("soap.wsdl_cache_enabled", 0);
$soap  =new  SoapClient ($location,array( 'local_cert' => $local_cert, 'allow_self_signed' => true, 'passphrase'=>"abcd@123",'trace' => 1,
                'exceptions' => 1,
                'soap_version' => SOAP_1_1,));
var_dump($soap->__getFunctions());
$data=$soap->WeChatInterface("<xml>68552854</xml>");
echo var_dump($data);
无论用不用证书连接,输出的总是:array(1) {
  [0]=>
  string(68) "WeChatInterfaceResponse WeChatInterface(WeChatInterface $parameters)"
}
stdClass Object
(
    [return] => <xml><Return>0</Return><ErrorCode>CGWE0002</ErrorCode><ErrorDescription>初始的请求为空。</ErrorDescription><ErrorDescriptionEN>Original Request is empty or null</ErrorDescriptionEN></xml>
)
查服务器日志也是有接收到请求,就是收不到数据,请高手帮忙看看。谢谢啦。
webservice是用java的keytool和openssl做的双向认证。
服务器日志:2014-Sep-01 09:41:08:748 [INFO ] DefaultRequestProcessing : processRequest() xmlString is NULL or empty, return error code

解决方案 »

  1.   

    改成http是否可以?
      

  2.   


    这个是没问题的,我用java是能通过的。java代码String requestString = "<xml>68552854</xml>";
    URL url = new URL("https://cardgwserver:11443/cardgateway-web-service/wechat?wsdl");
    //URL url = new URL("http://192.168.18.151:8080/test.xml");
    QName qName = new QName("http://webservice.gateway.aeon.com/", "DefaultWeChatGatewayService");

    Service service = Service.create(url, qName);

    WeChatGateway gateway = service.getPort(WeChatGateway.class);
    String response = gateway.weChatInterface(requestString);
    System.out.println(response);
      

  3.   

    $data=$soap->WeChatInterface("68552854");
      

  4.   

    自己解决了,现在CSDN好像没有什么热心的技术牛人了吧?