Skip to main content

I am attempting to generate a SOAP message in MuleSoft with specific header and body content. However, I am facing an issue where the default SOAP envelope structure is being printed twice. I need the generated SOAP envelope to follow this structure:

 

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">

 <s:Header>

  <a:Action s:mustUnderstand="1">http://localhost:8081/service/request</a:Action>

  <a:MessageID>urn:uuid:9f6be3a5-93cc-4b62-82e6-230de76581df</a:MessageID>

 </s:Header>

 <s:Body>

  <ns0:InquireEmployee xmlns:ns0="http://test/Customer/data">

   <ns0:CurrPosition>tech</ns0:CurrPosition>

   <ns0:CurrStatus>Active</ns0:CurrStatus>

   <ns0:ResponseMessage>COMPLETED, Request</ns0:ResponseMessage>

   <ns0:Status>

    <ns0:Type>SUCCESS</ns0:Type>

    <ns0:Code>9000</ns0:Code>

    <ns0:Description>Employee fetch</ns0:Description>

   </ns0:Status>

  </ns0:InquireEmployee>

 </s:Body>

</s:Envelope>

 

However, I am getting an output with the default

soap:Envelope

element printed twice, like this:

 

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">

  <soap:Body>

   <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">

     <s:Header>

      <a:Action s:mustUnderstand="1" xmlns:a="http://www.w3.org/2005/08/addressing">http://test/TP/ESB/Balances/CustomerBalanceSvc/InquireCurrBalRequestResponse</a:Action>

      <a:messageId xmlns:a="http://www.w3.org/2005/08/addressing">123</a:messageId>

     </s:Header>

     <s:Body>

      <InquireCurrBal xmlns="http://test/TP/ESB/Balances">

        <CustomerID>12345</CustomerID>

      </InquireCurrBal>

     </s:Body>

   </s:Envelope>

  </soap:Body>

</soap:Envelope>

 

What I’ve Tried: I am attempting to send a SOAP envelope that follows the specific format mentioned above, with a custom header containing an

Action

and

MessageID

 

Could you please help me, I am getting error like

 

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">

  <soap:Body>

   <soap:Fault>

     <soap:Code>

      <soap:Value>soap:Receiver</soap:Value>

     </soap:Code>

     <soap:Reason>

      <soap:Text xml:lang="en">Error Routing Event with Soap Server</soap:Text>

     </soap:Reason>

   </soap:Fault>

  </soap:Body>

</soap:Envelope>

 

@DataWeaveQueen​ @Training: DataWeave 2.0 with Mule 4​ @Manish Yadav​ @anuragsh27​ @Shekh Muenuddeen​ @shyam raj prasad​ @gopale​ @ryanandal​ @ssilbernick​ @Chetan Joshi​ @manik​ @Saddam Shaikh​ 

2 réponses
  1. 31 mars 2025, 18:42

    Hi @Rupmita Kundu​ ,

    Thank you for your response.

    While passing two tags in the headers, I encountered an error: "Error Routing Event with SOAP Server." Is there a way to configure two headers.

     

    In the documentation, I could only find examples for passing a single header: MuleSoft Documentation.

     

    https://docs.mulesoft.com/apikit/3.x/apikit-set-header-task

     

    I need to pass two tags in soap headers

     

     <a:Action s:mustUnderstand="1" xmlns:a="http://www.w3.org/2005/08/addressing">http://test/TP/ESB/Balances/CustomerBalanceSvc/InquireCurrBalRequestResponse</a:Action>

          <a:messageId xmlns:a="http://www.w3.org/2005/08/addressing">123</a:messageId>

0/9000