You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Tom B. Lake [42-Q]" <to...@42-q.com> on 2022/04/20 14:57:34 UTC

[Axis2] 1.8.0 not encoding CDATA xml string inputs

Hi Axis2 team,

We are upgrading from Axis2 1.6.2 to 1.8.0 war. In 1.8.0 testing, if a web
service operation has a string input wrapped in a CDATA tag (because its
xml), the string isn't being xml encoded for < and > characters. We log the
soap message at the start of MessageReceiverInOut. With axis2 1.6.2 the
input string is encoded at that point but with 1.8.0 it's still wrapped in
a CDATA tag. The web service op ends up with an empty string for the input
because it's still wrapped in a CDATA tag? Is there a config to have CDATA
tags converted in 1.8.0?

1.8.0 log:
2022-04-20T12:59:10,283 INFO http-nio-8081-exec-5
org.apache.axis2.receivers.AbstractMessageReceiver - Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:intranet:MDS:hcommsf">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:WebServiceAck>
         <urn:inbound_message><![CDATA[
<ACKNOWLEDGEMENTS>
  <ROUTING_URL>http://localhost:8081/axis2/services/hcommsfService?wsdl
</ROUTING_URL>
  <MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18</MESSAGE_ID>
  <TRANSACTION_ID>1938378</TRANSACTION_ID>
  <ACK_TYPE>WIPMOVE ACK</ACK_TYPE>
  <ORG_ID>TEST1</ORG_ID>
  <PROJECT_CODE>ABCD|TEST1</PROJECT_CODE>
<ACKNOWLEDGEMENT>
    <ORIGINAL_TRANSACTION_ID>1113</ORIGINAL_TRANSACTION_ID>
    <DATA>TEST-LM022</DATA>
    <STATUS_CODE>4</STATUS_CODE>
    <STATUS_DESCRIPTION>PROCESSED OKAY</STATUS_DESCRIPTION>
  </ACKNOWLEDGEMENT>
</ACKNOWLEDGEMENTS>
]]>
</urn:inbound_message>
      </urn:WebServiceAck>
   </soapenv:Body>
</soapenv:Envelope>

1.6.2 log:
2022-04-20 13:01:29,138 INFO  [AbstractMessageReceiver] (41) - Request:
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:intranet:MDS:hcommsf"><soapenv:Body>
      <urn:WebServiceAck>
         <urn:inbound_message>
&lt;ACKNOWLEDGEMENTS>
  &lt;ROUTING_URL>
http://localhost:8081/axis2/services/hcommsfService?wsdl&lt;/ROUTING_URL>
  &lt;MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18&lt;/MESSAGE_ID>
  &lt;TRANSACTION_ID>1938378&lt;/TRANSACTION_ID>
  &lt;ACK_TYPE>WIPMOVE ACK&lt;/ACK_TYPE>
  &lt;ORG_ID>TEST1&lt;/ORG_ID>
  &lt;PROJECT_CODE>ABCD|TEST1&lt;/PROJECT_CODE>
&lt;ACKNOWLEDGEMENT>
    &lt;ORIGINAL_TRANSACTION_ID>1113&lt;/ORIGINAL_TRANSACTION_ID>
    &lt;DATA>TEST-LM022&lt;/DATA>
    &lt;STATUS_CODE>4&lt;/STATUS_CODE>
    &lt;STATUS_DESCRIPTION>PROCESSED OKAY&lt;/STATUS_DESCRIPTION>
  &lt;/ACKNOWLEDGEMENT>
&lt;/ACKNOWLEDGEMENTS>
</urn:inbound_message>
      </urn:WebServiceAck>
   </soapenv:Body></soapenv:Envelope>

Regards

