Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
catch it before it slithers away! Oh wait, it's a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic