问题
我正在尝试将PHP脚本连接到SAS Web服务(SAS存储过程Web应用程序)。 虽然我试图更改套接字超时和SOAPClient超时值,但脚本总是提供超时。 从SoapUI客户端执行时,SAS Web服务会及时正确地响应。
这是我的代码:
Task.Run(() => {
if (!await ws.SendAsync(json, WebSocketMessageType.Binary, true,
CancellationToken.None))
{
throw new Exception("Error: Websocket send timeout");
}
Console.Write("Sent");
} ).Wait(10000);
调试
由于请求超时,我无法看到
的结果<?php
$url = "http://laptop-ht08lb7f/SASBIWS/services/Test13?WSDL";
$client = new SoapClient($url, array("trace" => 1, "debug" => 1, "exceptions" => 0));
$params = array(
"Credit_Amount" => 1.0,
"Dur_Credit" => 1.0,
"Foreign_Worker" => 1.0,
"Instalment" => 1.0,
"MostVal_Asset" => 1.0,
"Num_Years" => 1.0,
"PayStat_Previous" => 1.0,
"Savings_Stocks" => 1.0,
"Telephone" => 1.0,
"Acct_Balance" => 1.0
);
$response = $client->storedProcessforCustomerScoring(array($params));
print_r($response);
?>
因此我不知道是否正确创建了请求。
实验
我尝试了以下方法从WebService获取函数和类型:
$client->__getLastRequestHeaders()
$client->__getLastRequest()
得到了这个结果:
对于功能:
<?php
var_dump($client->__getFunctions());
var_dump($client->__getTypes());
?>
对于类型:
array(1) {
[0]=>
string(116) "storedProcessforCustomerScoringResponse storedProcessforCustomerScoring(storedProcessforCustomerScoring $parameters)"
}
了SoapUI
这是SoapUI完成的XML请求:
array(6) {
[0]=>
string(97) "struct storedProcessforCustomerScoring {
storedProcessforCustomerScoringParameters parameters;
}"
[1]=>
string(272) "struct storedProcessforCustomerScoringParameters {
double Credit_Amount;
double Dur_Credit;
double Foreign_Worker;
double Instalment;
double MostVal_Asset;
double Num_Years;
double PayStat_Previous;
double Savings_Stocks;
double Telephone;
double Acct_Balance;
}"
[2]=>
string(128) "struct storedProcessforCustomerScoringResponse {
storedProcessforCustomerScoringResult storedProcessforCustomerScoringResult;
}"
[3]=>
string(66) "struct storedProcessforCustomerScoringResult {
Streams Streams;
}"
[4]=>
string(36) "struct Streams {
_WEBOUT _WEBOUT;
}"
[5]=>
string(60) "struct _WEBOUT {
base64Binary Value;
string contentType;
}"
}
有人可以给我一些调试或解决它的技巧吗?
提前致谢。
答案 0 :(得分:0)
检查您的网址
我想这个
$url = "http://laptop-ht08lb7f/SASBIWS/services/Test13?WSDL";
应该是这个
$url = "http://laptop-ht08lb7f/SASBIWS/services/Test13";
SOAPUI发送的是什么URL?
此外,尝试使用Fiddler之类的东西捕获流量来比较两个呼叫。