-- 
CONFIDENTIALITY
This e-mail message and any attachments thereto, is 
intended only for use by the addressee(s) named herein and may contain 
legally privileged and/or confidential information. If you are not the 
intended recipient of this e-mail message, you are hereby notified that any 
dissemination, distribution or copying of this e-mail message, and any 
attachments thereto, is strictly prohibited. If you have received this 
e-mail message in error, please immediately notify the sender and 
permanently delete the original and any copies of this email and any prints 
thereof.
ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS 
E-MAIL IS NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the 
Uniform Electronic Transactions Act or the applicability of any other law 
of similar substance and effect, absent an express statement to the 
contrary hereinabove, this e-mail message its contents, and any attachments 
hereto are not intended to represent an offer or acceptance to enter into a 
contract and are not otherwise intended to bind the sender, 42Q (or any of 
its subsidiaries), or any other person or entity.

Re: [Axis2] 1.8.0 not encoding CDATA xml string inputs

Posted by robertlazarski <ro...@gmail.com>.
Axis2 1.6.2 is from ten years ago. I took a look in the git commit messages
and a few classes, and couldn't find an obvious reason for the change.

It's possible this change was deliberate to fix something in relation to
xml-c14n - just a guess.

If you could help me pin down what class in the code you think this CDATA
is being generated via some trace level logging or even suggest a fix, I
can take a look at it and see if it's deliberate or a code change is
warranted.

On Wed, Apr 20, 2022 at 4:58 AM Tom B. Lake [42-Q] <to...@42-q.com>
wrote:

> Hi Axis2 team,
>
> We are upgrading from Axis2 1.6.2 to 1.8.0 war. In 1.8.0 testing, if a web
> service operation has a string input wrapped in a CDATA tag (because its
> xml), the string isn't being xml encoded for < and > characters. We log the
> soap message at the start of MessageReceiverInOut. With axis2 1.6.2 the
> input string is encoded at that point but with 1.8.0 it's still wrapped in
> a CDATA tag. The web service op ends up with an empty string for the input
> because it's still wrapped in a CDATA tag? Is there a config to have CDATA
> tags converted in 1.8.0?
>
> 1.8.0 log:
> 2022-04-20T12:59:10,283 INFO http-nio-8081-exec-5
> org.apache.axis2.receivers.AbstractMessageReceiver - Request:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:intranet:MDS:hcommsf">
>    <soapenv:Header/>
>    <soapenv:Body>
>       <urn:WebServiceAck>
>          <urn:inbound_message><![CDATA[
> <ACKNOWLEDGEMENTS>
>   <ROUTING_URL>http://localhost:8081/axis2/services/hcommsfService?wsdl
> </ROUTING_URL>
>   <MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18</MESSAGE_ID>
>   <TRANSACTION_ID>1938378</TRANSACTION_ID>
>   <ACK_TYPE>WIPMOVE ACK</ACK_TYPE>
>   <ORG_ID>TEST1</ORG_ID>
>   <PROJECT_CODE>ABCD|TEST1</PROJECT_CODE>
> <ACKNOWLEDGEMENT>
>     <ORIGINAL_TRANSACTION_ID>1113</ORIGINAL_TRANSACTION_ID>
>     <DATA>TEST-LM022</DATA>
>     <STATUS_CODE>4</STATUS_CODE>
>     <STATUS_DESCRIPTION>PROCESSED OKAY</STATUS_DESCRIPTION>
>   </ACKNOWLEDGEMENT>
> </ACKNOWLEDGEMENTS>
> ]]>
> </urn:inbound_message>
>       </urn:WebServiceAck>
>    </soapenv:Body>
> </soapenv:Envelope>
>
> 1.6.2 log:
> 2022-04-20 13:01:29,138 INFO  [AbstractMessageReceiver] (41) - Request:
> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:intranet:MDS:hcommsf"><soapenv:Body>
>       <urn:WebServiceAck>
>          <urn:inbound_message>
> &lt;ACKNOWLEDGEMENTS>
>   &lt;ROUTING_URL>
> http://localhost:8081/axis2/services/hcommsfService?wsdl&lt;/ROUTING_URL>
>   &lt;MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18&lt;/MESSAGE_ID>
>   &lt;TRANSACTION_ID>1938378&lt;/TRANSACTION_ID>
>   &lt;ACK_TYPE>WIPMOVE ACK&lt;/ACK_TYPE>
>   &lt;ORG_ID>TEST1&lt;/ORG_ID>
>   &lt;PROJECT_CODE>ABCD|TEST1&lt;/PROJECT_CODE>
> &lt;ACKNOWLEDGEMENT>
>     &lt;ORIGINAL_TRANSACTION_ID>1113&lt;/ORIGINAL_TRANSACTION_ID>
>     &lt;DATA>TEST-LM022&lt;/DATA>
>     &lt;STATUS_CODE>4&lt;/STATUS_CODE>
>     &lt;STATUS_DESCRIPTION>PROCESSED OKAY&lt;/STATUS_DESCRIPTION>
>   &lt;/ACKNOWLEDGEMENT>
> &lt;/ACKNOWLEDGEMENTS>
> </urn:inbound_message>
>       </urn:WebServiceAck>
>    </soapenv:Body></soapenv:Envelope>
>
> Regards
>
> CONFIDENTIALITY
> This e-mail message and any attachments thereto, is intended only for use
> by the addressee(s) named herein and may contain legally privileged and/or
> confidential information. If you are not the intended recipient of this
> e-mail message, you are hereby notified that any dissemination,
> distribution or copying of this e-mail message, and any attachments
> thereto, is strictly prohibited. If you have received this e-mail message
> in error, please immediately notify the sender and permanently delete the
> original and any copies of this email and any prints thereof.
> ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS E-MAIL IS
> NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the Uniform
> Electronic Transactions Act or the applicability of any other law of
> similar substance and effect, absent an express statement to the contrary
> hereinabove, this e-mail message its contents, and any attachments hereto
> are not intended to represent an offer or acceptance to enter into a
> contract and are not otherwise intended to bind the sender, 42Q (or any of
> its subsidiaries), or any other person or entity.
>

RE: [Axis2] 1.8.0 not encoding CDATA xml string inputs

Posted by "Fedor, Joey" <jo...@sap.com.INVALID>.
Hi all,

We had run into this same issue when testing Axis 1.8.0 back in November it was due to an issue in axiom at the time . We updated axiom at the time to 1.3.1-SNAPSHOT and it resolved the issue. Here is the commit on axioms github: Fix the getElementText implementation · apache/ws-axiom@f8eb657 · GitHub<https://github.com/apache/ws-axiom/commit/f8eb657ee0c9ee0fd4754ccdc6c96da20dc6de4d>

Hope this was helpful in solving your issue,
Joey

From: Tom B. Lake [42-Q] <to...@42-q.com>
Sent: Sunday, April 24, 2022 9:23 PM
To: java-user@axis.apache.org
Subject: Re: [Axis2] 1.8.0 not encoding CDATA xml string inputs

The web service code is from wsdl2java and has a skeleton, a MessageReceiverInOut and type classes. The aar is maven generated. In 1.6.2 the xml encoding happens before MessageReceiverInOut gets the soap message.

On Sat, Apr 23, 2022 at 7:00 AM Andreas Veithen-Knowles <an...@gmail.com>> wrote:


On Wed, Apr 20, 2022 at 3:58 PM Tom B. Lake [42-Q] <to...@42-q.com>> wrote:
Hi Axis2 team,

We are upgrading from Axis2 1.6.2 to 1.8.0 war. In 1.8.0 testing, if a web service operation has a string input wrapped in a CDATA tag (because its xml), the string isn't being xml encoded for < and > characters. We log the soap message at the start of MessageReceiverInOut. With axis2 1.6.2 the input string is encoded at that point but with 1.8.0 it's still wrapped in a CDATA tag. The web service op ends up with an empty string for the input because it's still wrapped in a CDATA tag?

That shouldn't be the case. How is the Web service implemented?

Is there a config to have CDATA tags converted in 1.8.0?

