Solved

FSM Connect - SOAP Header and Body

  • 25 February 2021
  • 1 reply
  • 222 views

Userlevel 5
Badge +14

Hi

 

I am looking to connect to a series of web services with parameters in a  <soap:Header> and  <soap:Body>.

Everything I am posting is being generated in the  <soap:Body>. How do I configure my Integration Map  so certain Mappings go to the  <soap:Header> and others to the  <soap:Body>?

Example, the credentials are in the <soap:Header>;

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">  <soap:Header>    <SecureHeader xmlns="http://www.master-auto-glass.co.uk/pdaservice.asmx">      <Login>string</Login>      <Password>string</Password>      <UserID>short</UserID>    </SecureHeader>  </soap:Header>  <soap:Body>    <StockQuery xmlns="http://www.master-auto-glass.co.uk/pdaservice.asmx">      <stockItm>        <StockItem>          <_magCode>string</_magCode>

But when I posting they are going to the <soap:Body>

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <SecureHeader xmlns="http://www.master-auto-glass.co.uk/pdaservice.asmx">
      <Login>xxxx</Login>
      <Password>xxxxxxxxx</Password>

How would I be able to sort that out?

Any help would be appreciated.

Ady 

icon

Best answer by ruben.maas 3 March 2021, 09:39

View original

This topic has been closed for comments

1 reply

Userlevel 5
Badge +13

Hi Ady, 

 

The baseline SOAP Extract handler in FSM will embed the xml output in the soap envelop body indeed. 

unfortunately, the baseline extract handler does not have the capability to fill segments in the soap header section. 

 

There are two options available:

1- use standard HTTP Extract handler

Changing to standard HTTP extract handler will mean your XML map have to generate the entire SOAP envelop, which makes you XML map a bit more complex. 

In addition, you will need to set the SOAP action header in the routing rule as well as the proper content type. 

 

2- build custom extract handler

We can build a custom extract handler which will inherit the baseline soap extract handler. 

It can expose two additional routing arguments login and password which you will be able to set in the message routing rule screen. 

The custom extract handler will use these argument to include the SecureHeader  segment in the soap header. 

Your current XML map will stay as is.

 

From implementation point of view the second option is probably the easiest, the first options requires some more configuration. 

 

Let me know in case you’ve got any questions. 

 

Best Regards,

 

Ruben