<!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="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss 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;">
How do I register additional JAXB types during WS deploy?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/kimba74">Steffen Krause</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/736355#736355">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I have the following problem:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Assuming I created a JSE Web Service using the JSR-181 annotations, I created the necessary JAXB classes, and deployed the WAR file to JBossAS 5.1 with the result that the following WSDL is being generated:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><span><definitions name='AnyTestService'
                  targetNamespace='urn:any:test:service:1.0'
                  xmlns='</span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/" target="_blank">http://schemas.xmlsoap.org/wsdl/</a><span>'
                  xmlns:ns1='urn:any:test:binding:one:1.0'
                  xmlns:soap='</span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/soap/" target="_blank">http://schemas.xmlsoap.org/wsdl/soap/</a><span>'
                  xmlns:tns='urn:any:test:service:1.0'
                  xmlns:xsd='</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a><span>'></span></span>
<span class="jive-xml-tag"><types></span>
  <span class="jive-xml-tag"><span><xs:schema elementFormDefault='qualified' targetNamespace='urn:any:test:binding:one:1.0' version='1.0' xmlns:xs='</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a><span>'></span></span>
   <span class="jive-xml-tag"><xs:element name='AnyTestRequest'></span>
    <span class="jive-xml-tag"><xs:complexType></span>
     <span class="jive-xml-tag"><xs:sequence></span>
      <span class="jive-xml-tag"><xs:element name='Name' type='xs:string'/></span>
      <span class="jive-xml-tag"><xs:any namespace='##other' processContents='lax'/></span>
     <span class="jive-xml-tag"></xs:sequence></span>
    <span class="jive-xml-tag"></xs:complexType></span>
   <span class="jive-xml-tag"></xs:element></span>
   <span class="jive-xml-tag"><xs:element name='AnyTestResponse'></span>
    <span class="jive-xml-tag"><xs:complexType></span>
     <span class="jive-xml-tag"><xs:sequence></span>
      <span class="jive-xml-tag"><xs:element name='Code' type='xs:int'/></span>
      <span class="jive-xml-tag"><xs:element name='Status' type='xs:string'/></span>
     <span class="jive-xml-tag"></xs:sequence></span>
    <span class="jive-xml-tag"></xs:complexType></span>
   <span class="jive-xml-tag"></xs:element></span>
  <span class="jive-xml-tag"></xs:schema></span>
<span class="jive-xml-tag"></types></span>
<span class="jive-xml-tag"><message name='AnyTestSEI_Test'></span>
  <span class="jive-xml-tag"><part element='ns1:AnyTestRequest' name='req'></span><span class="jive-xml-tag"></part></span>
<span class="jive-xml-tag"></message></span>
<span class="jive-xml-tag"><message name='AnyTestSEI_TestResponse'></span>
  <span class="jive-xml-tag"><part element='ns1:AnyTestResponse' name='res'></span><span class="jive-xml-tag"></part></span>
<span class="jive-xml-tag"></message></span>
<span class="jive-xml-tag"><portType name='AnyTestSEI'></span>
  <span class="jive-xml-tag"><operation name='Test' parameterOrder='req'></span>
   <span class="jive-xml-tag"><input message='tns:AnyTestSEI_Test'></span><span class="jive-xml-tag"></input></span>
   <span class="jive-xml-tag"><output message='tns:AnyTestSEI_TestResponse'></span><span class="jive-xml-tag"></output></span>
  <span class="jive-xml-tag"></operation></span>
<span class="jive-xml-tag"></portType></span>
<span class="jive-xml-tag"><binding name='AnyTestSEIBinding' type='tns:AnyTestSEI'></span>
  <span class="jive-xml-tag"><span><soap:binding style='document' transport='</span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/soap/http'/" target="_blank">http://schemas.xmlsoap.org/soap/http'/</a><span>></span></span>
  <span class="jive-xml-tag"><operation name='Test'></span>
   <span class="jive-xml-tag"><soap:operation soapAction=''/></span>
   <span class="jive-xml-tag"><input></span>
    <span class="jive-xml-tag"><soap:body use='literal'/></span>
   <span class="jive-xml-tag"></input></span>
   <span class="jive-xml-tag"><output></span>
    <span class="jive-xml-tag"><soap:body use='literal'/></span>
   <span class="jive-xml-tag"></output></span>
  <span class="jive-xml-tag"></operation></span>