1.8.0 log:
2022-04-20T12:59:10,283 INFO http-nio-8081-exec-5 org.apache.axis2.receivers.AbstractMessageReceiver - Request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:intranet:MDS:hcommsf">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:WebServiceAck>
         <urn:inbound_message><![CDATA[
<ACKNOWLEDGEMENTS>
  <ROUTING_URL>http://localhost:8081/axis2/services/hcommsfService?wsdl</ROUTING_URL>
  <MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18</MESSAGE_ID>
  <TRANSACTION_ID>1938378</TRANSACTION_ID>
  <ACK_TYPE>WIPMOVE ACK</ACK_TYPE>
  <ORG_ID>TEST1</ORG_ID>
  <PROJECT_CODE>ABCD|TEST1</PROJECT_CODE>
<ACKNOWLEDGEMENT>
    <ORIGINAL_TRANSACTION_ID>1113</ORIGINAL_TRANSACTION_ID>
    <DATA>TEST-LM022</DATA>
    <STATUS_CODE>4</STATUS_CODE>
    <STATUS_DESCRIPTION>PROCESSED OKAY</STATUS_DESCRIPTION>
  </ACKNOWLEDGEMENT>
</ACKNOWLEDGEMENTS>
]]>
</urn:inbound_message>
      </urn:WebServiceAck>
   </soapenv:Body>
</soapenv:Envelope>

1.6.2 log:
2022-04-20 13:01:29,138 INFO  [AbstractMessageReceiver] (41) - Request: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:intranet:MDS:hcommsf"><soapenv:Body>
      <urn:WebServiceAck>
         <urn:inbound_message>
&lt;ACKNOWLEDGEMENTS>
  &lt;ROUTING_URL>http://localhost:8081/axis2/services/hcommsfService?wsdl&lt;/ROUTING_URL>
  &lt;MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18&lt;/MESSAGE_ID>
  &lt;TRANSACTION_ID>1938378&lt;/TRANSACTION_ID>
  &lt;ACK_TYPE>WIPMOVE ACK&lt;/ACK_TYPE>
  &lt;ORG_ID>TEST1&lt;/ORG_ID>
  &lt;PROJECT_CODE>ABCD|TEST1&lt;/PROJECT_CODE>
&lt;ACKNOWLEDGEMENT>
    &lt;ORIGINAL_TRANSACTION_ID>1113&lt;/ORIGINAL_TRANSACTION_ID>
    &lt;DATA>TEST-LM022&lt;/DATA>
    &lt;STATUS_CODE>4&lt;/STATUS_CODE>
    &lt;STATUS_DESCRIPTION>PROCESSED OKAY&lt;/STATUS_DESCRIPTION>
  &lt;/ACKNOWLEDGEMENT>
&lt;/ACKNOWLEDGEMENTS>
</urn:inbound_message>
      </urn:WebServiceAck>
   </soapenv:Body></soapenv:Envelope>

Regards

CONFIDENTIALITY
This e-mail message and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail message, you are hereby notified that any dissemination, distribution or copying of this e-mail message, and any attachments thereto, is strictly prohibited. If you have received this e-mail message in error, please immediately notify the sender and permanently delete the original and any copies of this email and any prints thereof.
ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS E-MAIL IS NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the Uniform Electronic Transactions Act or the applicability of any other law of similar substance and effect, absent an express statement to the contrary hereinabove, this e-mail message its contents, and any attachments hereto are not intended to represent an offer or acceptance to enter into a contract and are not otherwise intended to bind the sender, 42Q (or any of its subsidiaries), or any other person or entity.

CONFIDENTIALITY
This e-mail message and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail message, you are hereby notified that any dissemination, distribution or copying of this e-mail message, and any attachments thereto, is strictly prohibited. If you have received this e-mail message in error, please immediately notify the sender and permanently delete the original and any copies of this email and any prints thereof.
ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS E-MAIL IS NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the Uniform Electronic Transactions Act or the applicability of any other law of similar substance and effect, absent an express statement to the contrary hereinabove, this e-mail message its contents, and any attachments hereto are not intended to represent an offer or acceptance to enter into a contract and are not otherwise intended to bind the sender, 42Q (or any of its subsidiaries), or any other person or entity.

