php - "ContractFilter mismatch at the EndpointDispatcher" due to SOAPAction header

I am trying to deal with some API that uses SOAP but facing an issue. I want to use that API from my site via Javascript + PHP + cUrl.
Honestly, I have never worked with SOAP, so I’d better learn it, but seems I am very close to solution, so, please help me.
I need to call method calledLoginRequest
by sending post request tohttps://aisws.ingos.ru/sales-test/SalesService.svc
(you wont be able to access it, because it handles only a list of IPs).
So I send post request:
POST /sales-test/SalesService.svc HTTP/1.1
Host: aisws.ingos.ru
User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
Accept: */*
Accept-Encoding: UTF-8
Content-Type: text/xml
SOAPAction: "https://aisws.ingos.ru/sales-test/SalesService.svc"
Content-Length: 346
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://aisws.ingos.ru/services/b2b/sales/agents/1.0/"><soapenv:Header/><soapenv:Body><ns:LoginRequest><User>Тут логин</User><Password>Тут пароль</Password></ns:LoginRequest></soapenv:Body></soapenv:Envelope>
And get the response:
HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=utf-8
Content-Length: 748
Connection: keep-alive
Date: Fri, 06 Nov 2020 17:42:31 GMT
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported
</faultcode>
<faultstring xml:lang="ru-RU">
The message with Action 'https://aisws.ingos.ru/sales-test/SalesService.svc' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
Seems that I am passing the wrong stuff inSOAPAction
header.
What should I do?
Answer
Solution:
TheSOAPAction
path value can be found from the script you sending the request by adding to it?wsdl
. In my case ithttps://aisws.ingos.ru/sales-test/SalesService.svc?wsdl
.
Note, that you will not see it just by opening in browser, because it returns content-type xml. To read it you should use cUrl or anything else.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: invalid argument supplied for foreach() laravel
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.