title: Exception when implementing JAX-WS client with transport level security
body: <p>I am trying to invoke method via webservice (SOAP)</p>
  
  <p>I have generated Web service client with JAX-WS.</p>
  
  <p>I can access the webservice only with transport level security.</p>
  
  <p>I am getting the error:</p>
  
  <pre><code>javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://10.99.36.26:8001/DummySubsForNetwork?wsdl. It failed with: 
      Server returned HTTP response code: 401 for URL: http://10.99.36.26:8001/DummySubsForNetwork?wsdl.
      at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:162)
      at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:144)
      at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:263)
      at com.sun.xml.ws.client.WSServiceDelegate.&lt;init&gt;(WSServiceDelegate.java:226)
      at com.sun.xml.ws.client.WSServiceDelegate.&lt;init&gt;(WSServiceDelegate.java:174)
      at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104)
      at javax.xml.ws.Service.&lt;init&gt;(Unknown Source)
      at com.mirs.sbn.esb.client.DummySubsForNetwork_Service.&lt;init&gt;(DummySubsForNetwork_Service.java:67)
      at main.executeEsbRequest(main.java:167)
      at main.testEsb(main.java:141)
      at main.main(main.java:59)
  </code></pre>
  
  <p>this is my code:</p>
  
  <p><strong>Main method which I am executing:</strong></p>
  
  <pre><code>private static DummySubsForNetwork executeEsbRequest()
      {
  
          DummySubsForNetwork_Service service = new DummySubsForNetwork_Service();
  
          DummySubsForNetwork dummyPort = service.getDummySubsForNetworkSOAP();
  
          Map&lt;String, Object&gt; rc = ((BindingProvider) dummyPort).getRequestContext();
  
          rc.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                  "http://some.local.ip:8001/DummySubsForNetwork?wsdl");
          rc.put(BindingProvider.USERNAME_PROPERTY, "csmuser");
          rc.put(BindingProvider.PASSWORD_PROPERTY, "passw0rd");
  
          return dummyPort;
  
      }
  </code></pre>
  
  <p><strong>Auto generated class via JAX-WS:</strong></p>
  
  <pre><code>@WebServiceClient(name = "DummySubsForNetwork", targetNamespace = "http://www.example.org/DummySubsForNetwork/", wsdlLocation = "http://some.local.ip:8001/DummySubsForNetwork?wsdl")
  public class DummySubsForNetwork_Service extends Service
  {
  
      private final static URL DUMMYSUBSFORNETWORK_WSDL_LOCATION;
      private final static Logger logger = Logger
              .getLogger(com.mirs.sbn.esb.client.DummySubsForNetwork_Service.class.getName());
  
      static
      {
          URL url = null;
          try
          {
              URL baseUrl;
              baseUrl = com.mirs.sbn.esb.client.DummySubsForNetwork_Service.class.getResource(".");
              url = new URL(baseUrl, "http://some.local.ip:8001/DummySubsForNetwork?wsdl");
          }
          catch (MalformedURLException e)
          {
              logger
                      .warning("Failed to create URL for the wsdl Location: 'some.local.ip:8001/DummySubsForNetwork?wsdl', retrying as a local file");
              logger.warning(e.getMessage());
          }
          DUMMYSUBSFORNETWORK_WSDL_LOCATION = url;
      }
  
      public DummySubsForNetwork_Service(URL wsdlLocation, QName serviceName)
      {
          super(wsdlLocation, serviceName);
      }
  
      public DummySubsForNetwork_Service()
      {
          super(DUMMYSUBSFORNETWORK_WSDL_LOCATION, new QName(
                  "http://www.example.org/DummySubsForNetwork/", "DummySubsForNetwork"));
      }
  
      /**
       * 
       * @return returns DummySubsForNetwork
       */
      @WebEndpoint(name = "DummySubsForNetworkSOAP")
      public DummySubsForNetwork getDummySubsForNetworkSOAP()
      {
          return super.getPort(new QName("http://www.example.org/DummySubsForNetwork/",
                  "DummySubsForNetworkSOAP"), DummySubsForNetwork.class);
      }
  }
  </code></pre>
  
  <hr>
  
  <p>I am getting the execption when I am invoking this method in the class: 'DummySubsForNetwork_Service'</p>
  
  <pre><code>@WebEndpoint(name = "DummySubsForNetworkSOAP")
      public DummySubsForNetwork getDummySubsForNetworkSOAP()
      {
          return super.getPort(new QName("http://www.example.org/DummySubsForNetwork/",
                  "DummySubsForNetworkSOAP"), DummySubsForNetwork.class);
      }
  </code></pre>
  
  <p>thanks,
  ray.</p>