douwayuan3063
2015-11-09 12:04
浏览 63
已采纳

我可以在Opencart 2中使用PHP SoapClient运行Soap请求吗?

I need to process a Soap Request inside opencart 2, I built the soap request in a normal PHP file to start with and placed this in the root of my website, after I got that working I thought it would just be a case to add a function inside opencart 2 and place the soap request code in there. Now i can call the right function and the method containing the soap request but as soon as opencart try's to process the new soap client line which is :-

$newclient = new SoapClient('https://example.com/catalog/controller/soap/efiWSDL27.wsdl');

I get the following error:-

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /index.php.

Reason: Error reading from remote server

If I comment out this line, then the rest of the function runs ok, apart from anything that relies on the soap request.

So to be clear Im getting this error before I try and call the soap request further down the function, It happens purely on the new soapclient statement.

Do I need to specify any other parameters when I do the new soap client from within Opencart

I know the wsdl is reachable, Im lost on this one, like I say the exact same code will work on the same webspace in a plain php file outside of opencart. I also tried a different webservice with a remote wsdl and I still get this same error in side opencart?

please help me :)

图片转代码服务由CSDN问答提供 功能建议

我需要在opencart 2中处理Soap请求,我在普通的PHP文件中构建了soap请求以开始 把它放在我的网站的根目录中,在我开始工作之后,我认为只是在opencart 2中添加一个函数并将soap请求代码放在那里。 现在我可以调用正确的函数和包含soap请求的方法,但是只要opencart尝试处理新的soap客户端行,即: -

  $ newclient = new SoapClient  ('https://example.com/catalog/controller/soap/efiWSDL27.wsdl');
nn

我收到以下错误: -

 代理错误
 
代理服务器收到来自上游服务器的无效响应。
代理服务器无法处理请求POST /index.php.
nnReason:读取错误 远程服务器
   
 
 

如果我注释掉这一行,那么该函数的其余部分运行正常,除了依赖于soap请求的任何东西。 \ n

所以要清楚我在尝试进一步向函数调用soap请求之前得到此错误,它完全出现在新的soapclient语句中。

当我在Opencart中执行新的soap客户端时,是否需要指定任何其他参数

我知道wsdl可以访问,我丢失了 这个,就像我说的完全相同的代码将在opencart之外的普通php文件中的相同网站空间上工作。 我还尝试了一个带有远程wsdl的不同web服务,我仍然在side opencart中得到同样的错误?

请帮助我:)

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doucheng3811 2015-11-10 13:29
    已采纳

    Not Exactly The Right Answer, But the solution for me was to use the nusoap library rather than the built-in soapclient in PHP and then it worked perfectly.

    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题