I have a problem getting a client to integrate with my system. I think I have narrowed the problem. The client is sending over an xml message and my system is setup to accept an xml message; however it is expecting it in certain format. The client has expressed a desire for me to setup the format on my end to accept theirs.
This is the clients message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<NewOrder>
<Message id="d3a39c31-cc9f-4331-ad13-be74522df6eb">
<Header>
<LoginAccountIdentifier>Blank</LoginAccountIdentifier>
<LoginAccountPassword>password</LoginAccountPassword>
</Header>
I noticed that my expected format is excepting the prefix tem: on the nodes.
This is expected message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:NewOrder>
<tem:Message id="d3a39c31-cc9f-4331-ad13-be74522df6eb ">
<Header>
<LoginAccountIdentifier>Blank</LoginAccountIdentifier>
<LoginAccountPassword>password</LoginAccountPassword>
</Header>
I believe that if I can remove the prefix then this should match up the client’s message with expected message. The problem is where do I remove the prefix “< tem:”; furthermore, how do I prevent this variable xmlns:tem=”http://tempuri.org/” from showing up in my document?
I ran into a similar issue too long ago. Try using this:
Apparently, the prefix is determined by the namespace so if you want it removed then this would be the way to go.
Good luck!