웹 서비스에 대한 http 요청을 만들려고합니다. 테스트 XML은 webservices 테스트 입력 필드에 직접 입력 할 때 작동하고 "Invoke"를 클릭하지만 같은 것을 사용하려고 할 때 작동합니다. PHP + NuSoap을 사용하여 데이터를 분석 한 결과, 해결할 수 없었던 특이한 오류가 발생했습니다. Google에서이 문제를 해결하기 위해 노력했지만 관련성이 없습니다.PHP + NuSoap을 통한 HTTP 요청
POST /iInterface_pc2/service.asmx HTTP/1.0
Host: 10.10.86.55
User-Agent: NuSOAP/0.9.6dev (1.137)
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://www.xxxx.com.cn/TransferMaterialInfo"
Content-Length: 722
<?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>
<TransferMaterialInfo xmlns="http://www.xxxx.com.cn/">
<Materiallist>
<Materialinfo>
<id>123456</id>
<title>Hello word</title>
<datetime>2011-04-23 12:12:12</datetime>
<contributor>Some One</contributor>
<materialurl>www.website.com/path/audio1.mp3</materialurl>
<duration>10000</duration>
<status>0</status>
<remark></remark>
</Materialinfo>
</Materiallist>
</TransferMaterialInfo>
</soap:Body>
</soap:Envelope>
그리고 응답 : : 여기
는 요청이다 내가 요청을<?php
// include soap file
require_once('lib/nusoap.php');
// set end point
$endpoint = "http://10.10.86.55/iInterface_pc2/service.asmx";
// create client
$client = new nusoap_client($endpoint);
if ($client->getError()) {
print "Soap Constructor Error: ";
print_r($client->getError());
}
// Human readable
$request = <<<HEREDOC
<TransferMaterialInfo xmlns="http://www.xxxx.com.cn/">
<Materiallist>
<Materialinfo>
<id>123456</id>
<title>Hello word</title>
<datetime>2011-04-23 12:12:12</datetime>
<contributor>Some One</contributor>
<materialurl>www.website.com/path/audio1.mp3</materialurl>
<duration>10000</duration>
<status>0</status>
<remark></remark>
</Materialinfo>
</Materiallist>
</TransferMaterialInfo>
HEREDOC;
$action = "http://www.xxxx.com.cn/TransferMaterialInfo";
$msg = $client->serializeEnvelope($request, '', array(), 'document', 'encoded', '');
$result = $client->send($msg, $action);
if ($client->fault) { //soap_fault
print "Soap Fault :";
print_r($client->fault->faultcode);
print_r($client->fault->faultstring);
}
elseif ($client->getError()) {
print "Soap Error :";
print_r($client->getError());
}
else {
print "Result: ";
print_r($result);
}
..print stuff
?>
어떤 통찰력을 생성하는 데 사용할
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Thu, 28 Apr 2011 11:04:11 GMT
Connection: close
Content-Length: 428
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. ---> Value cannot be null.
Parameter name: s</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
그리고 마지막으로 PHP와 크게 감사 추측 . 나는 벽돌 벽에 머리를 두드리는 소리를 지어왔다. :/
인수/매개 변수가 필요없는 내장 HelloWorld 메소드로부터 성공적인 응답을 얻을 수 있습니다. – red