Hello,

I am currently having my first experiences with web services and axis, so this may be newbie questions.

I generated a client from WSDL that consumes one of our partner's web services. (I used EclipseWTP to do so, but that part was easy and succeeded, I think). EclipseWTP currently uses Axis 1, so the exact version is 1.3.0.

I was playing around with a unit test:

    public void testRawConnection_no_authentication() throws Exception {

        // get Service
        PartnerWebServiceLocator locator = new PartnerWebServiceLocator();
        PartnerWebServiceSoap service = locator.getPartnerWebServiceSoap();


        try {

            // Aufruf "under test"
            @SuppressWarnings("unused")
            ClsVacancy result =
service.getVacancy(rentalObjectID, checkIn, checkOut, ENVIRONMENT);

            fail("expected RemoteException was NOT thrown");

        } catch (RemoteException expected) {

            assertNotNull(expected);
assertTrue(expected.getMessage().contains("Anonymous login not allowed"));

        }


    }





That test suceeds, because the Web Service is protected by basic http authentication. But at least I am confident that I succesfully connected to the service, because the recieved error message comes from the remote system and not from Axis itself.


Here are my questions:


1. Is it correct to obtain the service proxy like this:

        // get Service
        PartnerWebServiceLocator locator = new PartnerWebServiceLocator();
        PartnerWebServiceSoap service = locator.getPartnerWebServiceSoap();


  I think it is correct, but can you confirm?




2. And how do I use basic http authentication when I have a password and a username? I googled around and found a code snippet that used the Call class (Interface ?), but I am not sure if that is the correct direction. And the snippet also was not complete. I did not find anything apropriate in the FAQ.


Thanks,
Andy Pahne





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to