0
我試圖達成一個Web服務通過Internet Explorer(正常工作本地)的捲曲,但我得到這個錯誤信息:PHP的捲曲System.InvalidOperationException:缺少參數
System.InvalidOperationException:缺少參數:服務器。在System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection中集)在System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()在System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
這裏我的電話:
$aParamWS["serverName"] = $paramArray["serverName"];
$aParamWS["userName"] = $paramArray["userName"];
$sUrl_ws = "http://myServer/WS_TEST/test_webService.asmx/TestMethod";
$curl = curl_init($sUrl_ws);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_VERBOSE, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($curl, CURLOPT_USERAGENT, "PhpRestClient");
curl_setopt($curl, CURLOPT_POST, true);
foreach($aParamWS as $key=>$value)
{
$post_array_string .=$key.'='.$value.'&';
}
$post_array_string = rtrim($post_array_string, '&');
curl_setopt($curl, CURLOPT_POST, count($aParamWS));
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_array_string);
$curl_response = curl_exec($curl);
curl_close($curl);
echo $curl_response;
我知道這個問題已經通過stringify數組解決了很多次,但它仍然不起作用。 有什麼想法? 非常感謝