<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
XML Content handler only supports a StreamSource content object
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/elm3d">Eugene McKissick</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/542127#542127">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>All,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I recently converted an existing web service from CXF to JBossWS Native.  The service is up and running, however whenever I try to call the web service I get the following error:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>[RequestHandlerImpl] Error processing web service request</p><p>org.jboss.ws.WSException: java.io.IOException: XML Content handler only supports a StreamSource content object</p><p>....</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Caused by: java.io.IOException: XML Content handler only supports a StreamSource content object</p><p>at org.jboss.ws.core.soap.attachment.XmlDataContentHandler.writeTo(XmlDataContentHandler.java:101)</p><p>at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:883)</p><p>at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1350)</p><p>at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:845)</p><p>at javax.mail.internet.MimeMultipart.wrtieTo(MimeMultipart.java:361)</p><p>at org.jboss.ws.core.soap.attachment.MultipartRelatedEncoder.writeTo(MultipartRelatedEncoder.java:123)</p><p>at org.jboss.ws.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:343)</p><p>at org.jboss.wsf.stack.jbws.RequestHandlerImpl.sendResponse(RequestHandlerImpl.java:401)</p><p>...24 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>We are currently using JBoss 5.1 with JDK 6. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The method in the web service impl. that triggers this error is</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>public void getXmlDocs(DocParams params, Holder<ReturnType> outDocument, Holder<String> xmlAttach)</p><p>{</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>     List<String> docIDs = params.getDocID().getItem();</p><p>      for (String s: docIDs) {</p><p>          System.out.println(s);</p><p>      }</p><p>     ReturnType retType = new ReturnType();</p><p>     retType = this.populateReturnType();</p><p>     outDocument.value = retType;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>     xmlAttach.value = <Read xml from text file>;</p><p>     System.out.println(xmlAttach.value); //Prints out contents of file as string correctly</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Everything seems fine in the method, but when JBoss tries to create the response the error occurs.  Turning on debug I see the ReturnType object being serialized by the JAXBSerializer.  The [ObjectContent] xmlFragment statement contains xml for the ReturnType wrapped in the getDocResponse header.  Before END handleRequest is logged.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Associated WSDL chunk</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><!-- *************************** Type Definitions *******************************  --></p><p><types></p><p>     <complexType name="ReturnType"></p><p>          <sequence></p><p>               <element name="returnInfo" type="xsd:String"></p><p>               <element name="returnStatus" type="xsd:String"></p><p>          </sequence></p><p>     </complexType></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>     <complexType name="getDocResponse" type="tns:ReturnType" /></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><!--***************************Message Definitions******************************** --></p><p><message name="getDocResponse"></p><p>     <part name="outDocument" element="tns:getDocResponse"/></p><p>     part name="xmlAttach" type="xsd:string"/></p><p></message></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><!--***************************Binding Definitions******************************** --</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> <output name="getDocResponse"></p><p>     <mime:multipartRelated></p><p>          <mime:part></p><p>                    <soap:body parts="outDocument" use="literal" /></p><p>          </mime:part></p><p>          <mime:part></p><p>               <mime:content part="xmlAttach" type="text/xml"/></p><p>          </mime:part></p><p>     </mime:multipartRelated></p><p></output></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I apologize for the limited information...the errors and code reside on the server, so I had to retype the code (hence the pseudocode).  Any help or suggestions would be greatly appreciated. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Regards,</p><p>Eugene</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/542127#542127">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>