• Post Reply Bookmark Topic Watch Topic
  • New Topic

Metro JAX-WS @schemaValidation How to specify schemas instead of annotaion generated

 
Jeff Gaer
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I 've been using the @schemavalidation tag successfully with Metro 2.0 with simpler schemas, but a recent update to our schemas has cause the attached error to occur IFF schemavalidation is on. The service functions correctly if it is not. I have been able to validate messages against the schemas used to generate the services using tools like Oxygen. The error occurs at server startup not in response to a particular in or out bound message. Looking at the error messages it looks like the metro framework builds the schemas from the annotations in the generate code and is failing at doing that. I make that assumption since the schema names in the errors do not match the schemas used to generate the code. I had hoped that the wsdlLocation attribute on the @webservice annotation or the sun-jax-ws definitions would solve that issue ( wsdl and all schemas are deployed to WEB-INF/wsdl directory). I understand the cause to be an abstract base class but don't want to constrain the interface developers from using valid schema constructs. In a nutshell is there any way to force the metro framework to take the top down approach and validate against the schemas used to generate the code instead of a bottom up approach of reading the annotations and regenerating the schemas from the generated code?

Dec 3, 2010 8:16:50 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
SEVERE: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: org.xml.sax.SAXParseException: src-resolve.4.2: Error resolving component 'ns1:MessageType'. It was detected that 'ns1:MessageType' is in namespace 'http://schemas.ticomgeo.com/2010/geonet/common/ServiceMessageTypes/v0', but components from this namespace are not referenceable from schema document 'file:/AudioStreamServicesPortImplService_schema1.xsd'. If this is the incorrect namespace, perhaps the prefix of 'ns1:MessageType' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/AudioStreamServicesPortImplService_schema1.xsd'.
javax.xml.ws.WebServiceException: org.xml.sax.SAXParseException: src-resolve.4.2: Error resolving component 'ns1:MessageType'. It was detected that 'ns1:MessageType' is in namespace 'http://schemas.ticomgeo.com/2010/geonet/common/ServiceMessageTypes/v0', but components from this namespace are not referenceable from schema document 'file:/AudioStreamServicesPortImplService_schema1.xsd'. If this is the incorrect namespace, perhaps the prefix of 'ns1:MessageType' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/AudioStreamServicesPortImplService_schema1.xsd'.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!