PHP连接https SOAP Webservice问题,请高手进。

poemail 2014-09-01 09:57:32
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

...全文
446 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
guohaibo12345 2016-06-02
  • 打赏
  • 举报
回复
引用 5 楼 poemail 的回复:
自己解决了,现在CSDN好像没有什么热心的技术牛人了吧?
请问楼主是怎么解决的?分享一下啊!
poemail 2014-09-05
  • 打赏
  • 举报
回复
自己解决了,现在CSDN好像没有什么热心的技术牛人了吧?
码无边 2014-09-02
  • 打赏
  • 举报
回复
是否你发送的参数有问题?
djh6011 2014-09-02
  • 打赏
  • 举报
回复
$data=$soap->WeChatInterface("68552854");
poemail 2014-09-02
  • 打赏
  • 举报
回复
引用 2 楼 zy205817 的回复:
是否你发送的参数有问题?
这个是没问题的,我用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);
傲雪星枫 2014-09-01
  • 打赏
  • 举报
回复
改成http是否可以?

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