title: Is not a valid service exception in JAX-WS
body: <p>I am taking reference from <a href="http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example/" rel="nofollow">http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example/</a></p>
  
  <p>This is my  <strong>HelloWorldClient</strong> class </p>
  
  <pre><code>package WebService;
  
  
  import java.net.URL;
  import javax.xml.namespace.QName;
  import javax.xml.ws.Service;
  
  
  
  public class HelloWorldClient{
  
      public static void main(String[] args) throws Exception {
  
      URL url = new URL("http://localhost:8099/dummy1/dummy2?wsdl");
  
          //1st argument service URI, refer to wsdl document above
      //2nd argument is service name, refer to wsdl document above
          QName qname = new QName("http://localhost:8099/dummy1/dummy2?wsdl", "HelloWorldImplService");
  
  
          Service service = Service.create(url, qname);
  
          HelloWorld hello = service.getPort(HelloWorld.class);
  
          System.out.println(hello.getHelloWorldAsString("mkyong"));
  
      }
  
  }
  </code></pre>
  
  <p>When running this class i am getting error from  below line of code</p>
  
  <pre><code>Service service = Service.create(url, qname);
  </code></pre>
  
  <p>The error is </p>
  
  <pre><code>Exception in thread "main" javax.xml.ws.WebServiceException: {http://localhost:8099/dummy1/dummy2?wsdl}HelloWorldImplService is not a valid service. Valid services are: {http://WebService/}HelloWorldImplService
      at com.sun.xml.internal.ws.client.WSServiceDelegate.&lt;init&gt;(WSServiceDelegate.java:220)
      at com.sun.xml.internal.ws.client.WSServiceDelegate.&lt;init&gt;(WSServiceDelegate.java:165)
      at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93)
      at javax.xml.ws.Service.&lt;init&gt;(Service.java:56)
      at javax.xml.ws.Service.create(Service.java:680)
      at WebService.HelloWorldClient.main(HelloWorldClient.java:19)
  </code></pre>
  
  <p>In the reference example in HelloWorldClient class it has </p>
  
  <pre><code>    QName qname = new QName("http://ws.mkyong.com/", "HelloWorldImplService");
  </code></pre>
  
  <p>In my case i have replaced it with </p>
  
  <pre><code>    QName qname = new QName("http://localhost:8099/dummy1/dummy2?wsdl", "HelloWorldImplService");
  </code></pre>
  
  <p>I could not figure out where i have made mistake .When i run 
  <code>http://localhost:8099/dummy1/dummy2?wsdl</code> it is working fine.But ,when i access from client i am getting above mentioned exception.Any help please ?</p>