it:ad:postman:howto:test_wcf_endpoints

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.

  • 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:
      • Content-Type=text/xml; charset=utf-8
        • SOAPAction=http://tempuri.org/IService1/GetData

        * Had to edit the soap snippet to remove the action's namespace1), or atleast edit it's namespace2):

<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>


  • /home/skysigal/public_html/data/pages/it/ad/postman/howto/test_wcf_endpoints.txt
  • Last modified: 2023/11/04 01:53
  • by 127.0.0.1