You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my application, we expose a REST interface, generate SOAP requests, and send those to a backend SOAP service.
In this special case, whenever an user passes the "\b" sequence in their JSON request (lets call the field "text"), the resulting XML message field (lets call it a <text> element) ends up being empty.
Here's the original text in the request:
Test 1 No backslash characters Test 4 Test either \b both different backslash character
Sample logs, here we see the string as read from the text field in the request with the backspace sequence working as expected:
2023-03-16 15:06:26.002 INFO 18168 --- [nio-8080-exec-2] g.v.a.v.s.c.v.Controller : Test 1 No backslash characters Test 4 Test either both different backslash character
I have a Jaxb generated class, the following log is from using the getter for the text field after it has been set:
2023-03-16 15:06:26.002 INFO 18168 --- [nio-8080-exec-2] g.v.a.v.s.c.v.Controller : Test 1 No backslash characters Test 4 Test either /b both different backslash character
Both log entries are the same as expected
Then I use the standard javax.xml.bind.Marshaller to see the resulting XML, this one works as expected:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<writeNote xmlns="http://somenamespace">
<text>Test 1 No backslash characters Test 4 Test either \b both different backslash character</text>
</writeNote>
This XML is generated like so (uses javax.xml.bind.Marshaller and its impl):
However, the MessageTracing logs show that the outbound request has an empty element. The following is what's shown when the application runs the marshalSendAndReceive().
2023-03-16 15:04:08.722 TRACE 7016 --- [nio-8080-exec-1] o.s.ws.client.MessageTracing.sent : Sent request [
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns2:writeNote xmlns:ns2="http://somenamespace">
<ns2:text/>
</ns2:writeNote>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
] (prettyprinted and certain fields omitted)
Is this the expected behavior? Is this a limitation of the marshaller, XML as a format, or maybe a missing configuration in the marshaller and the WebServiceTemplate?
The text was updated successfully, but these errors were encountered:
In my application, we expose a REST interface, generate SOAP requests, and send those to a backend SOAP service.
In this special case, whenever an user passes the "\b" sequence in their JSON request (lets call the field "text"), the resulting XML message field (lets call it a
<text>
element) ends up being empty.Here's the original text in the request:
Sample logs, here we see the string as read from the text field in the request with the backspace sequence working as expected:
I have a Jaxb generated class, the following log is from using the getter for the text field after it has been set:
Both log entries are the same as expected
Then I use the standard javax.xml.bind.Marshaller to see the resulting XML, this one works as expected:
This XML is generated like so (uses javax.xml.bind.Marshaller and its impl):
However, the MessageTracing logs show that the outbound request has an empty element. The following is what's shown when the application runs the marshalSendAndReceive().
Is this the expected behavior? Is this a limitation of the marshaller, XML as a format, or maybe a missing configuration in the marshaller and the WebServiceTemplate?
The text was updated successfully, but these errors were encountered: