通过传输从php检索WSO2EI服务wsdl超时 [英] timeout in retrieving the WSO2EI service wsdl from php on pass through transport

查看:85
本文介绍了通过传输从php检索WSO2EI服务wsdl超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装WSO2EI-6.1.1从旧的WSO2DSS迁移到EI之后,我试图设置一个简单的php wsdl soup客户端,以直接调用服务wsdl的方式从php调用版本"服务,出现以下错误:

After installing WSO2EI-6.1.1 to migrate from my old WSO2DSS to EI, I was trying to setup a simple php wsdl soup client to call the "Version" service from php with a direct link to service wsdl and I'm getting the following error:

php代码:

try {
  $client = new SoapClient("http://server-ip:8280/services/Version?wsdl");
  $response = $client->getVersion();
  var_dump($response);
} catch (SoapFault $fault) {
  echo $fault->getMessage();
}

错误:

Fatal error: Maximum execution time of 120 seconds exceeded

似乎连接正在超时...我试图用相同的结果使file_get_contents服务wsdl超时.有时候,它的加载时间很糟糕,大约为90-100秒,但大多数情况下超时.

Seems like the connection is timing out... I have tried to get the service wsdl with file_get_contents with the same result, timing out. well sometimes it works with a terrible loading time of like 90-100 seconds, but most of the times it times out.

$wsdl = file_get_contents("http://server-ip:8280/services/Version?wsdl");
var_dump($wsdl);

我已经在浏览器中测试了链接,并且加载正常.还通过linux命令行在curl上进行了测试,它在该处也可以很好地加载,因此可以访问该链接.

I have tested the link in browser and it is loading fine. Also tested with curl from linux command line and it loads fine there as well so the link is accessible.

curl -v http://server-ip:8280/services/Version?wsdl

因此,仅当我尝试从php中检索wsdl时,才会发生超时.但是,如果我下载并保存wsdl文件并改为通过php传递本地xml文件,则该服务可以正常工作,并且会提取并显示该版本.

So the timeout happens only when I try to retrieve the wsdl from within php. however if I download and save the wsdl file and pass the local xml file in php instead, then the service works fine and the version is fetched and displayed.

try {
  $client = new SoapClient("Version.xml");
  $response = $client->getVersion();
  var_dump($response);
} catch (SoapFault $fault) {
  echo $fault->getMessage();
}

因此,似乎问题仅在于直接从php中的服务器中获取wsdl,而服务器与客户端之间的其余通信工作正常.

So it seems like the problem is only fetching the wsdl directly from server in php and the rest of the communication between the server and the client is working fine.

经过几个小时的搜索,我决定尝试在axis2的transportReceiver配置中尝试nhttp传输,而不是通过传输,这样就解决了问题.但是,阅读文档时请注意,默认传输是通过的,与nhttp相比,它在性能方面更好.

after few hours searching I decided to try nhttp transport in transportReceiver configuration of axis2 instead of pass through transport and the problem is solved. however, reading the docs it is noted that the default transport is pass through and it is better in terms of performance compared to nhttp.

那么这是一个错误还是导致该问题的原因,或者我做错了什么,并且有可能在使用传递传输时直接从php中的服务器检索wsdl吗?

so is it a bug or something there causing the problem or am I doing something wrong and its possible to retrieve the wsdl directly from server within php while using the pass through transport?

更新:

当我使用端口号9763表示HTTP或9443表示https而不是8280和8243来访问服务或服务wsdl时,则可以从php毫无问题地访问服务或wsdl.因此,任何人都可以向我解释使用端口号9763或8280通过http传输访问服务有什么区别吗?是否可以使用9763而不是8280来处理服务还是可以使用9443而不是8243来处理服务?当我使用端口9763和9443时,它仍在使用直通传输吗?

when I use port numbers 9763 for http or 9443 for https instead of 8280 and 8243 to access services or service wsdl then I can access services or wsdl from php with no problems. So can anyone please explain to me whats the difference when using the port number 9763 or 8280 to access a service over http transport? Is it ok to use 9763 instead of 8280 to deal with services or to use 9443 instead of 8243? Is it still using the passthru transport when I use ports 9763 and 9443?

推荐答案

所有WSO2服务器都具有两种传输类型-servlet和直通(或nhttp).这些用于不同目的.默认情况下,Servlet传输通过端口9443和9763公开.这是管理服务和管理控制台使用的端口.版本服务也使用相同的端口.对于您编写和部署的服务,它们通过8280和8243端口公开.要回答您的问题,对于此服务,您必须使用9763或9443端口.您将通过servlet传输而不是直通传输访问Version服务.

All WSO2 servers have two types of transports — servlet and passthrough (or nhttp). These are used for different purposes. Servlet transports are exposed over port 9443 and 9763 by default. This is the port used by admin services and the management console. The version service also uses the same port. For the services that you write and deploy, they are exposed over 8280 and 8243 ports. To answer your question, for this service you have to use 9763 or 9443 ports. And you will be accessing the Version service over servlet transport and not passthrough transport.

这篇关于通过传输从php检索WSO2EI服务wsdl超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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