[英]WSDL SoapClient and PHP + own Namespace
我已經嘗試了一段時間來獲得這個SoapRequest,但我失敗了:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" >
<soap:Body xmlns:gog="http://www.test.nms">
<gog:GenerateRequest>
<gog:Application>TestApp</gog:Application>
<gog:User>TestUser</gog:User>
<gog: RequestCreateOnly>
<gog:Count>1</gog:Count>
<gog:Subject>Test</gog:Subject>
</gog: RequestCreateOnly>
</gog:GenerateRequest>
</soap:Body>
</soap:Envelope>
我必須用PHP編寫它。 問題是:
如何更改命名空間? 如何更改肥皂標簽? 謝謝你的幫助!
我經常使用NuSOAP庫來處理這類請求。 我在下面提供了一段示例代碼,它對您有幫助嗎?
require_once('path-to-nusoap/nusoap.php');
$client = new nusoap_client("http://www.mywebservicehere.com", 'wsdl');
$client -> setDefaultRpcParams(true);
$client -> useHTTPPersistentConnection();
$client -> soap_defencoding = 'UTF-8';
$client -> setUseCurl(true);
$request = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:gog="http://www.test.nms">
<gog:GenerateRequest>
<gog:Application>TestApp</gog:Application>
<gog:User>TestUser</gog:User>
<gog: RequestCreateOnly>
<gog:Count>1</gog:Count>
<gog:Subject>Test</gog:Subject>
</gog: RequestCreateOnly>
</gog:GenerateRequest>
</soap:Body>
</soap:Envelope>';
$results = $client->send($request,'http://www.actionurlhere.com');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.