Re: [Axis2] 1.8.0 not encoding CDATA xml string inputs

Posted by "Tom B. Lake [42-Q]" <to...@42-q.com>.
The web service code is from wsdl2java and has a skeleton, a
MessageReceiverInOut and type classes. The aar is maven generated. In 1.6.2
the xml encoding happens before MessageReceiverInOut gets the soap message.

On Sat, Apr 23, 2022 at 7:00 AM Andreas Veithen-Knowles <
andreas.veithen@gmail.com> wrote:

>
>
> On Wed, Apr 20, 2022 at 3:58 PM Tom B. Lake [42-Q] <to...@42-q.com>
> wrote:
>
>> Hi Axis2 team,
>>
>> We are upgrading from Axis2 1.6.2 to 1.8.0 war. In 1.8.0 testing, if a
>> web service operation has a string input wrapped in a CDATA tag (because
>> its xml), the string isn't being xml encoded for < and > characters. We log
>> the soap message at the start of MessageReceiverInOut. With axis2 1.6.2 the
>> input string is encoded at that point but with 1.8.0 it's still wrapped in
>> a CDATA tag. The web service op ends up with an empty string for the input
>> because it's still wrapped in a CDATA tag?
>>
>
> That shouldn't be the case. How is the Web service implemented?
>
>
>> Is there a config to have CDATA tags converted in 1.8.0?
>>
>> 1.8.0 log:
>> 2022-04-20T12:59:10,283 INFO http-nio-8081-exec-5
>> org.apache.axis2.receivers.AbstractMessageReceiver - Request:
>> <soapenv:Envelope xmlns:soapenv="
>> http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:urn="urn:intranet:MDS:hcommsf">
>>    <soapenv:Header/>
>>    <soapenv:Body>
>>       <urn:WebServiceAck>
>>          <urn:inbound_message><![CDATA[
>> <ACKNOWLEDGEMENTS>
>>   <ROUTING_URL>http://localhost:8081/axis2/services/hcommsfService?wsdl
>> </ROUTING_URL>
>>   <MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18</MESSAGE_ID>
>>   <TRANSACTION_ID>1938378</TRANSACTION_ID>
>>   <ACK_TYPE>WIPMOVE ACK</ACK_TYPE>
>>   <ORG_ID>TEST1</ORG_ID>
>>   <PROJECT_CODE>ABCD|TEST1</PROJECT_CODE>
>> <ACKNOWLEDGEMENT>
>>     <ORIGINAL_TRANSACTION_ID>1113</ORIGINAL_TRANSACTION_ID>
>>     <DATA>TEST-LM022</DATA>
>>     <STATUS_CODE>4</STATUS_CODE>
>>     <STATUS_DESCRIPTION>PROCESSED OKAY</STATUS_DESCRIPTION>
>>   </ACKNOWLEDGEMENT>
>> </ACKNOWLEDGEMENTS>
>> ]]>
>> </urn:inbound_message>
>>       </urn:WebServiceAck>
>>    </soapenv:Body>
>> </soapenv:Envelope>
>>
>> 1.6.2 log:
>> 2022-04-20 13:01:29,138 INFO  [AbstractMessageReceiver] (41) - Request:
>> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
>> http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:urn="urn:intranet:MDS:hcommsf"><soapenv:Body>
>>       <urn:WebServiceAck>
>>          <urn:inbound_message>
>> &lt;ACKNOWLEDGEMENTS>
>>   &lt;ROUTING_URL>
>> http://localhost:8081/axis2/services/hcommsfService?wsdl&lt;/ROUTING_URL>
>>   &lt;MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18&lt;/MESSAGE_ID>
>>   &lt;TRANSACTION_ID>1938378&lt;/TRANSACTION_ID>
>>   &lt;ACK_TYPE>WIPMOVE ACK&lt;/ACK_TYPE>
>>   &lt;ORG_ID>TEST1&lt;/ORG_ID>
>>   &lt;PROJECT_CODE>ABCD|TEST1&lt;/PROJECT_CODE>
>> &lt;ACKNOWLEDGEMENT>
>>     &lt;ORIGINAL_TRANSACTION_ID>1113&lt;/ORIGINAL_TRANSACTION_ID>
>>     &lt;DATA>TEST-LM022&lt;/DATA>
>>     &lt;STATUS_CODE>4&lt;/STATUS_CODE>
>>     &lt;STATUS_DESCRIPTION>PROCESSED OKAY&lt;/STATUS_DESCRIPTION>
>>   &lt;/ACKNOWLEDGEMENT>
>> &lt;/ACKNOWLEDGEMENTS>
>> </urn:inbound_message>
>>       </urn:WebServiceAck>
>>    </soapenv:Body></soapenv:Envelope>
>>
>> Regards
>>
>> CONFIDENTIALITY
>> This e-mail message and any attachments thereto, is intended only for use
>> by the addressee(s) named herein and may contain legally privileged and/or
>> confidential information. If you are not the intended recipient of this
>> e-mail message, you are hereby notified that any dissemination,
>> distribution or copying of this e-mail message, and any attachments
>> thereto, is strictly prohibited. If you have received this e-mail message
>> in error, please immediately notify the sender and permanently delete the
>> original and any copies of this email and any prints thereof.
>> ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS E-MAIL IS
>> NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the Uniform
>> Electronic Transactions Act or the applicability of any other law of
>> similar substance and effect, absent an express statement to the contrary
>> hereinabove, this e-mail message its contents, and any attachments hereto
>> are not intended to represent an offer or acceptance to enter into a
>> contract and are not otherwise intended to bind the sender, 42Q (or any of
>> its subsidiaries), or any other person or entity.
>>
>

