• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Exception in thread "main" javax.xml.ws.WebServiceException:

Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"/>;

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);

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)


Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

URL url = new URL("http://localhost:8080/es?wsdl";);

I've never done this programmatically, but the service point URL would not have "?wsdl" at end, would it?
Do not set lab on fire. Or this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic