php soap客户端调用WCF服务的要求是什么? [英] What are the requirements for php soap client call to WCF service?

查看:67
本文介绍了php soap客户端调用WCF服务的要求是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我现在将我的网站从自己的服务器(带有IIS的Windows Server)移动到SiteGround(Apache Server)。在我的网站中,我有一个php文件,使用php SoapClient在Web服务上调用托管在另一台服务器上的WCF服务。初始化SoapClient时出现以下错误。



SOAP-ERROR:解析WSDL:无法从'http://mysite.com加载/myWCF.svc?wsdl':无法加载外部实体http://mysite.com/myWCF.svc?wsdl。



Everything从以前的服务器工作正常。我的wcf服务工作正常,因为我可以从其他服务器上托管的其他站点拨打电话。我可以从浏览器访问wsdl文件。这意味着我的PHP代码和Web服务没有问题。



只有来自SiteGround托管服务托管网站的问题。我联系他们的支持,但他们说他们不是PHP开发人员,解决PHP脚本问题超出了他们的技术范围。如果这个问题需要服务器配置,他们会协助。



但是我不知道这个错误需要做什么配置。我是。网络开发人员,并不太了解PHP和它的配置。请如果我需要在服务器上进行更改以进行Web服务调用,请帮助我。是否需要设置任何php变量或需要安装扩展名?



我检查了phpinfo()。

Php版本是5.4.29

肥皂客户端和肥皂服务器选项在肥皂部分下是可以的。

default_socket_timeout值是200(I从谷歌的结果改为20。但这并没有改变。



如果你可以检查,以下是我的PHP代码:

Hello all,

I'm now moving my site from own server (Windows Server with IIS) to SiteGround (Apache Server). In my site, I have a php file that make web service call to WCF service that hosted on another server using php SoapClient. And I am getting following error when initializing SoapClient.

"SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://mysite.com/myWCF.svc?wsdl' : failed to load external entity "http://mysite.com/myWCF.svc?wsdl".

Everything working fine from previous server. My wcf service is working perfectly as I can make a call from other site hosted on other server. I can access wsdl file from the browser. This means my php code and web service have no issue.

Only problem from the site hosted on SiteGround hosting service. I contact their support but they said they are not php developers and solving php script problem is out of their technical scope. And they said they will assist if server configuration is required for this problem.

But I don't know what configurations are needed to be done for this error. I am a .Net developer and don't know much about php and it's configurations. Please help me if there is something I need to make changes on server to make web service call. Is there any php variable need to be set or extension need to be installed?

I checked phpinfo().
Php Version is 5.4.29
Soap Client and Soap Server options are enabeld under "Soap" section.
default_socket_timeout value is 200 (I changed from 20 as a google result. But this didn't sovled)

In case you could check, following is my php code:

$myParam = array( 'aServiceID' => '42', 'aType' => 1);
$client = new SoapClient('http://mysite.com/myWCF.svc?wsdl');
$webService = $client->GetInfo($myParam);
$wsResult = $webService->GetInfoResult;

var_dump($wsResult);





请帮忙。



感谢高级,

tslin



Please help.

Thanks in advanced,
tslin

推荐答案

myParam = array(' aServiceID' => ' 42'' aType' => 1);
myParam = array( 'aServiceID' => '42', 'aType' => 1);


client = new SoapClient(' http://mysite.com/myWCF.svc?wsdl');
client = new SoapClient('http://mysite.com/myWCF.svc?wsdl');


webService =
webService =


这篇关于php soap客户端调用WCF服务的要求是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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