timeout in retrieving the WSO2EI service wsdl from php on pass through transport

自闭症网瘾萝莉.ら 提交于 2019-12-11 17:53:30

问题


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 code:

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

error:

Fatal error: Maximum execution time of 120 seconds exceeded

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);

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

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();
}

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.

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.

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?

Update:

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?


回答1:


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.



来源:https://stackoverflow.com/questions/49135930/timeout-in-retrieving-the-wso2ei-service-wsdl-from-php-on-pass-through-transport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!