我試圖用非WSDL模式下的PHP SoapClient發出請求。我傳遞參數作爲多維對象中所示的下面的代碼片斷:無用的<param0>從PHP SoapClient non-wsdl模式的節點
$params = new stdClass;
$params->Characteristic = new stdClass;
$params->Characteristic->Name = 'PRODUCT_TYPE';
$params->Characteristic->CharacteristicValue = new stdClass;
$params->Characteristic->CharacteristicValue->Value = $type;
$params->Characteristic->CharacteristicValue->Type = 'STRING';
$client = new SoapClient(NULL, array( 'trace' => true, 'exceptions' => true, 'uri' => $uri, 'location' => $location,
'connection_timeout'=>9999,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'soap_version' => SOAP_1_1, 'encoding' => 'ISO-8859-1',
'use' => SOAP_LITERAL
));
$response = $client->thisIsTheFunction($params);
生成的XML是幾乎右除了被包裹在標記:
<soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://[removed]">
<soap-env:body>
<ns1:thisisthefunction>
<param0>
<characteristic>
<name>PRODUCT_TYPE</name>
<characteristicvalue>
<value>Adhoc</value>
<type>STRING</type>
</characteristicvalue>
</characteristic>
</param0>
</ns1:thisisthefunction>
</soap-env:body>
</soap-env:envelope>
的問題是這被服務檢測爲畸形。有什麼方法可以刪除這個額外的標籤嗎?
請問,$ uri','$ location','$ value'的值是多少? –
嗨Log1c。 $ uri是命名空間,$ location是端點,$ type ='STRING'。我不能透露前兩項,因爲它們是保密的。但我認爲這不重要嗎?謝謝 – user3469919
任何人有任何想法? – user3469919