aspose file tools*
The moose likes Web Services and the fly likes How to add exactly 2 NON XML caracters at the end of a SOAP body Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to add exactly 2 NON XML caracters at the end of a SOAP body" Watch "How to add exactly 2 NON XML caracters at the end of a SOAP body" New topic
Author

How to add exactly 2 NON XML caracters at the end of a SOAP body

foo char
Greenhorn

Joined: Jun 28, 2012
Posts: 3
Hello all I am trying to add two (and only two) extra non xml caracters "AA" at the END of a SOAP body using the JAXWS handlers as so:



The problem is that if you try to add them to the SOAP body (see code below) you get a XML Unmarshalling exception. If I add "AA" as a soap attachment I get MORE than 2 caracters after the SOAP body (which I don't want)
Here is the my SOAPHandler code :


so my question is this: is there any way to add exactly 2 non xml caracters at the end of the soap body using jaxws handlers ? I have spent several weeks on this so it is not an easy question...

Thanks,

Fred.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Hi,

Can you explain the business rationale for doing this?

XML is XML and it should adhere to certain standards.

WP
foo char
Greenhorn

Joined: Jun 28, 2012
Posts: 3
thanks for the reply ! I am developing a webservice that is taking to a complex system which I cannot touch. This system seems to want two extra caracters at the end of each SOAP messages (and exactly two) else it will discard these messages (don't ask who did this). It was particularly hard to see in GUI network monitoring tools (SOAP UI and tcp mon) as the two caracters were /r/n ...

But the thing that is frustrating to me is that I am sure there is a way to do something as simple as this in JAXWS ... I mean it doesn't violate any network protocols or nothing (it would be like adding a small attachment). I did manage to do it using CFX interceptors but the dependencies are just too heavy for me to warrant its use for such a small feature ...

Any ideas on how to proceed/hack is most appreciated ! ( I am going to start looking if using reflection would help but I don't know how stable this would be ...)

Thanks,

Fred.
Palak Mathur
Ranch Hand

Joined: Jan 29, 2007
Posts: 313

foo char wrote:thanks for the reply ! I am developing a webservice that is taking to a complex system which I cannot touch. This system seems to want two extra caracters at the end of each SOAP messages (and exactly two) else it will discard these messages (don't ask who did this). It was particularly hard to see in GUI network monitoring tools (SOAP UI and tcp mon) as the two caracters were /r/n ...

But the thing that is frustrating to me is that I am sure there is a way to do something as simple as this in JAXWS ... I mean it doesn't violate any network protocols or nothing (it would be like adding a small attachment). I did manage to do it using CFX interceptors but the dependencies are just too heavy for me to warrant its use for such a small feature ...

Any ideas on how to proceed/hack is most appreciated ! ( I am going to start looking if using reflection would help but I don't know how stable this would be ...)

Thanks,

Fred.


Why will you want to bypass Soap Schema?


Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to add exactly 2 NON XML caracters at the end of a SOAP body