You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by kimhorn <ki...@icsglobal.net> on 2009/04/15 06:29:10 UTC
Does CData work ?
We have a target service that requires a CDATA wrapped tag as the text can
have leading and/or trailing spaces. I have attemped to use a Java Mediator
to wrap the data, in a property, with CData. The
property is then imbedded into XML payload using Javascript, see below.
Extract of Java:
claimData = "<![CDATA[\"" + claimData + "\"]]>";
synCtx.setProperty("claimData", claimData);
Note the " are required to delimit the data for the receiver. However using
TCPMON the data actually sent is:
<ws1:responseFormat>997</ws1:responseFormat>
<ws1:claimData><![CDATA["000000221933601MOHMCRYBA000000022193 etc etc
......
The recipient service does not like this. Synapse escapes the "<" . I was
hoping to get:
<ws1:responseFormat>997</ws1:responseFormat>
<ws1:claimData><![CDATA["000000221933601MOHMCRYBA000000022193 etc etc ......
It appears betwen the mediator and send, the XML gets weird. After the
mediator I am using JavaScript to add the property into the XML payload, see
{claimData}:
<script language="js"><![CDATA[var guid =
mc.getProperty("GUID").toString();
var claimData = mc.getProperty("claimData").toString();
var fileName = mc.getProperty("fileName").toString();
mc.setPayloadXML(<ws1:submitHealthCareClaimBatch
xmlns:ws1="http://ws1.thelma.icsglobal.net">
<ws1:guid>{guid}</ws1:guid>
<ws1:clientBatchId>{guid}</ws1:clientBatchId>
<ws1:claimFormat>NDC</ws1:claimFormat>
<ws1:responseFormat>997</ws1:responseFormat>
<ws1:claimData>{claimData}</ws1:claimData>
</ws1:submitHealthCareClaimBatch>);
]]></script>
Is the Javascript the problem ?
Note it is impossible to insert the CDATA in the Javascript as then the
Javscript become invalid due to the nested CDATA. Hence why I used Java.
If I do all the above in Java, create the payload in Java and wrap the tag
in "<![CDATA[\"" + claimData + "\"]]>" in Java, instead of Javascript, is
this likely to work, or is it the synapse send process escaping the CDATA
XML ?
Thanks
Kim
--
View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23052352.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by kimhorn <ki...@icsglobal.net>.
In looking at this in more detail we found that another problem was loss of
data prior to wrapping the data in CDATA. See "Data Loss Issue "
Kim
Andreas Veithen-2 wrote:
>
> On Mon, Apr 27, 2009 at 06:12, Kim Horn <ki...@icsglobal.net> wrote:
>> Ok started trying to do this fix, and unclear on your instructions.
>> 1) I cannot find the Axiom 1.2.9 trunk, must be somewhere I guess ?
>> Hudson has no build.
>
> Snapshots are available from here:
>
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/ws/commons/axiom/
>
> Alternatively, you can check it out from Subversion and build it:
>
> http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/axiom/
>
>> 2) Below you say " Simply upgrade Woodstox to 4.0.x" - but synapse has
>> no Woodstock.jar files in lib ?
>
> The JAR is called wstx-asl-x.x.x.jar. If I remember well, in version
> 4, this changed to wstx-core-asl-x.x.x.jar.
>
>> 3) So is it Axiom, Stax or Woodstock to upgrade ?
>
> Either Axiom or Woodstox. Upgrading both is not useful.
>
>> So totally unclear on what has to be done ?
>> Can the FAQ provide the downloads (or the URL) for this patch and steps
>> to implement it ?
>>
>> Kim
>>
>> -----Original Message-----
>> From: Kim Horn [mailto:kim.horn@icsglobal.net]
>> Sent: Monday, 27 April 2009 1:13 PM
>> To: dev@synapse.apache.org
>> Subject: RE: Does CData work ?
>>
>> Hello Andreas,
>>
>> Thanks for that and your help.
>>
>> As Axiom 1.2.9 won't be in Synapse 1.3, we have decided to wait till
>> Release 1.4, to begin re-evaluating Synapse again, for Production use.
>> Hopefully CDATA will be supported then and the other issues we have
>> raised, addressed and fixed in a stable release. We really can't keep up
>> with patching the trunk code all the time. Trying to work with all the
>> changes to 1.2 has been very hard. I will document our issues as Jiras,
>> in the near future. In the mean time, I will test if Axiom 1.2.9 works
>> with our data in Synapse.
>>
>> Thanks
>> Kim
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
>> Sent: Monday, 20 April 2009 5:17 PM
>> To: dev
>> Subject: Re: Does CData work ?
>>
>> I think the risk is very small and is largely compensated by the fact
>> that I did a whole bunch of bug fixes in Axiom.
>>
>> Andreas
>>
>> 2009/4/20 kimhorn <ki...@icsglobal.net>:
>>>
>>> That great Andreas,
>>> I will test it out.
>>>
>>> Do you think using 1.2.9 with Synapse Snapshot and 1.3 could be a risk
>>> and result in other incompatabilities ?
>>>
>>> Thanks so much
>>> Kim
>>>
>>>
>>>
>>> Andreas Veithen-2 wrote:
>>>>
>>>> Update: WSCOMMONS-461 is now implemented. See [1] for instructions on
>>>> how to use this feature.
>>>>
>>>> [1] http://people.apache.org/~veithen/synapse/faq.html#cdata
>>>>
>>>> On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net>
>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> thanks again for that. You saved me some time experimenting.
>>>>> I will look at Jira 280 etc; and wait for 1.2.9.
>>>>> Did you mean a Synapse snapshot ?
>>>>>
>>>>> Kim
>>>>>
>>>>>
>>>>>
>>>>> Andreas Veithen-2 wrote:
>>>>>>
>>>>>> I think the primary issue is SYNAPSE-280. There are three
>>>>>> solutions/workarounds for this issue:
>>>>>>
>>>>>> 1. Modify Synapse as described in the JIRA issue (only works for
>>>>>> standalone deployments).
>>>>>> 2. Make CDATA processing configurable at the Axiom level, as
>> described
>>>>>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can
>> use a
>>>>>> snapshot version. Since this is a change to a single class, we
>> could
>>>>>> also prepare a patch with this.
>>>>>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the
>> XML
>>>>>> parser is non coalescing by default (as required by the specs) and
>>>>>> reports CDATA sections.
>>>>>>
>>>>>> As mentioned in SYNAPSE-280, there could be issues because of code
>> in
>>>>>> Axis2 or Synapse that implicitly assumes that the parser is
>>>>>> coalescing. If this problem arises, there is a workaround: by
>>>>>> carefully setting the properties on the Woodstox parser, one can
>>>>>> configure it to coalesce text nodes and CDATA sections separately
>>>>>> (i.e. without merging text nodes and CDATA sections as in the real
>>>>>> coalescing mode).
>>>>>>
>>>>>> There is also another thing that could become an issue under some
>>>>>> circumstances: when sending several consecutive CDATA events to a
>>>>>> XMLStreamWriter, it will write them as distinct CDATA sections.
>> This
>>>>>> makes sense but it is a limitation when there is a need to wrap a
>> very
>>>>>> long text in a single CDATA section.
>>>>>>
>>>>>> I'm not aware of any other issues related to CDATA sections.
>>>>>>
>>>>>>
>>>>>> Andreas
>>>>>>
>>>>>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net>
>> wrote:
>>>>>>>
>>>>>>> Thanks, i'l try that. There was a lot of issues around CDATA, in
>> the
>>>>>>> past,
>>>>>>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>>>>>>> experimenting further ?
>>>>>>>
>>>>>>> Kim
>>>>>>>
>>>>>>>
>>>>>>> Andreas Veithen-2 wrote:
>>>>>>>>
>>>>>>>>> Is the Javascript the problem ?
>>>>>>>>> Note it is impossible to insert the CDATA in the Javascript as
>> then
>>>>>>>>> the
>>>>>>>>> Javscript become invalid due to the nested CDATA. Hence why I
>> used
>>>>>>>>> Java.
>>>>>>>>
>>>>>>>> I see 3 possible ways to achieve this (assuming that the XML
>> scripting
>>>>>>>> supports CDATA sections, which needs to be confirmed):
>>>>>>>>
>>>>>>>> * I think scripts can be loaded from registry entries and that
>> plain
>>>>>>>> text files are supported by the registry. In that case there is
>> no
>>>>>>>> problem with escaping.
>>>>>>>>
>>>>>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>>>>>> entities, i.e. replace all < by <:
>>>>>>>>
>>>>>>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>>>>>
>>>>>>>> * Escape the JavaScript using a CDATA section, except for the
>> embedded
>>>>>>>> ]]>:
>>>>>>>>
>>>>>>>> <![CDATA[
>>>>>>>> ...
>>>>>>>>
>> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>>>>>> ...
>>>>>>>> ]]>
>>>>>>>>
>>>>>>>> Alternatively, if you want something (slightly) more readable:
>>>>>>>>
>>>>>>>> <![CDATA[
>>>>>>>> ...
>>>>>>>>
>> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>>>>>> ...
>>>>>>>> ]]>
>>>>>>>>
>>>>>>>>
>>>>>>>> Andreas
>>>>>>>>
>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>>>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
>>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>> http://www.nabble.com/Does-CData-work---tp23052352p23128036.html
>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23497135.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
RE: Does CData work ?
Posted by Kim Horn <ki...@icsglobal.net>.
Thanks; That's a great help. For historic reasons we use XFire here, and
so not so familiar with all Axis/Axiom work.
Soon we will have to re-investigate continuing to use XFire.. about the
same time as we move up to Java 1.6 !!!
-----Original Message-----
From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
Sent: Wednesday, 6 May 2009 1:25 AM
To: dev@synapse.apache.org
Subject: Re: Does CData work ?
On Mon, Apr 27, 2009 at 06:12, Kim Horn <ki...@icsglobal.net> wrote:
> Ok started trying to do this fix, and unclear on your instructions.
> 1) I cannot find the Axiom 1.2.9 trunk, must be somewhere I guess ?
> Hudson has no build.
Snapshots are available from here:
http://people.apache.org/repo/m2-snapshot-repository/org/apache/ws/commo
ns/axiom/
Alternatively, you can check it out from Subversion and build it:
http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/axiom/
> 2) Below you say " Simply upgrade Woodstox to 4.0.x" - but synapse has
> no Woodstock.jar files in lib ?
The JAR is called wstx-asl-x.x.x.jar. If I remember well, in version
4, this changed to wstx-core-asl-x.x.x.jar.
> 3) So is it Axiom, Stax or Woodstock to upgrade ?
Either Axiom or Woodstox. Upgrading both is not useful.
> So totally unclear on what has to be done ?
> Can the FAQ provide the downloads (or the URL) for this patch and
steps
> to implement it ?
>
> Kim
>
> -----Original Message-----
> From: Kim Horn [mailto:kim.horn@icsglobal.net]
> Sent: Monday, 27 April 2009 1:13 PM
> To: dev@synapse.apache.org
> Subject: RE: Does CData work ?
>
> Hello Andreas,
>
> Thanks for that and your help.
>
> As Axiom 1.2.9 won't be in Synapse 1.3, we have decided to wait till
> Release 1.4, to begin re-evaluating Synapse again, for Production use.
> Hopefully CDATA will be supported then and the other issues we have
> raised, addressed and fixed in a stable release. We really can't keep
up
> with patching the trunk code all the time. Trying to work with all the
> changes to 1.2 has been very hard. I will document our issues as
Jiras,
> in the near future. In the mean time, I will test if Axiom 1.2.9 works
> with our data in Synapse.
>
> Thanks
> Kim
>
>
>
>
>
> -----Original Message-----
> From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
> Sent: Monday, 20 April 2009 5:17 PM
> To: dev
> Subject: Re: Does CData work ?
>
> I think the risk is very small and is largely compensated by the fact
> that I did a whole bunch of bug fixes in Axiom.
>
> Andreas
>
> 2009/4/20 kimhorn <ki...@icsglobal.net>:
>>
>> That great Andreas,
>> I will test it out.
>>
>> Do you think using 1.2.9 with Synapse Snapshot and 1.3 could be a
risk
>> and result in other incompatabilities ?
>>
>> Thanks so much
>> Kim
>>
>>
>>
>> Andreas Veithen-2 wrote:
>>>
>>> Update: WSCOMMONS-461 is now implemented. See [1] for instructions
on
>>> how to use this feature.
>>>
>>> [1] http://people.apache.org/~veithen/synapse/faq.html#cdata
>>>
>>> On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net>
> wrote:
>>>>
>>>> Hi,
>>>>
>>>> thanks again for that. You saved me some time experimenting.
>>>> I will look at Jira 280 etc; and wait for 1.2.9.
>>>> Did you mean a Synapse snapshot ?
>>>>
>>>> Kim
>>>>
>>>>
>>>>
>>>> Andreas Veithen-2 wrote:
>>>>>
>>>>> I think the primary issue is SYNAPSE-280. There are three
>>>>> solutions/workarounds for this issue:
>>>>>
>>>>> 1. Modify Synapse as described in the JIRA issue (only works for
>>>>> standalone deployments).
>>>>> 2. Make CDATA processing configurable at the Axiom level, as
> described
>>>>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can
> use a
>>>>> snapshot version. Since this is a change to a single class, we
> could
>>>>> also prepare a patch with this.
>>>>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the
> XML
>>>>> parser is non coalescing by default (as required by the specs) and
>>>>> reports CDATA sections.
>>>>>
>>>>> As mentioned in SYNAPSE-280, there could be issues because of code
> in
>>>>> Axis2 or Synapse that implicitly assumes that the parser is
>>>>> coalescing. If this problem arises, there is a workaround: by
>>>>> carefully setting the properties on the Woodstox parser, one can
>>>>> configure it to coalesce text nodes and CDATA sections separately
>>>>> (i.e. without merging text nodes and CDATA sections as in the real
>>>>> coalescing mode).
>>>>>
>>>>> There is also another thing that could become an issue under some
>>>>> circumstances: when sending several consecutive CDATA events to a
>>>>> XMLStreamWriter, it will write them as distinct CDATA sections.
> This
>>>>> makes sense but it is a limitation when there is a need to wrap a
> very
>>>>> long text in a single CDATA section.
>>>>>
>>>>> I'm not aware of any other issues related to CDATA sections.
>>>>>
>>>>>
>>>>> Andreas
>>>>>
>>>>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net>
> wrote:
>>>>>>
>>>>>> Thanks, i'l try that. There was a lot of issues around CDATA, in
> the
>>>>>> past,
>>>>>> and I was wondering if Synapse (Axis, Axiom..) handles them
before
>>>>>> experimenting further ?
>>>>>>
>>>>>> Kim
>>>>>>
>>>>>>
>>>>>> Andreas Veithen-2 wrote:
>>>>>>>
>>>>>>>> Is the Javascript the problem ?
>>>>>>>> Note it is impossible to insert the CDATA in the Javascript as
> then
>>>>>>>> the
>>>>>>>> Javscript become invalid due to the nested CDATA. Hence why I
> used
>>>>>>>> Java.
>>>>>>>
>>>>>>> I see 3 possible ways to achieve this (assuming that the XML
> scripting
>>>>>>> supports CDATA sections, which needs to be confirmed):
>>>>>>>
>>>>>>> * I think scripts can be loaded from registry entries and that
> plain
>>>>>>> text files are supported by the registry. In that case there is
> no
>>>>>>> problem with escaping.
>>>>>>>
>>>>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>>>>> entities, i.e. replace all < by <:
>>>>>>>
>>>>>>>
<ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>>>>
>>>>>>> * Escape the JavaScript using a CDATA section, except for the
> embedded
>>>>>>> ]]>:
>>>>>>>
>>>>>>> <![CDATA[
>>>>>>> ...
>>>>>>>
> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>>>>> ...
>>>>>>> ]]>
>>>>>>>
>>>>>>> Alternatively, if you want something (slightly) more readable:
>>>>>>>
>>>>>>> <![CDATA[
>>>>>>> ...
>>>>>>>
>
<ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>>>>> ...
>>>>>>> ]]>
>>>>>>>
>>>>>>>
>>>>>>> Andreas
>>>>>>>
>>>>>>>
> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>>
> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
> http://www.nabble.com/Does-CData-work---tp23052352p23128036.html
>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by Andreas Veithen <an...@gmail.com>.
On Mon, Apr 27, 2009 at 06:12, Kim Horn <ki...@icsglobal.net> wrote:
> Ok started trying to do this fix, and unclear on your instructions.
> 1) I cannot find the Axiom 1.2.9 trunk, must be somewhere I guess ?
> Hudson has no build.
Snapshots are available from here:
http://people.apache.org/repo/m2-snapshot-repository/org/apache/ws/commons/axiom/
Alternatively, you can check it out from Subversion and build it:
http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/axiom/
> 2) Below you say " Simply upgrade Woodstox to 4.0.x" - but synapse has
> no Woodstock.jar files in lib ?
The JAR is called wstx-asl-x.x.x.jar. If I remember well, in version
4, this changed to wstx-core-asl-x.x.x.jar.
> 3) So is it Axiom, Stax or Woodstock to upgrade ?
Either Axiom or Woodstox. Upgrading both is not useful.
> So totally unclear on what has to be done ?
> Can the FAQ provide the downloads (or the URL) for this patch and steps
> to implement it ?
>
> Kim
>
> -----Original Message-----
> From: Kim Horn [mailto:kim.horn@icsglobal.net]
> Sent: Monday, 27 April 2009 1:13 PM
> To: dev@synapse.apache.org
> Subject: RE: Does CData work ?
>
> Hello Andreas,
>
> Thanks for that and your help.
>
> As Axiom 1.2.9 won't be in Synapse 1.3, we have decided to wait till
> Release 1.4, to begin re-evaluating Synapse again, for Production use.
> Hopefully CDATA will be supported then and the other issues we have
> raised, addressed and fixed in a stable release. We really can't keep up
> with patching the trunk code all the time. Trying to work with all the
> changes to 1.2 has been very hard. I will document our issues as Jiras,
> in the near future. In the mean time, I will test if Axiom 1.2.9 works
> with our data in Synapse.
>
> Thanks
> Kim
>
>
>
>
>
> -----Original Message-----
> From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
> Sent: Monday, 20 April 2009 5:17 PM
> To: dev
> Subject: Re: Does CData work ?
>
> I think the risk is very small and is largely compensated by the fact
> that I did a whole bunch of bug fixes in Axiom.
>
> Andreas
>
> 2009/4/20 kimhorn <ki...@icsglobal.net>:
>>
>> That great Andreas,
>> I will test it out.
>>
>> Do you think using 1.2.9 with Synapse Snapshot and 1.3 could be a risk
>> and result in other incompatabilities ?
>>
>> Thanks so much
>> Kim
>>
>>
>>
>> Andreas Veithen-2 wrote:
>>>
>>> Update: WSCOMMONS-461 is now implemented. See [1] for instructions on
>>> how to use this feature.
>>>
>>> [1] http://people.apache.org/~veithen/synapse/faq.html#cdata
>>>
>>> On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net>
> wrote:
>>>>
>>>> Hi,
>>>>
>>>> thanks again for that. You saved me some time experimenting.
>>>> I will look at Jira 280 etc; and wait for 1.2.9.
>>>> Did you mean a Synapse snapshot ?
>>>>
>>>> Kim
>>>>
>>>>
>>>>
>>>> Andreas Veithen-2 wrote:
>>>>>
>>>>> I think the primary issue is SYNAPSE-280. There are three
>>>>> solutions/workarounds for this issue:
>>>>>
>>>>> 1. Modify Synapse as described in the JIRA issue (only works for
>>>>> standalone deployments).
>>>>> 2. Make CDATA processing configurable at the Axiom level, as
> described
>>>>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can
> use a
>>>>> snapshot version. Since this is a change to a single class, we
> could
>>>>> also prepare a patch with this.
>>>>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the
> XML
>>>>> parser is non coalescing by default (as required by the specs) and
>>>>> reports CDATA sections.
>>>>>
>>>>> As mentioned in SYNAPSE-280, there could be issues because of code
> in
>>>>> Axis2 or Synapse that implicitly assumes that the parser is
>>>>> coalescing. If this problem arises, there is a workaround: by
>>>>> carefully setting the properties on the Woodstox parser, one can
>>>>> configure it to coalesce text nodes and CDATA sections separately
>>>>> (i.e. without merging text nodes and CDATA sections as in the real
>>>>> coalescing mode).
>>>>>
>>>>> There is also another thing that could become an issue under some
>>>>> circumstances: when sending several consecutive CDATA events to a
>>>>> XMLStreamWriter, it will write them as distinct CDATA sections.
> This
>>>>> makes sense but it is a limitation when there is a need to wrap a
> very
>>>>> long text in a single CDATA section.
>>>>>
>>>>> I'm not aware of any other issues related to CDATA sections.
>>>>>
>>>>>
>>>>> Andreas
>>>>>
>>>>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net>
> wrote:
>>>>>>
>>>>>> Thanks, i'l try that. There was a lot of issues around CDATA, in
> the
>>>>>> past,
>>>>>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>>>>>> experimenting further ?
>>>>>>
>>>>>> Kim
>>>>>>
>>>>>>
>>>>>> Andreas Veithen-2 wrote:
>>>>>>>
>>>>>>>> Is the Javascript the problem ?
>>>>>>>> Note it is impossible to insert the CDATA in the Javascript as
> then
>>>>>>>> the
>>>>>>>> Javscript become invalid due to the nested CDATA. Hence why I
> used
>>>>>>>> Java.
>>>>>>>
>>>>>>> I see 3 possible ways to achieve this (assuming that the XML
> scripting
>>>>>>> supports CDATA sections, which needs to be confirmed):
>>>>>>>
>>>>>>> * I think scripts can be loaded from registry entries and that
> plain
>>>>>>> text files are supported by the registry. In that case there is
> no
>>>>>>> problem with escaping.
>>>>>>>
>>>>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>>>>> entities, i.e. replace all < by <:
>>>>>>>
>>>>>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>>>>
>>>>>>> * Escape the JavaScript using a CDATA section, except for the
> embedded
>>>>>>> ]]>:
>>>>>>>
>>>>>>> <![CDATA[
>>>>>>> ...
>>>>>>>
> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>>>>> ...
>>>>>>> ]]>
>>>>>>>
>>>>>>> Alternatively, if you want something (slightly) more readable:
>>>>>>>
>>>>>>> <![CDATA[
>>>>>>> ...
>>>>>>>
> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>>>>> ...
>>>>>>> ]]>
>>>>>>>
>>>>>>>
>>>>>>> Andreas
>>>>>>>
>>>>>>>
> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>>
> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
> http://www.nabble.com/Does-CData-work---tp23052352p23128036.html
>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
RE: Does CData work ?
Posted by Kim Horn <ki...@icsglobal.net>.
Ok started trying to do this fix, and unclear on your instructions.
1) I cannot find the Axiom 1.2.9 trunk, must be somewhere I guess ?
Hudson has no build.
2) Below you say " Simply upgrade Woodstox to 4.0.x" - but synapse has
no Woodstock.jar files in lib ?
3) So is it Axiom, Stax or Woodstock to upgrade ?
So totally unclear on what has to be done ?
Can the FAQ provide the downloads (or the URL) for this patch and steps
to implement it ?
Kim
-----Original Message-----
From: Kim Horn [mailto:kim.horn@icsglobal.net]
Sent: Monday, 27 April 2009 1:13 PM
To: dev@synapse.apache.org
Subject: RE: Does CData work ?
Hello Andreas,
Thanks for that and your help.
As Axiom 1.2.9 won't be in Synapse 1.3, we have decided to wait till
Release 1.4, to begin re-evaluating Synapse again, for Production use.
Hopefully CDATA will be supported then and the other issues we have
raised, addressed and fixed in a stable release. We really can't keep up
with patching the trunk code all the time. Trying to work with all the
changes to 1.2 has been very hard. I will document our issues as Jiras,
in the near future. In the mean time, I will test if Axiom 1.2.9 works
with our data in Synapse.
Thanks
Kim
-----Original Message-----
From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
Sent: Monday, 20 April 2009 5:17 PM
To: dev
Subject: Re: Does CData work ?
I think the risk is very small and is largely compensated by the fact
that I did a whole bunch of bug fixes in Axiom.
Andreas
2009/4/20 kimhorn <ki...@icsglobal.net>:
>
> That great Andreas,
> I will test it out.
>
> Do you think using 1.2.9 with Synapse Snapshot and 1.3 could be a risk
> and result in other incompatabilities ?
>
> Thanks so much
> Kim
>
>
>
> Andreas Veithen-2 wrote:
>>
>> Update: WSCOMMONS-461 is now implemented. See [1] for instructions on
>> how to use this feature.
>>
>> [1] http://people.apache.org/~veithen/synapse/faq.html#cdata
>>
>> On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net>
wrote:
>>>
>>> Hi,
>>>
>>> thanks again for that. You saved me some time experimenting.
>>> I will look at Jira 280 etc; and wait for 1.2.9.
>>> Did you mean a Synapse snapshot ?
>>>
>>> Kim
>>>
>>>
>>>
>>> Andreas Veithen-2 wrote:
>>>>
>>>> I think the primary issue is SYNAPSE-280. There are three
>>>> solutions/workarounds for this issue:
>>>>
>>>> 1. Modify Synapse as described in the JIRA issue (only works for
>>>> standalone deployments).
>>>> 2. Make CDATA processing configurable at the Axiom level, as
described
>>>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can
use a
>>>> snapshot version. Since this is a change to a single class, we
could
>>>> also prepare a patch with this.
>>>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the
XML
>>>> parser is non coalescing by default (as required by the specs) and
>>>> reports CDATA sections.
>>>>
>>>> As mentioned in SYNAPSE-280, there could be issues because of code
in
>>>> Axis2 or Synapse that implicitly assumes that the parser is
>>>> coalescing. If this problem arises, there is a workaround: by
>>>> carefully setting the properties on the Woodstox parser, one can
>>>> configure it to coalesce text nodes and CDATA sections separately
>>>> (i.e. without merging text nodes and CDATA sections as in the real
>>>> coalescing mode).
>>>>
>>>> There is also another thing that could become an issue under some
>>>> circumstances: when sending several consecutive CDATA events to a
>>>> XMLStreamWriter, it will write them as distinct CDATA sections.
This
>>>> makes sense but it is a limitation when there is a need to wrap a
very
>>>> long text in a single CDATA section.
>>>>
>>>> I'm not aware of any other issues related to CDATA sections.
>>>>
>>>>
>>>> Andreas
>>>>
>>>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net>
wrote:
>>>>>
>>>>> Thanks, i'l try that. There was a lot of issues around CDATA, in
the
>>>>> past,
>>>>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>>>>> experimenting further ?
>>>>>
>>>>> Kim
>>>>>
>>>>>
>>>>> Andreas Veithen-2 wrote:
>>>>>>
>>>>>>> Is the Javascript the problem ?
>>>>>>> Note it is impossible to insert the CDATA in the Javascript as
then
>>>>>>> the
>>>>>>> Javscript become invalid due to the nested CDATA. Hence why I
used
>>>>>>> Java.
>>>>>>
>>>>>> I see 3 possible ways to achieve this (assuming that the XML
scripting
>>>>>> supports CDATA sections, which needs to be confirmed):
>>>>>>
>>>>>> * I think scripts can be loaded from registry entries and that
plain
>>>>>> text files are supported by the registry. In that case there is
no
>>>>>> problem with escaping.
>>>>>>
>>>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>>>> entities, i.e. replace all < by <:
>>>>>>
>>>>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>>>
>>>>>> * Escape the JavaScript using a CDATA section, except for the
embedded
>>>>>> ]]>:
>>>>>>
>>>>>> <![CDATA[
>>>>>> ...
>>>>>>
<ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>>>> ...
>>>>>> ]]>
>>>>>>
>>>>>> Alternatively, if you want something (slightly) more readable:
>>>>>>
>>>>>> <![CDATA[
>>>>>> ...
>>>>>>
<ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>>>> ...
>>>>>> ]]>
>>>>>>
>>>>>>
>>>>>> Andreas
>>>>>>
>>>>>>
---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>
>>>>>
>>>>
>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>
> --
> View this message in context:
http://www.nabble.com/Does-CData-work---tp23052352p23128036.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
RE: Does CData work ?
Posted by Kim Horn <ki...@icsglobal.net>.
Hello Andreas,
Thanks for that and your help.
As Axiom 1.2.9 won't be in Synapse 1.3, we have decided to wait till
Release 1.4, to begin re-evaluating Synapse again, for Production use.
Hopefully CDATA will be supported then and the other issues we have
raised, addressed and fixed in a stable release. We really can't keep up
with patching the trunk code all the time. Trying to work with all the
changes to 1.2 has been very hard. I will document our issues as Jiras,
in the near future. In the mean time, I will test if Axiom 1.2.9 works
with our data in Synapse.
Thanks
Kim
-----Original Message-----
From: Andreas Veithen [mailto:andreas.veithen@gmail.com]
Sent: Monday, 20 April 2009 5:17 PM
To: dev
Subject: Re: Does CData work ?
I think the risk is very small and is largely compensated by the fact
that I did a whole bunch of bug fixes in Axiom.
Andreas
2009/4/20 kimhorn <ki...@icsglobal.net>:
>
> That great Andreas,
> I will test it out.
>
> Do you think using 1.2.9 with Synapse Snapshot and 1.3 could be a risk
> and result in other incompatabilities ?
>
> Thanks so much
> Kim
>
>
>
> Andreas Veithen-2 wrote:
>>
>> Update: WSCOMMONS-461 is now implemented. See [1] for instructions on
>> how to use this feature.
>>
>> [1] http://people.apache.org/~veithen/synapse/faq.html#cdata
>>
>> On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net>
wrote:
>>>
>>> Hi,
>>>
>>> thanks again for that. You saved me some time experimenting.
>>> I will look at Jira 280 etc; and wait for 1.2.9.
>>> Did you mean a Synapse snapshot ?
>>>
>>> Kim
>>>
>>>
>>>
>>> Andreas Veithen-2 wrote:
>>>>
>>>> I think the primary issue is SYNAPSE-280. There are three
>>>> solutions/workarounds for this issue:
>>>>
>>>> 1. Modify Synapse as described in the JIRA issue (only works for
>>>> standalone deployments).
>>>> 2. Make CDATA processing configurable at the Axiom level, as
described
>>>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can
use a
>>>> snapshot version. Since this is a change to a single class, we
could
>>>> also prepare a patch with this.
>>>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the
XML
>>>> parser is non coalescing by default (as required by the specs) and
>>>> reports CDATA sections.
>>>>
>>>> As mentioned in SYNAPSE-280, there could be issues because of code
in
>>>> Axis2 or Synapse that implicitly assumes that the parser is
>>>> coalescing. If this problem arises, there is a workaround: by
>>>> carefully setting the properties on the Woodstox parser, one can
>>>> configure it to coalesce text nodes and CDATA sections separately
>>>> (i.e. without merging text nodes and CDATA sections as in the real
>>>> coalescing mode).
>>>>
>>>> There is also another thing that could become an issue under some
>>>> circumstances: when sending several consecutive CDATA events to a
>>>> XMLStreamWriter, it will write them as distinct CDATA sections.
This
>>>> makes sense but it is a limitation when there is a need to wrap a
very
>>>> long text in a single CDATA section.
>>>>
>>>> I'm not aware of any other issues related to CDATA sections.
>>>>
>>>>
>>>> Andreas
>>>>
>>>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net>
wrote:
>>>>>
>>>>> Thanks, i'l try that. There was a lot of issues around CDATA, in
the
>>>>> past,
>>>>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>>>>> experimenting further ?
>>>>>
>>>>> Kim
>>>>>
>>>>>
>>>>> Andreas Veithen-2 wrote:
>>>>>>
>>>>>>> Is the Javascript the problem ?
>>>>>>> Note it is impossible to insert the CDATA in the Javascript as
then
>>>>>>> the
>>>>>>> Javscript become invalid due to the nested CDATA. Hence why I
used
>>>>>>> Java.
>>>>>>
>>>>>> I see 3 possible ways to achieve this (assuming that the XML
scripting
>>>>>> supports CDATA sections, which needs to be confirmed):
>>>>>>
>>>>>> * I think scripts can be loaded from registry entries and that
plain
>>>>>> text files are supported by the registry. In that case there is
no
>>>>>> problem with escaping.
>>>>>>
>>>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>>>> entities, i.e. replace all < by <:
>>>>>>
>>>>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>>>
>>>>>> * Escape the JavaScript using a CDATA section, except for the
embedded
>>>>>> ]]>:
>>>>>>
>>>>>> <![CDATA[
>>>>>> ...
>>>>>>
<ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>>>> ...
>>>>>> ]]>
>>>>>>
>>>>>> Alternatively, if you want something (slightly) more readable:
>>>>>>
>>>>>> <![CDATA[
>>>>>> ...
>>>>>>
<ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>>>> ...
>>>>>> ]]>
>>>>>>
>>>>>>
>>>>>> Andreas
>>>>>>
>>>>>>
---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>
>>>>>
>>>>
>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>
> --
> View this message in context:
http://www.nabble.com/Does-CData-work---tp23052352p23128036.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by Andreas Veithen <an...@gmail.com>.
I think the risk is very small and is largely compensated by the fact
that I did a whole bunch of bug fixes in Axiom.
Andreas
2009/4/20 kimhorn <ki...@icsglobal.net>:
>
> That great Andreas,
> I will test it out.
>
> Do you think using 1.2.9 with Synapse Snapshot and 1.3 could be a risk
> and result in other incompatabilities ?
>
> Thanks so much
> Kim
>
>
>
> Andreas Veithen-2 wrote:
>>
>> Update: WSCOMMONS-461 is now implemented. See [1] for instructions on
>> how to use this feature.
>>
>> [1] http://people.apache.org/~veithen/synapse/faq.html#cdata
>>
>> On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net> wrote:
>>>
>>> Hi,
>>>
>>> thanks again for that. You saved me some time experimenting.
>>> I will look at Jira 280 etc; and wait for 1.2.9.
>>> Did you mean a Synapse snapshot ?
>>>
>>> Kim
>>>
>>>
>>>
>>> Andreas Veithen-2 wrote:
>>>>
>>>> I think the primary issue is SYNAPSE-280. There are three
>>>> solutions/workarounds for this issue:
>>>>
>>>> 1. Modify Synapse as described in the JIRA issue (only works for
>>>> standalone deployments).
>>>> 2. Make CDATA processing configurable at the Axiom level, as described
>>>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can use a
>>>> snapshot version. Since this is a change to a single class, we could
>>>> also prepare a patch with this.
>>>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the XML
>>>> parser is non coalescing by default (as required by the specs) and
>>>> reports CDATA sections.
>>>>
>>>> As mentioned in SYNAPSE-280, there could be issues because of code in
>>>> Axis2 or Synapse that implicitly assumes that the parser is
>>>> coalescing. If this problem arises, there is a workaround: by
>>>> carefully setting the properties on the Woodstox parser, one can
>>>> configure it to coalesce text nodes and CDATA sections separately
>>>> (i.e. without merging text nodes and CDATA sections as in the real
>>>> coalescing mode).
>>>>
>>>> There is also another thing that could become an issue under some
>>>> circumstances: when sending several consecutive CDATA events to a
>>>> XMLStreamWriter, it will write them as distinct CDATA sections. This
>>>> makes sense but it is a limitation when there is a need to wrap a very
>>>> long text in a single CDATA section.
>>>>
>>>> I'm not aware of any other issues related to CDATA sections.
>>>>
>>>>
>>>> Andreas
>>>>
>>>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net> wrote:
>>>>>
>>>>> Thanks, i'l try that. There was a lot of issues around CDATA, in the
>>>>> past,
>>>>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>>>>> experimenting further ?
>>>>>
>>>>> Kim
>>>>>
>>>>>
>>>>> Andreas Veithen-2 wrote:
>>>>>>
>>>>>>> Is the Javascript the problem ?
>>>>>>> Note it is impossible to insert the CDATA in the Javascript as then
>>>>>>> the
>>>>>>> Javscript become invalid due to the nested CDATA. Hence why I used
>>>>>>> Java.
>>>>>>
>>>>>> I see 3 possible ways to achieve this (assuming that the XML scripting
>>>>>> supports CDATA sections, which needs to be confirmed):
>>>>>>
>>>>>> * I think scripts can be loaded from registry entries and that plain
>>>>>> text files are supported by the registry. In that case there is no
>>>>>> problem with escaping.
>>>>>>
>>>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>>>> entities, i.e. replace all < by <:
>>>>>>
>>>>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>>>
>>>>>> * Escape the JavaScript using a CDATA section, except for the embedded
>>>>>> ]]>:
>>>>>>
>>>>>> <![CDATA[
>>>>>> ...
>>>>>> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>>>> ...
>>>>>> ]]>
>>>>>>
>>>>>> Alternatively, if you want something (slightly) more readable:
>>>>>>
>>>>>> <![CDATA[
>>>>>> ...
>>>>>> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>>>> ...
>>>>>> ]]>
>>>>>>
>>>>>>
>>>>>> Andreas
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23128036.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by kimhorn <ki...@icsglobal.net>.
That great Andreas,
I will test it out.
Do you think using 1.2.9 with Synapse Snapshot and 1.3 could be a risk
and result in other incompatabilities ?
Thanks so much
Kim
Andreas Veithen-2 wrote:
>
> Update: WSCOMMONS-461 is now implemented. See [1] for instructions on
> how to use this feature.
>
> [1] http://people.apache.org/~veithen/synapse/faq.html#cdata
>
> On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net> wrote:
>>
>> Hi,
>>
>> thanks again for that. You saved me some time experimenting.
>> I will look at Jira 280 etc; and wait for 1.2.9.
>> Did you mean a Synapse snapshot ?
>>
>> Kim
>>
>>
>>
>> Andreas Veithen-2 wrote:
>>>
>>> I think the primary issue is SYNAPSE-280. There are three
>>> solutions/workarounds for this issue:
>>>
>>> 1. Modify Synapse as described in the JIRA issue (only works for
>>> standalone deployments).
>>> 2. Make CDATA processing configurable at the Axiom level, as described
>>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can use a
>>> snapshot version. Since this is a change to a single class, we could
>>> also prepare a patch with this.
>>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the XML
>>> parser is non coalescing by default (as required by the specs) and
>>> reports CDATA sections.
>>>
>>> As mentioned in SYNAPSE-280, there could be issues because of code in
>>> Axis2 or Synapse that implicitly assumes that the parser is
>>> coalescing. If this problem arises, there is a workaround: by
>>> carefully setting the properties on the Woodstox parser, one can
>>> configure it to coalesce text nodes and CDATA sections separately
>>> (i.e. without merging text nodes and CDATA sections as in the real
>>> coalescing mode).
>>>
>>> There is also another thing that could become an issue under some
>>> circumstances: when sending several consecutive CDATA events to a
>>> XMLStreamWriter, it will write them as distinct CDATA sections. This
>>> makes sense but it is a limitation when there is a need to wrap a very
>>> long text in a single CDATA section.
>>>
>>> I'm not aware of any other issues related to CDATA sections.
>>>
>>>
>>> Andreas
>>>
>>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net> wrote:
>>>>
>>>> Thanks, i'l try that. There was a lot of issues around CDATA, in the
>>>> past,
>>>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>>>> experimenting further ?
>>>>
>>>> Kim
>>>>
>>>>
>>>> Andreas Veithen-2 wrote:
>>>>>
>>>>>> Is the Javascript the problem ?
>>>>>> Note it is impossible to insert the CDATA in the Javascript as then
>>>>>> the
>>>>>> Javscript become invalid due to the nested CDATA. Hence why I used
>>>>>> Java.
>>>>>
>>>>> I see 3 possible ways to achieve this (assuming that the XML scripting
>>>>> supports CDATA sections, which needs to be confirmed):
>>>>>
>>>>> * I think scripts can be loaded from registry entries and that plain
>>>>> text files are supported by the registry. In that case there is no
>>>>> problem with escaping.
>>>>>
>>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>>> entities, i.e. replace all < by <:
>>>>>
>>>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>>
>>>>> * Escape the JavaScript using a CDATA section, except for the embedded
>>>>> ]]>:
>>>>>
>>>>> <![CDATA[
>>>>> ...
>>>>> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>>> ...
>>>>> ]]>
>>>>>
>>>>> Alternatively, if you want something (slightly) more readable:
>>>>>
>>>>> <![CDATA[
>>>>> ...
>>>>> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>>> ...
>>>>> ]]>
>>>>>
>>>>>
>>>>> Andreas
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23128036.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by Andreas Veithen <an...@gmail.com>.
Update: WSCOMMONS-461 is now implemented. See [1] for instructions on
how to use this feature.
[1] http://people.apache.org/~veithen/synapse/faq.html#cdata
On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net> wrote:
>
> Hi,
>
> thanks again for that. You saved me some time experimenting.
> I will look at Jira 280 etc; and wait for 1.2.9.
> Did you mean a Synapse snapshot ?
>
> Kim
>
>
>
> Andreas Veithen-2 wrote:
>>
>> I think the primary issue is SYNAPSE-280. There are three
>> solutions/workarounds for this issue:
>>
>> 1. Modify Synapse as described in the JIRA issue (only works for
>> standalone deployments).
>> 2. Make CDATA processing configurable at the Axiom level, as described
>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can use a
>> snapshot version. Since this is a change to a single class, we could
>> also prepare a patch with this.
>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the XML
>> parser is non coalescing by default (as required by the specs) and
>> reports CDATA sections.
>>
>> As mentioned in SYNAPSE-280, there could be issues because of code in
>> Axis2 or Synapse that implicitly assumes that the parser is
>> coalescing. If this problem arises, there is a workaround: by
>> carefully setting the properties on the Woodstox parser, one can
>> configure it to coalesce text nodes and CDATA sections separately
>> (i.e. without merging text nodes and CDATA sections as in the real
>> coalescing mode).
>>
>> There is also another thing that could become an issue under some
>> circumstances: when sending several consecutive CDATA events to a
>> XMLStreamWriter, it will write them as distinct CDATA sections. This
>> makes sense but it is a limitation when there is a need to wrap a very
>> long text in a single CDATA section.
>>
>> I'm not aware of any other issues related to CDATA sections.
>>
>>
>> Andreas
>>
>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net> wrote:
>>>
>>> Thanks, i'l try that. There was a lot of issues around CDATA, in the
>>> past,
>>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>>> experimenting further ?
>>>
>>> Kim
>>>
>>>
>>> Andreas Veithen-2 wrote:
>>>>
>>>>> Is the Javascript the problem ?
>>>>> Note it is impossible to insert the CDATA in the Javascript as then the
>>>>> Javscript become invalid due to the nested CDATA. Hence why I used
>>>>> Java.
>>>>
>>>> I see 3 possible ways to achieve this (assuming that the XML scripting
>>>> supports CDATA sections, which needs to be confirmed):
>>>>
>>>> * I think scripts can be loaded from registry entries and that plain
>>>> text files are supported by the registry. In that case there is no
>>>> problem with escaping.
>>>>
>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>> entities, i.e. replace all < by <:
>>>>
>>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>
>>>> * Escape the JavaScript using a CDATA section, except for the embedded
>>>> ]]>:
>>>>
>>>> <![CDATA[
>>>> ...
>>>> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>> ...
>>>> ]]>
>>>>
>>>> Alternatively, if you want something (slightly) more readable:
>>>>
>>>> <![CDATA[
>>>> ...
>>>> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>> ...
>>>> ]]>
>>>>
>>>>
>>>> Andreas
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by Andreas Veithen <an...@gmail.com>.
I meant a snapshot version of Axiom. 1.2.9 refers to the next release of Axiom.
Andreas
On Fri, Apr 17, 2009 at 02:34, kimhorn <ki...@icsglobal.net> wrote:
>
> Hi,
>
> thanks again for that. You saved me some time experimenting.
> I will look at Jira 280 etc; and wait for 1.2.9.
> Did you mean a Synapse snapshot ?
>
> Kim
>
>
>
> Andreas Veithen-2 wrote:
>>
>> I think the primary issue is SYNAPSE-280. There are three
>> solutions/workarounds for this issue:
>>
>> 1. Modify Synapse as described in the JIRA issue (only works for
>> standalone deployments).
>> 2. Make CDATA processing configurable at the Axiom level, as described
>> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can use a
>> snapshot version. Since this is a change to a single class, we could
>> also prepare a patch with this.
>> 3. Simply upgrade Woodstox to 4.0.x, because in that version the XML
>> parser is non coalescing by default (as required by the specs) and
>> reports CDATA sections.
>>
>> As mentioned in SYNAPSE-280, there could be issues because of code in
>> Axis2 or Synapse that implicitly assumes that the parser is
>> coalescing. If this problem arises, there is a workaround: by
>> carefully setting the properties on the Woodstox parser, one can
>> configure it to coalesce text nodes and CDATA sections separately
>> (i.e. without merging text nodes and CDATA sections as in the real
>> coalescing mode).
>>
>> There is also another thing that could become an issue under some
>> circumstances: when sending several consecutive CDATA events to a
>> XMLStreamWriter, it will write them as distinct CDATA sections. This
>> makes sense but it is a limitation when there is a need to wrap a very
>> long text in a single CDATA section.
>>
>> I'm not aware of any other issues related to CDATA sections.
>>
>>
>> Andreas
>>
>> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net> wrote:
>>>
>>> Thanks, i'l try that. There was a lot of issues around CDATA, in the
>>> past,
>>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>>> experimenting further ?
>>>
>>> Kim
>>>
>>>
>>> Andreas Veithen-2 wrote:
>>>>
>>>>> Is the Javascript the problem ?
>>>>> Note it is impossible to insert the CDATA in the Javascript as then the
>>>>> Javscript become invalid due to the nested CDATA. Hence why I used
>>>>> Java.
>>>>
>>>> I see 3 possible ways to achieve this (assuming that the XML scripting
>>>> supports CDATA sections, which needs to be confirmed):
>>>>
>>>> * I think scripts can be loaded from registry entries and that plain
>>>> text files are supported by the registry. In that case there is no
>>>> problem with escaping.
>>>>
>>>> * Instead of escaping the JavaScript using a CDATA section, use
>>>> entities, i.e. replace all < by <:
>>>>
>>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>>
>>>> * Escape the JavaScript using a CDATA section, except for the embedded
>>>> ]]>:
>>>>
>>>> <![CDATA[
>>>> ...
>>>> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>>> ...
>>>> ]]>
>>>>
>>>> Alternatively, if you want something (slightly) more readable:
>>>>
>>>> <![CDATA[
>>>> ...
>>>> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>>> ...
>>>> ]]>
>>>>
>>>>
>>>> Andreas
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>>
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by kimhorn <ki...@icsglobal.net>.
Hi,
thanks again for that. You saved me some time experimenting.
I will look at Jira 280 etc; and wait for 1.2.9.
Did you mean a Synapse snapshot ?
Kim
Andreas Veithen-2 wrote:
>
> I think the primary issue is SYNAPSE-280. There are three
> solutions/workarounds for this issue:
>
> 1. Modify Synapse as described in the JIRA issue (only works for
> standalone deployments).
> 2. Make CDATA processing configurable at the Axiom level, as described
> in WSCOMMONS-461. This will only be ready for 1.2.9, but you can use a
> snapshot version. Since this is a change to a single class, we could
> also prepare a patch with this.
> 3. Simply upgrade Woodstox to 4.0.x, because in that version the XML
> parser is non coalescing by default (as required by the specs) and
> reports CDATA sections.
>
> As mentioned in SYNAPSE-280, there could be issues because of code in
> Axis2 or Synapse that implicitly assumes that the parser is
> coalescing. If this problem arises, there is a workaround: by
> carefully setting the properties on the Woodstox parser, one can
> configure it to coalesce text nodes and CDATA sections separately
> (i.e. without merging text nodes and CDATA sections as in the real
> coalescing mode).
>
> There is also another thing that could become an issue under some
> circumstances: when sending several consecutive CDATA events to a
> XMLStreamWriter, it will write them as distinct CDATA sections. This
> makes sense but it is a limitation when there is a need to wrap a very
> long text in a single CDATA section.
>
> I'm not aware of any other issues related to CDATA sections.
>
>
> Andreas
>
> On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net> wrote:
>>
>> Thanks, i'l try that. There was a lot of issues around CDATA, in the
>> past,
>> and I was wondering if Synapse (Axis, Axiom..) handles them before
>> experimenting further ?
>>
>> Kim
>>
>>
>> Andreas Veithen-2 wrote:
>>>
>>>> Is the Javascript the problem ?
>>>> Note it is impossible to insert the CDATA in the Javascript as then the
>>>> Javscript become invalid due to the nested CDATA. Hence why I used
>>>> Java.
>>>
>>> I see 3 possible ways to achieve this (assuming that the XML scripting
>>> supports CDATA sections, which needs to be confirmed):
>>>
>>> * I think scripts can be loaded from registry entries and that plain
>>> text files are supported by the registry. In that case there is no
>>> problem with escaping.
>>>
>>> * Instead of escaping the JavaScript using a CDATA section, use
>>> entities, i.e. replace all < by <:
>>>
>>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>>
>>> * Escape the JavaScript using a CDATA section, except for the embedded
>>> ]]>:
>>>
>>> <![CDATA[
>>> ...
>>> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>>> ...
>>> ]]>
>>>
>>> Alternatively, if you want something (slightly) more readable:
>>>
>>> <![CDATA[
>>> ...
>>> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>>> ...
>>> ]]>
>>>
>>>
>>> Andreas
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>>> For additional commands, e-mail: dev-help@synapse.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
>> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23088563.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by Andreas Veithen <an...@gmail.com>.
I think the primary issue is SYNAPSE-280. There are three
solutions/workarounds for this issue:
1. Modify Synapse as described in the JIRA issue (only works for
standalone deployments).
2. Make CDATA processing configurable at the Axiom level, as described
in WSCOMMONS-461. This will only be ready for 1.2.9, but you can use a
snapshot version. Since this is a change to a single class, we could
also prepare a patch with this.
3. Simply upgrade Woodstox to 4.0.x, because in that version the XML
parser is non coalescing by default (as required by the specs) and
reports CDATA sections.
As mentioned in SYNAPSE-280, there could be issues because of code in
Axis2 or Synapse that implicitly assumes that the parser is
coalescing. If this problem arises, there is a workaround: by
carefully setting the properties on the Woodstox parser, one can
configure it to coalesce text nodes and CDATA sections separately
(i.e. without merging text nodes and CDATA sections as in the real
coalescing mode).
There is also another thing that could become an issue under some
circumstances: when sending several consecutive CDATA events to a
XMLStreamWriter, it will write them as distinct CDATA sections. This
makes sense but it is a limitation when there is a need to wrap a very
long text in a single CDATA section.
I'm not aware of any other issues related to CDATA sections.
Andreas
On Wed, Apr 15, 2009 at 23:09, kimhorn <ki...@icsglobal.net> wrote:
>
> Thanks, i'l try that. There was a lot of issues around CDATA, in the past,
> and I was wondering if Synapse (Axis, Axiom..) handles them before
> experimenting further ?
>
> Kim
>
>
> Andreas Veithen-2 wrote:
>>
>>> Is the Javascript the problem ?
>>> Note it is impossible to insert the CDATA in the Javascript as then the
>>> Javscript become invalid due to the nested CDATA. Hence why I used Java.
>>
>> I see 3 possible ways to achieve this (assuming that the XML scripting
>> supports CDATA sections, which needs to be confirmed):
>>
>> * I think scripts can be loaded from registry entries and that plain
>> text files are supported by the registry. In that case there is no
>> problem with escaping.
>>
>> * Instead of escaping the JavaScript using a CDATA section, use
>> entities, i.e. replace all < by <:
>>
>> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>>
>> * Escape the JavaScript using a CDATA section, except for the embedded
>> ]]>:
>>
>> <![CDATA[
>> ...
>> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
>> ...
>> ]]>
>>
>> Alternatively, if you want something (slightly) more readable:
>>
>> <![CDATA[
>> ...
>> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
>> ...
>> ]]>
>>
>>
>> Andreas
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
> Sent from the Synapse - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by kimhorn <ki...@icsglobal.net>.
Thanks, i'l try that. There was a lot of issues around CDATA, in the past,
and I was wondering if Synapse (Axis, Axiom..) handles them before
experimenting further ?
Kim
Andreas Veithen-2 wrote:
>
>> Is the Javascript the problem ?
>> Note it is impossible to insert the CDATA in the Javascript as then the
>> Javscript become invalid due to the nested CDATA. Hence why I used Java.
>
> I see 3 possible ways to achieve this (assuming that the XML scripting
> supports CDATA sections, which needs to be confirmed):
>
> * I think scripts can be loaded from registry entries and that plain
> text files are supported by the registry. In that case there is no
> problem with escaping.
>
> * Instead of escaping the JavaScript using a CDATA section, use
> entities, i.e. replace all < by <:
>
> <ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
>
> * Escape the JavaScript using a CDATA section, except for the embedded
> ]]>:
>
> <![CDATA[
> ...
> <ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
> ...
> ]]>
>
> Alternatively, if you want something (slightly) more readable:
>
> <![CDATA[
> ...
> <ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
> ...
> ]]>
>
>
> Andreas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Does-CData-work---tp23052352p23067194.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Does CData work ?
Posted by Andreas Veithen <an...@gmail.com>.
> Is the Javascript the problem ?
> Note it is impossible to insert the CDATA in the Javascript as then the
> Javscript become invalid due to the nested CDATA. Hence why I used Java.
I see 3 possible ways to achieve this (assuming that the XML scripting
supports CDATA sections, which needs to be confirmed):
* I think scripts can be loaded from registry entries and that plain
text files are supported by the registry. In that case there is no
problem with escaping.
* Instead of escaping the JavaScript using a CDATA section, use
entities, i.e. replace all < by <:
<ws1:claimData><![CDATA["{claimData}"]]></ws1:claimData>
* Escape the JavaScript using a CDATA section, except for the embedded ]]>:
<![CDATA[
...
<ws1:claimData><![CDATA["{claimData}"]]>]]><![CDATA[</ws1:claimData>
...
]]>
Alternatively, if you want something (slightly) more readable:
<![CDATA[
...
<ws1:claimData>]]><![CDATA["{claimData}"]]><![CDATA[</ws1:claimData>
...
]]>
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
RE: Does CData work ?
Posted by Kim Horn <ki...@icsglobal.net>.
Note prior message will not view correctly on Web as the escaped data
gets interpreted and un-escaped. Appears OK in an email.
-----Original Message-----
From: kimhorn [mailto:kim.horn@icsglobal.net]
Sent: Wednesday, 15 April 2009 2:29 PM
To: dev@synapse.apache.org
Subject: Does CData work ?
We have a target service that requires a CDATA wrapped tag as the text
can
have leading and/or trailing spaces. I have attemped to use a Java
Mediator
to wrap the data, in a property, with CData. The
property is then imbedded into XML payload using Javascript, see below.
Extract of Java:
claimData = "<![CDATA[\"" + claimData + "\"]]>";
synCtx.setProperty("claimData", claimData);
Note the " are required to delimit the data for the receiver. However
using
TCPMON the data actually sent is:
<ws1:responseFormat>997</ws1:responseFormat>
<ws1:claimData><![CDATA["000000221933601MOHMCRYBA000000022193 etc etc
......
The recipient service does not like this. Synapse escapes the "<" . I
was
hoping to get:
<ws1:responseFormat>997</ws1:responseFormat>
<ws1:claimData><![CDATA["000000221933601MOHMCRYBA000000022193 etc etc
......
It appears betwen the mediator and send, the XML gets weird. After the
mediator I am using JavaScript to add the property into the XML payload,
see
{claimData}:
<script language="js"><![CDATA[var guid =
mc.getProperty("GUID").toString();
var claimData = mc.getProperty("claimData").toString();
var fileName =
mc.getProperty("fileName").toString();
mc.setPayloadXML(<ws1:submitHealthCareClaimBatch
xmlns:ws1="http://ws1.thelma.icsglobal.net">
<ws1:guid>{guid}</ws1:guid>
<ws1:clientBatchId>{guid}</ws1:clientBatchId>
<ws1:claimFormat>NDC</ws1:claimFormat>
<ws1:responseFormat>997</ws1:responseFormat>
<ws1:claimData>{claimData}</ws1:claimData>
</ws1:submitHealthCareClaimBatch>);
]]></script>
Is the Javascript the problem ?
Note it is impossible to insert the CDATA in the Javascript as then the
Javscript become invalid due to the nested CDATA. Hence why I used Java.
If I do all the above in Java, create the payload in Java and wrap the
tag
in "<![CDATA[\"" + claimData + "\"]]>" in Java, instead of Javascript,
is
this likely to work, or is it the synapse send process escaping the
CDATA
XML ?
Thanks
Kim
--
View this message in context:
http://www.nabble.com/Does-CData-work---tp23052352p23052352.html
Sent from the Synapse - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org