Question
Sberbank
RU
Last activity: 20 Nov 2015 5:13 EST
Send XML with huge CDATA block via SOAP
Hi,
I need to send XML message with one huge CDATA block via SOAP service.When Pega performs processing parameter it has consistently divide one large CDATA block into smaller blocks like this <![CDATA[]]<![CDATA[]]...<![CDATA[]].
How I can fix this?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Sberbank
RU
As a result of searching, I found the following solution
I have edited ootb activity InvokeAxis2, step 13 and set for object instance xmlFactory two parameters:
- javax.xml.stream.isCoalescing =false ( prohibits transforimg <> to < > and etc)
- com.ctc.wstx.minTextSegment = Integer.valueOf(Integer.MAX_VALUE) ( sets length for textSegments including CDATA)
If there are any other solution I'll be glad to hear them
PEG
IN
Which version of PRPC you are using?
Can you try by setting the Request and Response tab in Connect-SOAP to literal?
Sberbank
RU
thanks for your respond!
I am using Pega 7.1.7. And yes, param is Literal
Pegasystems Inc.
GB
Hi Oleg,
How are you constructing the input XML ? Are you manually entering in <![CDATA[]] blocks yourself ?
Do you have an representative example of an input and an output XML document here ? (just enough to show the problem).
For instance, does your input resemble something like this?
<text><![CDATA[ <do_not_intepret_me_mr_parser/> ]]></text>
If so : what does the output look it ?
Cheers
John
Sberbank
RU
Hi, John
I have the Soap service which accepting text type parameter. To initialize this parameter and call SOAP service I set value in DataTransform following way
1. Performing Property-Set-XML step where I writing to local variable Local.TemplateXML content of class instance via XMLStream
2. Setting Local.TemplateXML="<![CDATA["+Local.TemplateXML+"]]>"
3. Sending value of Local.TemplateXML via SOAP connector
XML which we are sending (shorter here for example, in reality it about 5 000 symobls):
<ns1:requestContext><![CDATA[<tempvalue><tempvalue2><test></test></tempvalue2></tempvalue>]]></ns1:requestContext>
In SOAP service side I will have:
<ns1:requestContext><![CDATA[<tempvalue><tempvalue2><te]]><![CDATA[st></test></tempvalue2></tempvalue>]]></ns1:requestContext>
Pegasystems Inc.
GB
Hi Oleg,
Weird: is the system splitting the <test> element into two parts ?
From this:
<test></test>
To this :
<te]]><![CDATA[st>
?
Are you able to test your system using the small payload above ? I just wonder whether we could (at least for a test) use XML Escape Characters rather than CDATA instead ?
Thanks,
John
Sberbank
RU
John,
Yes, system splits element into few parts like:
from <![CDATA[<test></test>]]> to <![CDATA[<tes]]><![CDATA[t></test>]]
It happens when I send big amount of symbols in CDATA ( about 3400 symbols ), if there are less symbols count then no problem at all, all works fine. The "split point" - point where current CDATA is closing and new one is creating - is about 3400 symbol, at this point I have
<![CDATA[<tes]]><![CDATA[t></test>]]
it seems to me that pega has a restriction on symbols length in CDATA block and I want to know the way how to solve this problem
Pegasystems Inc.
GB
Mmh ok - I'll try and replicate this behaviour here - can you outline what I need for such a test ?
I think:
1. Some XML (stored in a Text Property) - this will be the '3400' symbols (or less to start with).
2. An Activity with a Property-Set-XML ?
Do I actually need to invoke a SOAP call in order to see this do you think - or is the test simpler than that - just pass the value in a Parameter ?
Can you outline your test case to help us assist with this ?
Thanks,
John
Sberbank
RU
John,
Thank you for your attention
Here is a test case for repeat this sitation
1. Unfortunately you need to have Soap Service which accepted at least one text parameter
2. Set text parameter for SOAP service. You may use activity or datatransform whatever way You want. You can just fill this parameter in Section by coping huge XML to it.
3. You need increase a log level for InvokeAxis2 activity to "All". InvokeAxis2- is performing call to SOAP service and it is needed for us to see what realy we are sending. DS-System-Operations-System Management Application - Logging and Tracking
4.Then call your Soap Service and look for following words in SystemOut.log "SOAP Request Envelope". You will see the body of message that you are sending
hope you can to test this soon, let's be in touch
Accepted Solution
Sberbank
RU
As a result of searching, I found the following solution
I have edited ootb activity InvokeAxis2, step 13 and set for object instance xmlFactory two parameters:
- javax.xml.stream.isCoalescing =false ( prohibits transforimg <> to < > and etc)
- com.ctc.wstx.minTextSegment = Integer.valueOf(Integer.MAX_VALUE) ( sets length for textSegments including CDATA)
If there are any other solution I'll be glad to hear them
-
Raju Botu