如何使用WSO2 ESB调用外部PHP Web服务
你好,WSO2 ESB社区 我有一个PHP服务。我已经通过WSDL代理调用了WSO2ESB,没有问题。但是,当我尝试从SOAP客户端或WSO2ESB内置的“尝试此服务”调用它时,无法调用该服务并显示错误: org.apache.axis2.AxisFault:读取超时 你能帮我出什么事了吗。。?需要注意的是,当直接从SOAP客户端而不是通过WSO2ESB调用PHP服务时,PHP服务运行良好 这是我的PHP服务代码 ** 是来自WSO2ESB的WSDL地址调用时的结果是“请求超时” 如果我们使用服务代码所在的服务服务器的直接WSDL地址来更改它,那么 结果是服务器将被成功调用,我们将得到一个结果如何使用WSO2 ESB调用外部PHP Web服务,php,service,wso2esb,Php,Service,Wso2esb,你好,WSO2 ESB社区 我有一个PHP服务。我已经通过WSDL代理调用了WSO2ESB,没有问题。但是,当我尝试从SOAP客户端或WSO2ESB内置的“尝试此服务”调用它时,无法调用该服务并显示错误: org.apache.axis2.AxisFault:读取超时 你能帮我出什么事了吗。。?需要注意的是,当直接从SOAP客户端而不是通过WSO2ESB调用PHP服务时,PHP服务运行良好 这是我的PHP服务代码 ** 是来自WSO2ESB的WSDL地址调用时的结果是“请求超时” 如果我们使用服
因此,我们可以得出一个结论,WSO2ESB不能调用PHP web服务。有没有办法在WSO2ESB上调用php web服务?哇。。我已经解决了上面的问题 唯一的原因是,我的PHP服务正在IIS服务器上运行 我已尝试将服务器更改为Apache(使用wamp)。。然后通过WSO2ESB使用SOAPUI访问它 然后 中提琴。。。WSO2 ESB读取到PHP服务成功,没有任何问题。如果要使用PHP客户端,我只需要添加带有PHP cURL扩展的PHP客户端来访问它 我不知道IIS和WSO2ESB之间发生了什么。希望它能对其他人有用
谢谢..我们能看看您的代码吗。。我已经添加了我的代码。。非常感谢。
<?php
//call library
require_once ('../nusoap/lib/nusoap.php');
// Create the server instance
$server = new soap_server();
// Initialize WSDL support
$server->configureWSDL('hellowsdl', 'urn:hellowsdl');
// Register the method to expose
$server->register('hello', // method name
array('name' => 'xsd:string'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:hellowsdl', // namespace
'urn:hellowsdl#hello', // soapaction
'rpc', // style
'encoded', // use
'Says hello to the caller' // documentation
);
// Define the method as a PHP function
function hello($name) {
return 'Hellooo, ' . $name;
}
// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
<?php
require_once ('../nusoap/lib/nusoap.php');
// Create the client instance
$wsdl="http://localhost:8280/services/HelloNuSOAP?wsdl";
$client =new nusoap_client($wsdl,true);
// Check for an error
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
// At this point, you know the call that follows will fail
}
// Call the SOAP method
$result = $client->call('hello', array('name' => 'Scott'));
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
}
?>
$wsdl="http://localhost:8280/services/HelloNuSOAP?wsdl";
$wsdl="http://localhost/ws/hello_serper_nusoap.php"