• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"/>
</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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic