Reputation: 3510
We have a SOAP proxy generated using Visual Studio connected services tooling (VS2017).
When we call an .asmx endpoint the SOAP proxy works perfectly.
When we communication to API Management endpoint, which is directed to go to the same .asmx endpoint it fails.
When we communicate using Postman to API Managemenet endpoint the call works, we took the HTTP headers and the SOAP body from a fiddler trace.
So in summary
We know the .asmx endpoint works when using the SOAP client and also postman.
We know API Management works over Postman, but not using the SOAP client generated by the tooling from the WCF.
We basically get back a 404 when calling API management and a small JSON body returned
{ "statusCode": 404, "message": "Resource not found" }
I just can't understand why the same response passed out over Postman works, but fails in the underlying WCF SOAP generated client.
Any one got an idea's why this may be failing?
One interesting thing to note is I tried the call using a HTTPClient, I passed in the headers and SOAP envelope and the call worked from C#. So it must be something to do with the underlying WCF infrastructure and API Management, but I just can't determine what that could be, particularly as the SOAP client works when talking to the ASMX service directly.
Upvotes: 1
Views: 569
Reputation: 3510
Just could not get to the bottom of this. I ended up rewriting the proxy manually using a HTTP client. I took the code generated XML entities from the tooling, removed all XML attributes and treated them just like POCO. I wrote a wrapper to generate the SOAP Envelope and read the corresponding result and serialize them back into the POCO objects. Worked like a charm.
Upvotes: 1