IT:AD:PostMan:HowTo:Test WCF Endpoints
Summary
WCF is often used to expose IT:AD:SOAP. SOAP is just formal agreed upon (as opposed to adhoc IT:AD:POX) XML. So Postman can be used to bang away at WCF SOAP services.
Process
- Started the WCF service endpoint project:
- I used WCFTestClient.exe to get the following snippet from the XML tab:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IService1/GetData</Action>
</s:Header>
<s:Body>
<GetData xmlns="http://tempuri.org/">
<value>0</value>
</GetData>
</s:Body>
</s:Envelope>
- Start Postman
- Set the following:
- format set to
Raw - verb=
POST - Headers:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<!-- had to remove the Action header's namespace before I stopped getting 400's -->
<Action s:mustUnderstand="1">http://tempuri.org/IService1/GetData</Action>
<!-- added a custom header -->
<currentCulture>en-US</currentCulture>
</s:Header>
<s:Body>
<GetData xmlns="http://tempuri.org/">
<value>0</value>
</GetData>
</s:Body>
</s:Envelope>
The reason the above need fiddling is because the protocol used – basicHttpBinding – is set to accept no Headers (notice the none in http://schemas.microsoft.com/ws/2005/05/addressing/none).
<div note>