当wsdl将服务端口绑定定义为https和端口80时,PHP SOAP请求失败的解决方法? [英] Workaround for PHP SOAP request failure when wsdl defines service port binding as https and port 80?

查看:297
本文介绍了当wsdl将服务端口绑定定义为https和端口80时,PHP SOAP请求失败的解决方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用php5的soap扩展使用SOAP Web服务.服务的wsdl是使用Axis java2wsdl生成的,生成过程中使用的任何选项都会导致端口绑定URL列为 https ://xxx.xxx.xxx.xxx**:80 **

I am consuming a SOAP web service using php5's soap extension. The service' wsdl was generated using Axis java2wsdl, and whatever options are used during generation result in the port binding url being listed as https://xxx.xxx.xxx.xxx**:80**

如果我将wsdl下载到我的服务器,请从端口绑定位置值中删除端口80规范,并在我的soapclient调用中引用本地文件,这样就可以正常工作.

If I download the wsdl to my server, remove the port 80 specification from the port binding location value, and reference the local file in my soapclient call it works fine.

但是,如果我尝试远程引用(或按原样下载并在本地引用),则通话会因肥皂故障而失败.

However, if I try to reference it remotely (or download it and reference it locally, as-is) the call fails with a soap fault.

我没有对服务端的任何输入,因此无法使他们更改其wsdl生成过程.因此,除非有一种方法可以使soapclient忽略端口,否则我将坚持使用本地修改的其他人的wsdl副本(我宁愿不这样做).

I have no input into the service side so I can't make them change their wsdl-generation process. So, unless there's a way to make the soapclient ignorant of the port, I'm stuck with using a locally modified copy of someone else' wsdl (which I'd rather not do).

关于如何使我的soapclient忽略端口80的任何想法?

Any thoughts on how to make my soapclient ignore the port 80?

推荐答案

您可能想尝试使用$ options数组来覆盖主机名/端口,该数组可以作为第二个参数传递给SoapClient的构造函数:

You might want to try overriding the hostname/port using the $options array that you can pass as the second argument to SoapClient's constructor:

$client = new SoapClient("some.wsdl", array('proxy_host' => "https://example.org", 'proxy_port' => 443);

$client = new SoapClient("some.wsdl", array('proxy_host' => "https://example.org", 'proxy_port' => 443);

这篇关于当wsdl将服务端口绑定定义为https和端口80时,PHP SOAP请求失败的解决方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