title: How to Create SOAP WS Client (with authentication) from WSDL in Netbeans
body: <p>I have to create a Web Service Client to consume a web service in netbeans. I have WSDL of that web service. I need to do a preemptive authentication in the  Client. Here is my code for that Client. </p>
  
  <pre><code>public static void main(String[] args) {
      // TODO code application logic here
              try
      {
      FidelioDto fd=G_jar.getInfoFidelioByND("212642098640");
      System.out.println(fd.getQualite()+" Get Qualite");
      System.out.println(fd.getCodeFidelio()+"Code Fielio");
      System.out.println(fd.getDateMaj()+" Get Date");
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
  }
  
  private static FidelioDto getInfoFidelioByND(java.lang.String nd) throws AppBusinessException_Exception {
      ma.iam.wsgold.ws.impl.FidelioWebServiceImplService service = new ma.iam.wsgold.ws.impl.FidelioWebServiceImplService();
      ma.iam.wsgold.ws.impl.FidelioWebServiceImpl port = service.getFidelioWebServiceImplPort();
      BindingProvider prov = ((BindingProvider)port); 
      prov.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "ivr_ebou_user");
      prov.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "ivr+2014");
  
      return port.getInfoFidelioByND(nd);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>When i have deployed this client on the server. I am getting the following error. </p>
  
  <pre><code>com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: j
  ava.net.ConnectException: Connection timed out: connect
          at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.get
  Output(HttpClientTransport.java:121)
          at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.proce
  ss(HttpTransportPipe.java:142)
          at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.proce
  ssRequest(HttpTransportPipe.java:83)
          at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processReques
  t(DeferredTransportPipe.java:105)
          at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
          at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
          at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
          at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
          at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
          at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124
  )
          at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMetho
  dHandler.java:98)
          at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMetho
  dHandler.java:78)
          at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
          at $Proxy30.getInfoFidelioByND(Unknown Source)
  </code></pre>
  
  <p>how can i resolve this problem, any help</p>