Issue trying to specify wsdlLocation inside @WebService

Solution Verified - Updated -

Issue

We are trying to set up a Web Service inside a war. The request and response objects used have been created from XSD's. What we are trying to do is specify the WSDL for the Web Service to use so that it can parse our existing calls.

    @WebService( name="ExampleService",      targetNamespace="http://www.jboss.com/example/ws",      wsdlLocation="generated.wsdl")

When this is started we get the following on startup:

0:33:22,412 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/opt/jboss/JBoss_SOA/jboss-soa-p.5.0.0/jboss-as/server/production/deploy/esb.esb/ state=PreReal mode=Manual requiredState=Real  
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/opt/jboss/JBoss_SOA/jboss-soa-p.5.0.0/jboss-as/server/production/deploy/esb.esb/web-services.war/  
org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)  
....  
Caused by: org.jboss.ws.WSException: Cannot build meta data: Could not find generated.wsdl in the additional metadatafiles!  
at org.jboss.ws.WSException.rethrow(WSException.java:60)  
at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:208)  
....  
Caused by: java.io.IOException: Could not find generated.wsdl in the additional metadatafiles!  
at org.jboss.wsf.framework.deployment.ArchiveDeploymentImpl.getMetaDataFileURL(ArchiveDeploymentImpl.java:143)  
at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.processWebService(JAXWSWebServiceMetaDataBuilder.java:360)  
at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:104)

The file "generated.wsdl" is in fact in the  /WEB-INF/wsdl  folder. If it isn't I get this error:

10:33:03,695 ERROR [MainDeployer] Could not start deployment: [file:/opt/jboss/JBoss_SOA/jboss-soa-p.5.0.0/server/all/deploy/MyApp.war](file:/opt/jboss/JBoss_SOA/jboss-soa-p.5.0.0/server/all/deploy/MyApp.war)  
org.jboss.ws.WSException: Invalid wsdlFile 'META-INF/wsdl/MyService.wsdl', expected in: WEB-INF/wsdl/  
at org.jboss.ws.server.WSDLFilePublisher.getPublishLocation(WSDLFilePublisher.java:323)

Environment

Jboss Service Oriented Architecture Platform (SOA-P) 5.0.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content