1 Reply Latest reply on Jul 22, 2005 2:12 PM by Thomas Diesler

    Writing clients to use BASIC/CONFIDENTIAL endpoints

    Barry Sheward Newbie

      Hi,

      I want to use the following configuration which requires SSL and HTTP authentication:

       <port-component>
       <port-component-name>OrgEndpoint</port-component-name>
       <port-component-uri>/orgainization/*</port-uri>
       <auth-method>BASIC</auth-method>
       <transport-guarantee>CONFIDENTIAL</transport-gaurantee>
       </port-component>
      


      How can I change my Java client code to force it to use SSL and HTTP authentication? My following code is:

       protected Service getService( ) throws MalformedURLException, ServiceException {
       URL wsdlLocation = new URL( urlstr );
       URL mappingLocation = this.getClass().getClassLoader().getResource( "META-INF/jaxrpc-mapping.xml" );
       URL ws4eeMetaData = null;
       QName serviceName = new QName( serviceUrn, this.serviceName );
       String portName = null;
      
       org.jboss.webservice.client.ServiceFactoryImpl factory = (org.jboss.webservice.client.ServiceFactoryImpl) ServiceFactory.newInstance();
       Service service = factory.createService( wsdlLocation, mappingLocation, ws4eeMetaData, serviceName, portName);
      
       return service;
       }
      
       public void testStringResult() throws Exception {
       Service service = getService();
       WebServicesTest svc = (WebServicesTest) service.getPort(WebServicesTest.class);
       String value = svc.getString();
       System.out.println( "WebServicesTest.getString() returned:" + value );
       assertNotNull( value );
       assertEquals( WebServicesTestBean.STRING_VALUE, value );
       }
      


      Thanks!

      Barry