我在RHEL5/CentOS专用系统上使用NuSOAP的php应用程序.
我遇到了以下错误:
2010-10-21 06:23:43.374471 soap_transport_http: entered send() with data of length: 1693
2010-10-21 06:23:43.374510 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host www.mysite.com, port 2194
2010-10-21 06:23:43.374557 soap_transport_http: calling fsockopen with host www.mysite.com connection_timeout 0
2010-10-21 06:23:43.700553 soap_transport_http: Couldn't open socket connection to server http://www.mysite.com:2194/webservice.event, Error (13): Permission denied
2010-10-21 06:23:43.700719 nusoap_client: Error: HTTP Error: Couldn't open socket connection to server http://www.mysite.com:2194/webservice.event, Error (13): Permission denied
Run Code Online (Sandbox Code Playgroud)
我认为它与一些httpd配置有关 - 根据http://www.linuxdevelop.com/redhat--fedora-linux-help/fsockopen-error-13-permission-denied-24366.shtml
我发现问题与SELinux配置有关.
我的服务器上启用了防火墙:策略类型是目标,检查强制当前状态,并且不允许连接到网络的HTTPD脚本.
其中:桌面>系统设置>安全级别> SELinux> httpd>未选中连接到网络的HTTPD脚本.我查了一下它现在正在工作.
但我无法在httpd.conf文件中找到如何直接修改它
我是SOAP的新手,我遇到了问题(是的,我已经搜索过了 - 但是我似乎无法满足我非常简单的要求 - 发送单个XML字符串)并将一些输出发送到.NET服务器匹配这个:
POST /someurl.asmx HTTP/1.1
Host: www.somehost.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://somehost.com/SubmitCalls"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SubmitCalls xmlns="http://somehost/">
<request>string</request>
</SubmitCalls>
</soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)
我的nusoap代码如下所示:
<?php
require_once('../lib/nusoap.php');
$bodyxml = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SubmitCalls xmlns="http://somehost/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<request>
<?xml version="1.0" encoding="UTF-8"?>
<bXML xmlns="http://somehost/Schemas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<From>
<UserName>some username</UserName>
<Password>some password</Password>
</From>
<Calls>
<Call>
<Reference>11111</Reference>
<Name>Joe Bloggs</Name>
<Tel1>02075574200</Tel1>
<Tel2>02075574201</Tel2>
<Tel3>02075574202</Tel3>
<Tel4>02075574203</Tel4>
<Tel5>02075574204</Tel5>
<CLI>08448220640</CLI>
<CallTime>09:00</CallTime>
<FileName>02075574200_1</FileName>
</Call>
<Call>
<Reference>11111</Reference>
<Name>Joe Bloggs</Name>
<Tel1>02075574200</Tel1>
<Tel2>02075574206</Tel2> …Run Code Online (Sandbox Code Playgroud) 您好,我是非常新的webservice,在PHP下面的代码我正在尝试制作肥皂请求,如下面的XML所示,但它说错误
HTTP错误:不支持的HTTP响应状态405方法不允许(soapclient->响应具有响应的内容)
问题:
我在这里使用过Nusoap但是如果你有一个SOAP PHP类解决方案,它也会被邀请.
我的代码:
<?php
require_once('../lib/nusoap.php');
$client = new nusoap_client("http://webservices.test.com/ows/5.1/Availability.wsdl");
$err = $client->getError();
if ($err)
{
client_debug_error_message('Constructor error', $err, $client);
exit;
}
// Call the SOAP method
$result = $client->call(
'FetchCalendar',
array(
'StayDateRange' => array(
'StartDate' => '2013-10-01',
'EndDate' => '2013-10-10',
),
),
);
// Check for a fault
if ($client->fault)
{
debug_preformatted('Fault', $result);
}
else
{
// Check for errors
$err = $client->getError();
if ($err)
{
debug_preformatted('Error', $err);
}
else
{
debug_preformatted('Result', $result);
}
} …Run Code Online (Sandbox Code Playgroud) 我正在调用一个返回以下数组的soap函数:
Array ( [FastAddressResult] => Array ( [IsError] => false [ErrorNumber] => 0 [ErrorMessage] => [Results] => Array ( [Address] => Array ( [Id] => 13872147.00 [OrganisationName] => [DepartmentName] => [Line1] => Methley Grove [Line2] => [Line3] => [Line4] => [Line5] => [PostTown] => Leeds [County] => West Yorkshire [Postcode] => LS7 3PA [Mailsort] => 64121 [Barcode] => [IsResidential] => false [IsSmallOrganisation] => false [IsLargeOrganisation] => false [RawData] => [GeographicData] => Array ( [GridEastM] => 0 [GridNorthM] => 0 [Objective2] …
我正在使用WAMP和CakePHP,并试图在混合中添加一个NuSOAP服务器.我可以通过NuSOAP生成动态WSDL,但底部有一个由NuSOAP设置的参数,并且没有任何意义:
<soap:address location="http://localhost/cakephp/app/webroot/index.php"/>
Run Code Online (Sandbox Code Playgroud)
正确的是:
<soap:address location="http://localhost/cakephp/web_service/web_service"/>
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚如何更改它,甚至根本不知道NuSOAP在哪个位置(我的代码中完全没有引用它).
这是我正在使用的代码:
class WebServiceController extends AppController {
var $components = array('RequestHandler');
public function web_service()
{
$this->layout = FALSE;
$this->autoRender = FALSE;
Configure::write('debug', 0);
$this->RequestHandler->respondAs('xml');
App::import('Vendor', 'nusoap', array('file' => 'nusoap'.DS.'lib'.DS.'nusoap.php'));
include 'local_functions.php';
if ( !isset( $HTTP_RAW_POST_DATA ) ) $HTTP_RAW_POST_DATA =file_get_contents( 'php://input' );
$server = new soap_server();
$namespace = "http://localhost/web_service/web_service";
$server->configureWSDL("web-service", $namespace);//, "urn:web-service");
$server->wsdl->schemaTargetNamespace = $namespace;
include 'wsdl_types.php';
$server->register("Subscribe", array("accessKey" => "xsd:string","publisher" => "xsd:string","subscribeData" => "xsd:string"), array("return" => "xsd:string"), "urn:web-service", "urn:web-service#Subscribe", "rpc", "encoded", "Subscribe to mail …Run Code Online (Sandbox Code Playgroud) 我在调用.net webservice时在我的PHP应用程序中使用nusoap.
问题是,在某些情况下.net web服务对于某些请求花费的时间超过实际时间,所以我想增加SOAP调用等待响应的时间.
是否有任何功能或任何方式我可以保持nusoap呼叫等待,直到我收到来自Web服务的响应.
谢谢,拉玛
我用专用IP地址托管了cPanel,
但是,传出IP仍然是主机提供者的共享IP(应该是)。
我需要使用带有该专用IP的nusoap进行一些传出呼叫:
$nusoap = new nusoap_client("https://URL/");
$call = $nusoap->call(...);
Run Code Online (Sandbox Code Playgroud)
如何在此处使用NuSOAP更改传出IP?
我知道如何使用cURL(curl_setopt($ch, CURLOPT_INTERFACE, $website_ip);),但是如何使用此方法实现相同的目的。已经在服务器端和php端工作了几个小时,但仍然无法弄清楚。