У меня есть. NET 4.6 ASMX WebService, созданный с использованием утилиты WSDL.exe из предоставленного WSDL. xml файла.
После запуска он показывает правильный (как я понял) пример использования:
POST /LSS3.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://sap.com/xi/WebService/soap1.1"
<?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>
<StoreBalanceRequest xmlns="urn:sibur:po:a:store:Balance">
<Plant>string</Plant>
<Material>string</Material>
<PartyNumber>string</PartyNumber>
</StoreBalanceRequest>
</soap:Body>
</soap:Envelope>
---------------------
Но когда я тестирую его с помощью Google Postman, Клиент предоставил текст запроса (он предполагает, что этот текст ДОЛЖЕН работать в этой Службе и никакими другими способами ...)
<?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>
<ns1:StoreBalanceRequest xmlns:ns1="urn:sibur:po:a:store:Balance">
<Plant>string</Plant>
<Material>string</Material>
<PartyNumber>string</PartyNumber>
</ns1:StoreBalanceRequest>
</soap:Body>
</soap:Envelope>
WebService никогда не работает, он вылетает со следующей ошибкой:
<?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>System.Web.Services.Protocols.SoapException: Server was not available to process request. ---> System.NullReferenceException: Object link is empty or doesnt point to an object.
в SiburSevice.ExternalStockRequest_In_SyncBinding.ExternalStockRequest_In_Sync(StoreBalanceRequest StoreBalanceRequest)
--- End of Trace ---</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
Не могу понять, почему эти вещи xmlns: ns1 не видны в запросе XML. ..
Помогите, пожалуйста!