[jboss-user] [JBoss Web Services] - How do I upgrade web service using WSDL with multiple schema namespaces?

Kelly Dolan do-not-reply at jboss.com
Wed May 23 14:48:34 EDT 2012


Kelly Dolan [https://community.jboss.org/people/kdolan1] created the discussion

"How do I upgrade web service using WSDL with multiple schema namespaces?"

To view the discussion, visit: https://community.jboss.org/message/737474#737474

--------------------------------------------------------------
Hi!  I need some help upgrading a web service.  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.

I inherited code that runs w/in JBoss 4.0.1sp1 and I need to port it to JBoss 7.  My current issue is with a specific web service.  What I have is:

* MyApp.jar that contains a set of classes
-- com.myapp.ws.MyPort.java (extends Remote)
-- com.myapp.ws.MyServiceImpl.java (implements SessionBean, MyPort)
-- com.myapp.ws.types.<various POJOS>.java (represents input and output types)
-- com.myapp.ws.operations.<various POJOS>.java (represents operations, request and response objects)
-- com.myapp.ws.faults.<various POJOS>.java (represents exceptions)
* webservices.xml
* jaxrpc-mapping.xml
* MyService.wsdl

>From what I gather, the above is a J2EE 1.4 web service (based on Axis) implemented as an EJB service endpoint.  I do not know how any of the above was generated (e.g., wstools, manually).  There is nothing in a build files...these files must have been generated once and checked into the source code repository.

The key thing to note is in MyService.wsdl, multiple schemas are defined each assigned to a different namespace.  Then in the jaxrpc-mapping.xml file, each namespace is mapped to a different package.

{code:xml}<types>
    <schema targetNamespace=" http://mentor.inmedius.com/types http://mentor.inmedius.com/types"
            xmlns=" http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified">
    ...
    </schema>
    <schema targetNamespace=" http://mentor.inmedius.com/operations http://mentor.inmedius.com/operations"
            xmlns=" http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified">
    </schema>
    ...{code}

 {code:xml}<package-mapping>
    <package-type>com.myapp.ws.types</package-type>
    <namespaceURI> http://my.company.com/types http://my.company.com/types</namespaceURI>
  </package-mapping>
  <package-mapping>
    <package-type>com.myapp.ws.operations</package-type>
    <namespaceURI> http://my.company.com/operations http://my.company.com/operations</namespaceURI>
  </package-mapping>
  ...{code}

The general error I'm seeing is...

13:58:46,726 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (MSC service thread 1-2) JBossWS_xxx_faults7626102231361680514.xsd[domain: http://www.w3.org/TR/xml-schema-1 http://www.w3.org/TR/xml-schema-1]::[key=src-resolve.4.2]::Message=src-resolve.4.2: Error resolving component 'types:tMyType'. It was detected that 'types:tMyType' is in namespace ' http://my.company.com/types http://my.company.com/types', 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'.

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.  When the individual XSD files get generated the proper imports are not generated.  Two different work arounds have been suggested.

1. Consolidate everything into one package/namespace.  This would appear to be the easiest.  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.

2. Split the WSDLs. ( http://metro.1045641.n5.nabble.com/Trouble-compiling-WSDL-with-multiple-schema-namespaces-td1066949.html http://metro.1045641.n5.nabble.com/Trouble-compiling-WSDL-with-multiple-schema-namespaces-td1066949.html)

It's option #2 that I'm stuck on and baffled at.  The URL referenced speaks to splitting the WSDL and then running wscompile.  As far as I can tell, I'm not trying to run wscompile because I technically already have my artifacts.  I tried splitting the WSDL by simply breaking it down into separate files (e.g., top-level WSDL imports other WSDL snippets).  This did not work and I can generally see why...it results in one WSDL file parsed.  

What I can't wrap my head around is...I have one service endpoint interface, URL, etc. to access my web service.  This is defined in webservices.xml which points to one WSDL file and one jaxrpc-mapping.xml.  The one WSDL file defines the service URL.  If I should be able to split the WSDLs, what exactly does this mean?  How does it impact those other files?  And while there are multiple namespaces/schemas/packages, there are dependencies across them.  For example, the operations package is dependent on the types package.

 Very confused....any and all help is greatly appreciated.
Kelly
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/737474#737474]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120523/d8a7d60f/attachment.html 


More information about the jboss-user mailing list