Bigtoe
Bigtoe

Reputation: 3510

WCF SOAP proxy fails calling API Management, works with Postman

We have a SOAP proxy generated using Visual Studio connected services tooling (VS2017).

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

Answers (1)

Bigtoe
Bigtoe

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

Related Questions