I just tested this again because I remember at the time i used
"classpath:..." in the wsdlLocation i saw error messages in the log file
when booting up tomee.  I have confirmed this just now but I have been
ignoring this error message because it doesn't seem to stop my application
from working properly. 

For my webservice annotated as follows...

@Stateless
@Local(AcceptPaymentForAncillariesPortType.class)
@WebService(
                portName="AcceptPaymentForAncillariesPortType",
                serviceName="AcceptPaymentForAncillariesService",
                targetNamespace =
"urn:www.virginaustralia.com:service:contract:departure-management",
        
endpointInterface="com.virginaustralia.service.contract.departure_management.AcceptPaymentForAncillariesPortType",
                
wsdlLocation="classpath:/META-INF/wsdl/AcceptPaymentForAncillaries.wsdl"
                )
public class AcceptPaymentForAncillariesImpl implements
AcceptPaymentForAncillariesPortType {
...
}

When booting tomee, i get this error in the console...

Dec 01, 2014 9:57:45 AM org.apache.openejb.config.WsDeployer getWsdl
SEVERE: Unable to read wsdl file
classpath:/META-INF/wsdl/AcceptPaymentForAncillaries.wsdl

Even though that message is "SEVERE", it doesn't affect my application in
any way.

I just changed my wsdlLocation as follows...

@Stateless
@Local(AcceptPaymentForAncillariesPortType.class)
@WebService(
                portName="AcceptPaymentForAncillariesPortType",
                serviceName="AcceptPaymentForAncillariesService",
                targetNamespace =
"urn:www.virginaustralia.com:service:contract:departure-management",
        
endpointInterface="com.virginaustralia.service.contract.departure_management.AcceptPaymentForAncillariesPortType",
                wsdlLocation="META-INF/wsdl/AcceptPaymentForAncillaries.wsdl"
                )
public class AcceptPaymentForAncillariesImpl implements
AcceptPaymentForAncillariesPortType {
...
}

Note the wsdlLocation path is relative.  When i booted my application the
error message no longer appears and the web service also works.

If i change wsdlLocation to use an absolute path
(wsdlLocation="/META-INF/wsdl/AcceptPaymentForAncillaries.wsdl"),  the I get
the error message...

SEVERE: Unable to read wsdl file
/META-INF/wsdl/AcceptPaymentForAncillaries.wsdl

and my web service no longer works.  In this case cxf also throws an
exception...

SEVERE: Error deploying JAX-WS Web Service for EJB
AcceptPaymentForAncillariesImpl 
org.apache.cxf.service.factory.ServiceConstructionException: Service class
com.virginaustralia.service.contract.departure_management.AcceptPaymentForAncillariesPortType
method AcceptPaymentForAncillaries part
{urn:www.virginaustralia.com:service:contract:departure-management}request
cannot be mapped to schema. Check for use of a JAX-WS-specific type without
the JAX-WS service factory bean.


So to summarize, 

I can use wsdlLocation="classpath:<absolute_path_to_wsdl>" and my
application works but i get a "SEVERE: Unable to read wsdl file" error
message in the log file which i can seem to safely ignore.

I can use wsdlLocation="<relative_path_to_wsdl>" and it works and I get no
"SEVERE: Unable to read wsdl file" error message.

I cannot use wsdlLocation="<absolute_path_to_wsdl>".  I get the "SEVERE"
Unable to read wsdl file" error message and also CXF throws an error when
trying to construct the service.







--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/JAX-WS-Reading-WSDL-file-from-JAR-file-tp4670256p4673082.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to