Support Article
Connect-Soap with WS-Security fails randomly
Summary
The user recently implemented Connect-Soap with WS-Security for wire application. It is failing sporadically. They tried to find the request in the TCP dump, but they couldn't find the request. However, in Pega logs it showing the failed with soap fault error.
Error Messages
com.pega.pegarules.pub.services.RemoteApplicationException: SOAP service failed
at com.pegarules.generated.activity.ra_action_invokeaxis2_4a152f7e36f4436425348faef88efbea.step8_circum0(ra_action_invokeaxis2_4a152f7e36f4436425348faef88efbea.java:1382)
at com.pegarules.generated.activity.ra_action_invokeaxis2_4a152f7e36f4436425348faef88efbea.perform(ra_action_invokeaxis2_4a152f7e36f4436425348faef88efbea.java:189)
....
Caused by: com.pega.apache.axis2.AxisFault: Error in extracting message properties
at com.pega.apache.rampart.handler.RampartSender.invoke(RampartSender.java:70)
at com.pega.apache.axis2.engine.Phase.invoke(Phase.java:292)
....
Caused by: com.pega.apache.rampart.RampartException: Error in extracting message properties
at com.pega.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:290)
at com.pega.apache.rampart.MessageBuilder.build(MessageBuilder.java:58)
at com.pega.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)
... 111 more
Caused by: com.pega.apache.ws.security.WSSecurityException: Error in converting SOAP Envelope to Document; nested exception is:
com.pega.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 19))
at javax.xml.stream.SerializableLocation@31c931c9
at com.pega.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:157)
at com.pega.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:150)
... 113 more
Caused by: com.pega.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 19))
at javax.xml.stream.SerializableLocation@31c931c9
at com.pega.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:239)
at com.pega.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:318)
at com.pega.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:614)
at com.pega.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:92)
... 114 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 19))
at javax.xml.stream.SerializableLocation@31c931c9
at com.ctc.wstx.sr.StreamScanner.throwInvalidSpace(StreamScanner.java:650)
at com.ctc.wstx.sr.BasicStreamReader.readTextPrimary(BasicStreamReader.java:4554)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2886)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
at com.pega.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:153)
... 117 more
Steps to Reproduce
In a SOAP request body, copy paste some text from a legacy system to the Pega, which contains control characters and execute the SOAP connect.
Root Cause
The user is copying and paste texts from a legacy system which contains special character causing the exception and the request never leaves Pega.
For example:
This dash charecter --> –
Now the character “–“in this text message looks like dash but it isn’t. When we copy and paste this in notepad++ and change the Encoding to ANSI, we see –
Resolution
There is a OOTB function called Encode. Use this function to encode the input string before invoking the SOAP connector.
For example in the activity, just before the connect-SOAP, we can user the function Lib(Pega-RULES:Default).Encode(param.a)
Here param.a is the input text with control characters.
Published October 7, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.