[jboss-user] [JBossWS] - Re: Problem with SAAJ Client for Webservice that receives at

RomeuFigueira do-not-reply at jboss.com
Tue Nov 14 14:11:46 EST 2006

Finally managed to fix this.

After spending the last hours dealing with JBossWS source-code, I've managed to do a small change that enabled my message to be correctly interpreted.

If you remmember I wasn't specifining in my mimeheaders, where my rootpart was. The problem was that the class MultipartRelatedDecoder wasn't computing a valid MIME boundary, the one I was getting was messy, making the code skip my text/xml part into the attachment part, thus giving out those errors.

After interpreting both InputStreams, the main difference from any of my standalone clients and the SOAPUi or the Junit test reports was that without a start part, my InputStream started in the first line, while the other started a line below.

So, in order to enable a detection of a valid boundary, I had to do the following change to MultipartRelatedDecoder.java:


  | try
  | {
  | 	boundary = ("\r\n--" + boundaryParameter).getBytes("US-ASCII");
  | }


  | try
  | {
  | 	if(start==null)
  | 		boundary = ("--" + boundaryParameter).getBytes("US-ASCII");
  | 	else
  | 		boundary = ("\r\n--" + boundaryParameter).getBytes("US-ASCII");
  | }

This way, both systems work. IMO the old code is a little bit too hard-coded in this aspect, giving a weird error when the simple difference between files was a linefeed (which I didn't program in my code, it was introduced through the communication layer).

Perhaps this aspect could be improved.

Thanks for making this project opensource, if not it would have been almost impossible to work this out.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985919#3985919

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985919

More information about the jboss-user mailing list