<!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 upgrade web service using WSDL with multiple schema namespaces?
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/kdolan1">Kelly Dolan</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/737474#737474">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi!&#160; I need some help upgrading a web service.&#160; I'm getting a specific error, found work arounds cited on various sites but am still not working because I must be mis-interpreting something.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I inherited code that runs w/in JBoss 4.0.1sp1 and I need to port it to JBoss 7.&#160; My current issue is with a specific web service.&#160; What I have is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>* MyApp.jar that contains a set of classes</p><p>-- com.myapp.ws.MyPort.java (extends Remote)</p><p>-- com.myapp.ws.MyServiceImpl.java (implements SessionBean, MyPort)</p><p>-- com.myapp.ws.types.&lt;various POJOS&gt;.java (represents input and output types)</p><p>-- com.myapp.ws.operations.&lt;various POJOS&gt;.java (represents operations, request and response objects)</p><p>-- com.myapp.ws.faults.&lt;various POJOS&gt;.java (represents exceptions)</p><p>* webservices.xml</p><p>* jaxrpc-mapping.xml</p><p>* MyService.wsdl</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>From what I gather, the above is a J2EE 1.4 web service (based on Axis) implemented as an EJB service endpoint.&#160; I do not know how any of the above was generated (e.g., wstools, manually).&#160; There is nothing in a build files...these files must have been generated once and checked into the source code repository.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The key thing to note is in MyService.wsdl, multiple schemas are defined each assigned to a different namespace.&#160; Then in the jaxrpc-mapping.xml file, each namespace is mapped to a different package.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>{code:xml}&lt;types&gt;</p><p><span>&#160;&#160;&#160; &lt;schema targetNamespace="</span><a class="jive-link-external-small" href="http://mentor.inmedius.com/types" target="_blank">http://mentor.inmedius.com/types</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns="</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></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; elementFormDefault="qualified"&gt;</p><p>&#160;&#160;&#160; ...</p><p>&#160;&#160;&#160; &lt;/schema&gt;</p><p><span>&#160;&#160;&#160; &lt;schema targetNamespace="</span><a class="jive-link-external-small" href="http://mentor.inmedius.com/operations" target="_blank">http://mentor.inmedius.com/operations</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns="</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></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; elementFormDefault="qualified"&gt;</p><p>&#160;&#160;&#160; &lt;/schema&gt;</p><p>&#160;&#160;&#160; ...{code}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> {code:xml}&lt;package-mapping&gt;</p><p>&#160;&#160;&#160; &lt;package-type&gt;com.myapp.ws.types&lt;/package-type&gt;</p><p><span>&#160;&#160;&#160; &lt;namespaceURI&gt;</span><a class="jive-link-external-small" href="http://my.company.com/types" target="_blank">http://my.company.com/types</a><span>&lt;/namespaceURI&gt;</span></p><p>&#160; &lt;/package-mapping&gt;</p><p>&#160; &lt;package-mapping&gt;</p><p>&#160;&#160;&#160; &lt;package-type&gt;com.myapp.ws.operations&lt;/package-type&gt;</p><p><span>&#160;&#160;&#160; &lt;namespaceURI&gt;</span><a class="jive-link-external-small" href="http://my.company.com/operations" target="_blank">http://my.company.com/operations</a><span>&lt;/namespaceURI&gt;</span></p><p>&#160; &lt;/package-mapping&gt;</p><p>&#160; ...{code}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The general error I'm seeing is...</p><p>&#160; </p><p><span>13:58:46,726 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (MSC service thread 1-2) JBossWS_xxx_faults7626102231361680514.xsd[domain:</span><a class="jive-link-external-small" href="http://www.w3.org/TR/xml-schema-1" target="_blank">http://www.w3.org/TR/xml-schema-1</a><span>]::[key=src-resolve.4.2]::Message=src-resolve.4.2: Error resolving component 'types:tMyType'. It was detected that 'types:tMyType' is in namespace '</span><a class="jive-link-external-small" href="http://my.company.com/types" target="_blank">http://my.company.com/types</a><span>', but components from this namespace are not referenceable from schema document 'file:/C:/jboss-as-7.1.1/standalone/tmp/jbossws/JBossWS_xxx_faults7626102231361680514.xsd'. If this is the incorrect namespace, perhaps the prefix of 'types:tMyType' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/C:/jboss-as-7.1.1/standalone/tmp/jbossws/JBossWS_xxx_faults7626102231361680514.xsd'.</span></p><p>&#160; </p><p>I've searched and searched and pretty much found that JBOSSWS (JAX-WS and tools) does not like multiple schemas/namespaces in the same WSDL.&#160; When the individual XSD files get generated the proper imports are not generated.&#160; Two different work arounds have been suggested.</p><p>&#160; </p><p>1. Consolidate everything into one package/namespace.&#160; This would appear to be the easiest.&#160; However, in my case one of the namespaces is mapped to a standard Java package (java.util)...to support using Map as an input/output parameter.</p><p>&#160; </p><p><span>2. Split the WSDLs. (</span><a class="jive-link-external-small" href="http://metro.1045641.n5.nabble.com/Trouble-compiling-WSDL-with-multiple-schema-namespaces-td1066949.html" target="_blank">http://metro.1045641.n5.nabble.com/Trouble-compiling-WSDL-with-multiple-schema-namespaces-td1066949.html</a><span>)</span></p><p>&#160; </p><p>It's option #2 that I'm stuck on and baffled at.&#160; The URL referenced speaks to splitting the WSDL and then running wscompile.&#160; As far as I can tell, I'm not trying to run wscompile because I technically already have my artifacts.&#160; I tried splitting the WSDL by simply breaking it down into separate files (e.g., top-level WSDL imports other WSDL snippets).&#160; This did not work and I can generally see why...it results in one WSDL file parsed.&#160; </p><p>&#160; </p><p>What I can't wrap my head around is...I have one service endpoint interface, URL, etc. to access my web service.&#160; This is defined in webservices.xml which points to one WSDL file and one jaxrpc-mapping.xml.&#160; The one WSDL file defines the service URL.&#160; If I should be able to split the WSDLs, what exactly does this mean?&#160; How does it impact those other files?&#160; And while there are multiple namespaces/schemas/packages, there are dependencies across them.&#160; For example, the operations package is dependent on the types package.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> Very confused....any and all help is greatly appreciated.</p><p>Kelly</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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/737474#737474">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>