-- 
CONFIDENTIALITY
This e-mail message and any attachments thereto, is 
intended only for use by the addressee(s) named herein and may contain 
legally privileged and/or confidential information. If you are not the 
intended recipient of this e-mail message, you are hereby notified that any 
dissemination, distribution or copying of this e-mail message, and any 
attachments thereto, is strictly prohibited. If you have received this 
e-mail message in error, please immediately notify the sender and 
permanently delete the original and any copies of this email and any prints 
thereof.
ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS 
E-MAIL IS NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the 
Uniform Electronic Transactions Act or the applicability of any other law 
of similar substance and effect, absent an express statement to the 
contrary hereinabove, this e-mail message its contents, and any attachments 
hereto are not intended to represent an offer or acceptance to enter into a 
contract and are not otherwise intended to bind the sender, 42Q (or any of 
its subsidiaries), or any other person or entity.

Re: [Axis2] 1.8.0 not encoding CDATA xml string inputs

Posted by Andreas Veithen-Knowles <an...@gmail.com>.
On Wed, Apr 20, 2022 at 3:58 PM Tom B. Lake [42-Q] <to...@42-q.com>
wrote:

> Hi Axis2 team,
>
> We are upgrading from Axis2 1.6.2 to 1.8.0 war. In 1.8.0 testing, if a web
> service operation has a string input wrapped in a CDATA tag (because its
> xml), the string isn't being xml encoded for < and > characters. We log the
> soap message at the start of MessageReceiverInOut. With axis2 1.6.2 the
> input string is encoded at that point but with 1.8.0 it's still wrapped in
> a CDATA tag. The web service op ends up with an empty string for the input
> because it's still wrapped in a CDATA tag?
>

That shouldn't be the case. How is the Web service implemented?


