Hi guys,
I create a simple web service and I publish the wsdl :
<!-- Published by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.4-b01. --><!-- Generated by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.4-b01. -->
<definitions targetNamespace="http://bean.endpoint.service/" name="WebServiceTestBeanService">
<import namespace="http://exaple.endpoint.service/" location="http://localhost:8080/es?wsdl=1"/>
<binding name="WebServiceTestBeanPortBinding" type="ns1:WebServiceTestInterface">
<
soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="EchoMessage">
<soap:operation soapAction=""/>
<input><soap:body use="literal" namespace="http://exaple.endpoint.service/"/></input>
<output><soap:body use="literal" namespace="http://exaple.endpoint.service/"/></output>
</operation></binding><service name="WebServiceTestBeanService">
<port name="WebServiceTestBeanPort" binding="tns:WebServiceTestBeanPortBinding">
<soap:address location="http://localhost:8080/es"/>
</port>
</service>
</definitions>
But when I lunch my class with this code :
URL url = new URL("http://localhost:8080/es?wsdl");
// Qualified name of the service:
// 1st argis the service URI
// 2nd is the service name published in the WSDL
QName qname = new QName("http://bean.endpoint.service/WebServiceTestBeanService");
Service service = Service.create(url,qname);
// Extract the endpoint interface, the service "port".
WebServiceTestBean eif = service.getPort(WebServiceTestBean.class);
//System.out.println(eif.EchoMessage(strMsg));
//}
I have this error :
Exception in
thread "main" javax.xml.ws.WebServiceException:
http://bean.endpoint.service/WebServiceTestBeanService is not a valid service. Valid services are: {http://bean.endpoint.service/}WebServiceTestBeanService
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(Unknown Source)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(Unknown Source)
at javax.xml.ws.Service.<init>(Unknown Source)
at javax.xml.ws.Service.create(Unknown Source)
at TestClinet.main(TestClinet.java:24)
Thanks
Dora