File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Boundary of Multi part message is getting changed whenever message is written on output stream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Boundary of Multi part message is getting changed whenever message is written on output stream" Watch "Boundary of Multi part message is getting changed whenever message is written on output stream" New topic
Author

Boundary of Multi part message is getting changed whenever message is written on output stream

ketan mulay
Greenhorn

Joined: Nov 03, 2009
Posts: 3
Hi,

I have written below code in my implementation....

the putHeaders() method body is....


once header is written to the response, reply.writeTo(os); writes the message to the output stream of the response.

Whenever we invoke the reply.writeTo(os) method the boundary gets changed (shown in below logs).
Method putHeader() accepts the header of the message printed earlier and sets it to the response. But later again reply.writeTo(os) method is invoked so boundary is changed again.

Whenever the response message is parsed, it searches for the boundary mentioned in header but parser doesn't find it in the message. So it is throwing Exception -

javax.xml.soap.SOAPException: Error processing MIME message:
at weblogic.webservice.core.soap.SOAPMessageImpl.handleMimeMessage(SOAPMessageImpl.java:268)
at weblogic.webservice.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.java:140)
at weblogic.webservice.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:30)
at weblogic.webservice.binding.http11.Http11ClientBinding.receive(Http11ClientBinding.java:289)
at weblogic.webservice.core.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:60)
at awsots.backend.soap.SOAPClient.sendMessage(SOAPClient.java:125)
at awsots.backend.soap.SOAPClient.getAttachments(SOAPClient.java:164)
at awsots.backend.soap.SOAPClient.sendMessage(SOAPClient.java:202)
at awsots.backend.soap.AwsotsSOAPClient.sendMessage(AwsotsSOAPClient.java:41)
at cafe.business.action.FdbkCnFormAction.execute(FdbkCnFormAction.java:277)
at cafe.AdminServlet.cafeDoPost(AdminServlet.java:769)
at cafe.SecureServlet.doPost(SecureServlet.java:41)
at cafe.AdminServlet.cafeDoGet(AdminServlet.java:100)
at cafe.SecureServlet.doGet(SecureServlet.java:28)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.mail.MessagingException: Missing start boundary
at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:713)
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:383)
at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:229)
at weblogic.webservice.core.soap.SOAPMessageImpl.handleMimeMessage(SOAPMessageImpl.java:238)


Below is the log for above code....

Before putHeaders-------------------

------=_Part_4_17340316.1286879531001
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: __WLS__1286879530995__SOAP__

<env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body></env:Body></env:Envelope>
------=_Part_4_17340316.1286879531001
Content-Type: text/xml
Content-Transfer-Encoding: 8bit
Content-ID: SO_STATUS

<?xml version="1.0" encoding="UTF-8" standalone="no"?><SO_STATUS_RES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespacesSchemaLocation=""><STATUS/></SO_STATUS_RES>
------=_Part_4_17340316.1286879531001--
Calling putHeaders-------------------
DEBUG|4 [10/12/2010 05:32:11:004]| In Set Headers:

DEBUG|4 [10/12/2010 05:32:11:005]| Header Name: Content-Type Value: multipart/related;type="text/xml";boundary="----=_Part_4_17340316.1286879531001";start=__WLS__1286879530995__SOAP__

DEBUG|4 [10/12/2010 05:32:11:009]| Reply:: SOAPMessageImpl[SOAPPartImpl[SOAPEnvelopeImpl[nullSOAPBody[]]]]class weblogic.webservice.core.soap.SOAPMessageImpl

<!-------------------- RESPONSE TO CLIENT --------------->
URL : http://90.168.8.36:7085/awsots/SOInquiryServlet
Response Code :200
Headers :
DEBUG|4 [10/12/2010 05:32:11:010]| SOInquiryServlet --- doGet --- Ends

Date=Tue, 12 Oct 2010 10:32:10 GMT
Transfer-Encoding=chunked
Content-Type=multipart/related;type="text/xml";boundary="----=_Part_4_17340316.1286879531001";start=__WLS__1286879530995__SOAP__
X-Powered-By=Servlet/2.5 JSP/2.1
Envelope :

------=_Part_5_18460782.1286879531006
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: __WLS__1286879530995__SOAP__

<env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body></env:Body></env:Envelope>
------=_Part_5_18460782.1286879531006
Content-Type: text/xml
Content-Transfer-Encoding: 8bit
Content-ID: SO_STATUS

<?xml version="1.0" encoding="UTF-8" standalone="no"?><SO_STATUS_RES xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespacesSchemaLocation=""><STATUS/></SO_STATUS_RES>
------=_Part_5_18460782.1286879531006--

<!-------------------- END RESPONSE TO CLIENT ----------->

Then after it is throwing exception once this response is getting parsed.

I have checked everything but can't find where the boundary is getting updated.
I am using weblogic 10.3.

Please help me to solve this issue.

Thanks,
Ketan
ketan mulay
Greenhorn

Joined: Nov 03, 2009
Posts: 3
Above code is working in Weblogic 8.1.
Here in Weblogic 8.1 no new boundary is created by writeTo() method.

But in Weblogic 10.3 the boundary gets changed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Boundary of Multi part message is getting changed whenever message is written on output stream
 
Similar Threads
Extrange codes in the response from axis
Axis rejects int parameter
Parsing SOAP Information
Parsing POST Information
Microsoft UDDI