> Is there a config to have CDATA tags converted in 1.8.0?
>
> 1.8.0 log:
> 2022-04-20T12:59:10,283 INFO http-nio-8081-exec-5
> org.apache.axis2.receivers.AbstractMessageReceiver - Request:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:intranet:MDS:hcommsf">
>    <soapenv:Header/>
>    <soapenv:Body>
>       <urn:WebServiceAck>
>          <urn:inbound_message><![CDATA[
> <ACKNOWLEDGEMENTS>
>   <ROUTING_URL>http://localhost:8081/axis2/services/hcommsfService?wsdl
> </ROUTING_URL>
>   <MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18</MESSAGE_ID>
>   <TRANSACTION_ID>1938378</TRANSACTION_ID>
>   <ACK_TYPE>WIPMOVE ACK</ACK_TYPE>
>   <ORG_ID>TEST1</ORG_ID>
>   <PROJECT_CODE>ABCD|TEST1</PROJECT_CODE>
> <ACKNOWLEDGEMENT>
>     <ORIGINAL_TRANSACTION_ID>1113</ORIGINAL_TRANSACTION_ID>
>     <DATA>TEST-LM022</DATA>
>     <STATUS_CODE>4</STATUS_CODE>
>     <STATUS_DESCRIPTION>PROCESSED OKAY</STATUS_DESCRIPTION>
>   </ACKNOWLEDGEMENT>
> </ACKNOWLEDGEMENTS>
> ]]>
> </urn:inbound_message>
>       </urn:WebServiceAck>
>    </soapenv:Body>
> </soapenv:Envelope>
>
> 1.6.2 log:
> 2022-04-20 13:01:29,138 INFO  [AbstractMessageReceiver] (41) - Request:
> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:intranet:MDS:hcommsf"><soapenv:Body>
>       <urn:WebServiceAck>
>          <urn:inbound_message>
> &lt;ACKNOWLEDGEMENTS>
>   &lt;ROUTING_URL>
> http://localhost:8081/axis2/services/hcommsfService?wsdl&lt;/ROUTING_URL>
>   &lt;MESSAGE_ID>AF880DCF68605199E050D8CCC4203C18&lt;/MESSAGE_ID>
>   &lt;TRANSACTION_ID>1938378&lt;/TRANSACTION_ID>
>   &lt;ACK_TYPE>WIPMOVE ACK&lt;/ACK_TYPE>
>   &lt;ORG_ID>TEST1&lt;/ORG_ID>
>   &lt;PROJECT_CODE>ABCD|TEST1&lt;/PROJECT_CODE>
> &lt;ACKNOWLEDGEMENT>
>     &lt;ORIGINAL_TRANSACTION_ID>1113&lt;/ORIGINAL_TRANSACTION_ID>
>     &lt;DATA>TEST-LM022&lt;/DATA>
>     &lt;STATUS_CODE>4&lt;/STATUS_CODE>
>     &lt;STATUS_DESCRIPTION>PROCESSED OKAY&lt;/STATUS_DESCRIPTION>
>   &lt;/ACKNOWLEDGEMENT>
> &lt;/ACKNOWLEDGEMENTS>
> </urn:inbound_message>
>       </urn:WebServiceAck>
>    </soapenv:Body></soapenv:Envelope>
>
> Regards
>
> CONFIDENTIALITY
> This e-mail message and any attachments thereto, is intended only for use
> by the addressee(s) named herein and may contain legally privileged and/or
> confidential information. If you are not the intended recipient of this
> e-mail message, you are hereby notified that any dissemination,
> distribution or copying of this e-mail message, and any attachments
> thereto, is strictly prohibited. If you have received this e-mail message
> in error, please immediately notify the sender and permanently delete the
> original and any copies of this email and any prints thereof.
> ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS E-MAIL IS
> NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the Uniform
> Electronic Transactions Act or the applicability of any other law of
> similar substance and effect, absent an express statement to the contrary
> hereinabove, this e-mail message its contents, and any attachments hereto
> are not intended to represent an offer or acceptance to enter into a
> contract and are not otherwise intended to bind the sender, 42Q (or any of
> its subsidiaries), or any other person or entity.
>