I am facing issue while adding the soap header elements in the backend SOAP service.
Here are my requirement.
1) I will get below request from the requester.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://xxxxx.com/CustomUI" xmlns:data="http://www.xxxxxx.com/xml/Account%20-%20Receive%20SAP%20Customer%20(4x%20IDOC%20Input)/Data">
2) But I have to add SOAP headers in the request while calling to backend like this
4) Issue is when we pass <soapenv:Header> </soapenv:Header> in the request my API works but there is limitation from requester side they can't send the empty header. hence I tried to add empty header and throwing below error.
20220303 18:44:52.818 WARNING 8803 Unable to insert element because the new element was not a well-formed XML fragment
How can we add this to the request .
To be able to add a header it needs to match the defined schema
Use the following context variable value to add the Header to your soap request using the add-or-remove-xml-element-s-assertion
<PasswordText xmlns="http://xxxxx. com/webservices">if_sap_T</PasswordText>