axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Robison <drrobi...@openroadsconsulting.com>
Subject Problem getting HTTP Basic Authentication working
Date Tue, 21 Sep 2004 17:00:57 GMT
I'm having trouble getting HTTP basic authentication working. I've used 
the wsdl2java compiler to compile a 3rd party wsdl. Here is my client code:

        try {
            ABCWS mbsSoapService = new ABCWSLocator();
            URL serviceURL = new 
URL("http://abc.com/ABCinterface/mbs.asmx");
            ABCWSSoap mbsSoap = mbsSoapService.getABCWSSoap(serviceURL);
            ((ABCWSSoapStub)mbsSoap).setUsername("orci");
            ((ABCWSSoapStub)abcSoap).setPassword("orci");
            SerialResponse rsp = abcSoap.startSerialStream(encoderId, 
"127.0.0.1", myGUID.toString(), portCode);
            macAddress = rsp.getMacAddress();
            LOG.info("startSerialStream result = " + rsp.getCode());
            if (rsp.getCode() != 0) throw new 
IOException("startSerialStream error: " + rsp.getCode());
        } catch (MalformedURLException e) {
            LOG.error("Error connecting to SOAP service: " + e);
        } catch (ServiceException e) {
            LOG.error("Error connecting to SOAP service: " + e);
        } catch (Exception e) {
            LOG.error("Error connecting to SOAP service: " + e);
        }

When the call is made, the following is some of the debug:

DEBUG org.apache.axis.transport.http.HTTPSender  - POST /MBSinterface 
HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.2beta3
 Host: mbs03.trafficland.com
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "schemas.rccny.com/MBS/StopSerialStream"
Content-Length: 375

however, the server responds with

AxisFault
  faultCode: {http://xml.apache.org/axis/}HTTP
  faultSubcode:
  faultString: (401)Access Denied
  faultActor:
  faultNode:
  faultDetail:
     {}:return code:  401

Any ideas? Thanks in advanced,
David Robison

-- 

David R Robison
Open Roads Consulting, Inc.
708 S. Battlefield Blvd., Chesapeake, VA 23322
phone: (757) 546-3401
e-mail: drrobison@openroadsconsulting.com
web: http://openroadsconsulting.com



Mime
View raw message