Reputation: 291
One of our service which works on SOAP protocol was converted from non-spring boot to spring boot microservice.
On the older code Axis OMElement was responsible to give the response. In Newer code we use spring webservices framework which explicitly return the object that spring marshals to a string.
Response snippet on the older version
<ns2:foo xmlns:ns2="http://foo.bar/x" xmlns:ns3="http://foo.bar/y" xmlns:ns4="http://foo.bar/z">
<ns2:primaryKey>
<ns3:primaryKey>0af723ad3d989090a2fbf1c500000009</ns3:primaryKey>
</ns2:primaryKey>
</ns2:foo>
Response snippet on the newer version
<ns2:foo xmlns:ns2="http://foo.bar/x" xmlns:ns3="http://foo.bar/y" xmlns:ns4="http://foo.bar/z">
<ns2:primaryKey>
<ns3:primaryKey xmlns:ns2="http://foo.bar/x" xmlns:ns3="http://foo.bar/y" xmlns:ns4="http://foo.bar/z">0af723ad3d989090a2fbf1c500000009</ns3:primaryKey>
</ns2:primaryKey>
</ns2:foo>
The above response is messy because we have unneeded namespace yet it is valid because the one that is needed is correct.
Sometimes on the newer version where we have as namespaces prefix which being associated with the wrong namespace as shown in the example below where ns3 prefix is reused.
<ns2:foo xmlns:ns2="http://foo.bar/x" xmlns:ns3="http://foo.bar/y" xmlns:ns4="http://foo.bar/z">
<ns2:primaryKey>
<ns3:primaryKey xmlns:ns2="http://foo.bar/x" xmlns:ns3="http://foo.bar/z" xmlns:ns4="http://foo.bar/y">0af723ad3d989090a2fbf1c500000009</ns3:primaryKey>
</ns2:primaryKey>
</ns2:foo>
I am unaware why spring behaves in this way as I am new to it. Please let me what can be done to avoid this issue.
spring version: 2.7.18
Upvotes: 0
Views: 87