1 Reply Latest reply on Feb 9, 2010 2:22 AM by Ankur Kapila

    XML Content handler only supports a StreamSource content object

    Michael Eibeck Newbie

      I have a JBoss-5.1.0-GA app server with a WebService running under JDK 1.6.0_17.

       

      I generated the WebService client end endpoint from a wsdl using wsconsume.

       

      When I run the WebService I get the following exception:

       

      javax.xml.ws.WebServiceException: java.io.IOException: XML Content handler only supports a StreamSource content object
      at org.jboss.ws.core.jaxws.client.ClientImpl.handleRemoteException(ClientImpl.java:396)
      at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:302)
      at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:170)
      at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
      at $Proxy26.iBriefingExport(Unknown Source)
      at ch.skyguide.aim.interfaces.ws.client.WS_Test.testWSexportIBriefing(WS_Test.java:118)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at junit.framework.TestCase.runTest(TestCase.java:168)
      at junit.framework.TestCase.runBare(TestCase.java:134)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.extensions.TestSetup.run(TestSetup.java:27)
      at junit.textui.TestRunner.doRun(TestRunner.java:116)
      at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:94)
      at junit.textui.TestRunner.doRun(TestRunner.java:109)
      at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:22)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
      Caused by: java.io.IOException: XML Content handler only supports a StreamSource content object
      at org.jboss.ws.core.soap.attachment.XmlDataContentHandler.writeTo(XmlDataContentHandler.java:101)
      at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:869)
      at javax.activation.DataHandler.writeTo(DataHandler.java:302)
      at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
      at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
      at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:361)
      at org.jboss.ws.core.soap.attachment.MultipartRelatedEncoder.writeTo(MultipartRelatedEncoder.java:123)
      at org.jboss.ws.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:343)
      at org.jboss.ws.core.soap.SOAPMessageMarshaller.write(SOAPMessageMarshaller.java:57)
      at org.jboss.ws.core.client.NettyClient.writeRequest(NettyClient.java:297)
      at org.jboss.ws.core.client.NettyClient.invoke(NettyClient.java:191)
      at org.jboss.ws.core.client.HTTPRemotingConnection.invoke(HTTPRemotingConnection.java:154)
      at org.jboss.ws.core.client.SOAPProtocolConnectionHTTP.invoke(SOAPProtocolConnectionHTTP.java:69)
      at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:341)
      at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:290)
      ... 31 more

       

      This exception is already thrown by the client, when it attempts to call a WebService method. Nothing gets through to the server.

      The particular method called uses SOAP attachment in the request and response message.

      The wsdl for the message looks like this:

       

        <operation name="IBriefingExport">
         <soap:operation/>
         <input>
          <mime:multipartRelated>
           <mime:part>
            <soap:body parts="IBriefingExportRequestGeneralPart" use="literal"/>
           </mime:part>
           <mime:part>
            <mime:content part="IBriefingExportRequestFilterPart" type="text/xml"/>
           </mime:part>
          </mime:multipartRelated>
         </input>
         <output>
          <mime:multipartRelated>
           <mime:part>
            <soap:body parts="IBriefingExportResponsePart" use="literal"/>
           </mime:part>
           <mime:part>
            <mime:content part="IBriefingExportResponseData" type="application/octet-stream"/>
           </mime:part>
          </mime:multipartRelated>
         </output>
         <fault name="ExportFault">
          <soap:fault name="ExportFault" use="literal"/>
         </fault>
        </operation>

       

      I believe the cause of the problem are the mime:multipartReleated sections.

      Messages which do not use these sections work fine. wsconsume also generated java classes from this wsdl without problems.

       

      Does anyone know the solution?


        • 1. Re: XML Content handler only supports a StreamSource content object
          Ankur Kapila Newbie

          Hi ,

           

           

            I am also getting the same error cause.

           

            The clients work fine independently, but when put in a web application and deployed on jboss i get this error.

           

            The stack trace for the exception is given below:-

           


          [2010-02-01 00:00:00,104] [INFO ] [QuartzScheduler_Worker-9] [com.abc.hls.jobs.SyncLabItemsJob] Synchronize Lab Items begin.......
          [2010-02-01 00:00:00,104] [INFO ] [QuartzScheduler_Worker-9] [com.abc.hls.jobs.SyncLabItemsJob] BPEL url > http://somehost:8888/orabpel/enhancements/SyncLabItemsBpel/1.0
          [2010-02-01 00:00:00,105] [INFO ] [QuartzScheduler_Worker-9] [com.abc.hls.jobs.SyncLabItemsJob] In create payload for Synchronize Lab Items
          [2010-02-01 00:00:00,106] [INFO ] [QuartzScheduler_Worker-9] [com.abc.hls.jobs.SyncLabItemsJob] Created payload for Synchronize Lab Items
          [2010-02-01 00:00:00,108] [DEBUG] [QuartzScheduler_Worker-9] [httpclient.wire.header] >> "POST /orabpel/enhancements/SyncLabItemsBpel/1.0 HTTP/1.1[\r][\n]"
          [2010-02-01 00:00:00,108] [DEBUG] [QuartzScheduler_Worker-9] [httpclient.wire.header] >> "Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_D07013B125BE2D38C71264953600173; type="text/xml"; start="<0.urn:uuid:D07013B125BE2D38C71264953600174@apache.org>"[\r][\n]"
          [2010-02-01 00:00:00,108] [DEBUG] [QuartzScheduler_Worker-9] [httpclient.wire.header] >> "SOAPAction: "initiate"[\r][\n]"
          [2010-02-01 00:00:00,108] [DEBUG] [QuartzScheduler_Worker-9] [httpclient.wire.header] >> "User-Agent: Axis2[\r][\n]"
          [2010-02-01 00:00:00,108] [DEBUG] [QuartzScheduler_Worker-9] [httpclient.wire.header] >> "Host: somehost:8888[\r][\n]"
          [2010-02-01 00:00:00,108] [DEBUG] [QuartzScheduler_Worker-9] [httpclient.wire.header] >> "Transfer-Encoding: chunked[\r][\n]"
          [2010-02-01 00:00:00,108] [DEBUG] [QuartzScheduler_Worker-9] [httpclient.wire.header] >> "[\r][\n]"
          [2010-02-01 00:00:00,109] [ERROR] [QuartzScheduler_Worker-9] [STDERR] org.apache.axiom.om.OMException: Error while writing to the OutputStream.
          [2010-02-01 00:00:00,109] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axiom.om.impl.MIMEOutputUtils.writeSOAPWithAttachmentsMessage(MIMEOutputUtils.java:297)
          [2010-02-01 00:00:00,109] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.transport.http.SOAPMessageFormatter.writeSwAMessage(SOAPMessageFormatter.java:204)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at com.abc.hls.jobs.SyncLabItemsJob.executeInternal(SyncLabItemsJob.java:54)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR] Caused by: 
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR] java.io.IOException: XML Content handler only supports a StreamSource content object
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.jboss.ws.core.soap.attachment.XmlDataContentHandler.writeTo(XmlDataContentHandler.java:101)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:880)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at javax.activation.DataHandler.writeTo(DataHandler.java:313)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axiom.om.impl.MIMEOutputUtils.writeBodyPart(MIMEOutputUtils.java:245)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      at org.apache.axiom.om.impl.MIMEOutputUtils.writeSOAPWithAttachmentsMessage(MIMEOutputUtils.java:283)
          [2010-02-01 00:00:00,110] [ERROR] [QuartzScheduler_Worker-9] [STDERR]      ... 25 more