Hello,

I am trying to create a WS Client using CXF JAX-WS and spring. The WSDL for
the WS is located in a jar file accessible from tomcat at
jar:file:WEB-INF/lib/csmSchema-2.0.jar!/csm.wsdl. (How I know this, because
I executed CSMService.getClass().getResource("csmWsdl")).

I declare my client as

    <!-- CSM Web Service Client -->
    <jaxws:client id="csmService"
                  serviceClass="com.areva.csm.schema.ICsmService"
                 
address="http://localhost:8080/csmMockup/UpdateImportExportRequestTargetStatus";
                  username="mmi"
                  password="mmi"
                 
wsdlLocation="jar:file:WEB-INF/lib/csmSchema-2.0.jar!/csm.wsdl">
        <jaxws:properties>
            <entry key="schema-validation-enabled" value="true"/>
        </jaxws:properties>

        <jaxws:binding>
            <soap:soapBinding mtomEnabled="false" version="1.2"/>
        </jaxws:binding>
    </jaxws:client>

However, at startup I get

Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Could not find definition for service
{http://areva.com/2008/11/19/001/Csm}ICsmServiceService.
        at
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:114)


I did some debugging on the CXF code and I found that on the WSDLManagerImpl
class, the WSDL is indeed read correctly and loaded as a Definition
instance. Unfortunately I do not have the source code for DefinitionImpl (I
think it is a sun-created class), but I can see that one of its fields
(services) is a HashMap, where the service
{http://areva.com/2008/11/19/001/Csm}ICsmServiceService is mapped correctly
to the ServiceImpl. But on the WSDLServiceFactory class, 

            javax.wsdl.Service wsdlService =
definition.getService(serviceName);
            if (wsdlService == null) {
                throw new ServiceConstructionException(new
Message("NO_SUCH_SERVICE_EXC", LOG, serviceName));
            }

Getting the service fails. Is this a bug?

BTW: I extracted the wsdl and put it in WEB-INF/csm.wsdl and the bean
creation succeeds.

Thanks,

Juan

PS: Using JDK 1.5.0_15, CXF 2.1.3
-- 
View this message in context: 
http://www.nabble.com/Error-when-using-url-of-format-%22jar%3Afile%3A%22-as-wsdlLocation-tp21439311p21439311.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to