<span class="jive-xml-tag"></binding></span>
<span class="jive-xml-tag"><service name='AnyTestService'></span>
  <span class="jive-xml-tag"><port binding='tns:AnyTestSEIBinding' name='AnyTestPort'></span>
   <span class="jive-xml-tag"><span><soap:address location='</span><a class="jive-link-external-small" href="http://127.0.0.1:8080/sandbox/service/anytest'/" target="_blank">http://127.0.0.1:8080/sandbox/service/anytest'/</a><span>></span></span>
  <span class="jive-xml-tag"></port></span>
<span class="jive-xml-tag"></service></span>
<span class="jive-xml-tag"></definitions></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Now I connect to the Web Service with for example soapUI and call it using the following SOAP message</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><span><soapenv:Envelope xmlns:soapenv="</span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank">http://schemas.xmlsoap.org/soap/envelope/</a><span>"
                              xmlns:urn="urn:any:test:binding:one:1.0"
                              xmlns:lsb="urn:any:test:binding:two:1.0"></span></span>
   <span class="jive-xml-tag"><soapenv:Header/></span>
   <span class="jive-xml-tag"><soapenv:Body></span>
      <span class="jive-xml-tag"><urn:AnyTestRequest></span>
         <span class="jive-xml-tag"><urn:Name></span>Test<span class="jive-xml-tag"></urn:Name></span>
         <span class="jive-xml-tag"><lsb:root></span>
                     <span class="jive-xml-tag"><lsb:Status></span>Everything is OK<span class="jive-xml-tag"></lsb:Status></span>
         <span class="jive-xml-tag"></lsb:root></span>
      <span class="jive-xml-tag"></urn:AnyTestRequest></span>
   <span class="jive-xml-tag"></soapenv:Body></span>
<span class="jive-xml-tag"></soapenv:Envelope></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>When I handle the Web Service call in the implementation...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java"><font color="navy"><b>package</b></font> com.test.service.any;
 
<font color="navy"><b>import</b></font> com.test.binding.one.AnyTestRequest;
<font color="navy"><b>import</b></font> com.test.binding.one.AnyTestResponse;
 
<font color="navy"><b>import</b></font> javax.jws.WebService;
 
@WebService(portName = <font color="red">"AnyTestPort"</font>,
      serviceName = <font color="red">"AnyTestService"</font>,
      targetNamespace = <font color="red">"urn:any:test:service:1.0"</font>,
      endpointInterface = <font color="red">"com.test.service.any.AnyTestSEI"</font>)
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> AnyTestWS <font color="navy"><b>implements</b></font> AnyTestSEI <font color="navy">{</font>
 
   <font color="navy"><b>public</b></font> AnyTestResponse test(AnyTestRequest request) <font color="navy">{</font>
      System.out.println(request);
      <font color="navy"><b>if</b></font> (request.getAny() != <font color="navy"><b>null</b></font>)
         System.out.println(<font color="red">"--> ANY="</font> + request.getAny().getClass());
      <font color="navy"><b>return</b></font> <font color="navy"><b>new</b></font> AnyTestResponse(200, <font color="red">"Received"</font>);
   <font color="navy">}</font>
  
<font color="navy">}</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>...the Class of the the "ANY" object is as expected <span style="font-family: 'courier new', courier;">org.apache.xerces.dom.ElementNSImpl</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Now I create a JAXB class <span style="font-family: 'courier new', courier;">com.test.binding.two.Root</span> to handle the namespace <span style="background-color: #ffffff; font-family: 'courier new', courier;">urn:any:test:binding:two:1.0</span> (<em>the one that was submitted as ANY object</em>) package it as JAR file and bundle it in the WEB-INF/lib of the WAR file. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>How do I get JBossAS 5.1 to register this unreferenced JAXB type with the other JAXB types that will be handed to the JAXBContext before unmarshalling it?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Kimba</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/736355#736355">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="https://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>