I am trying to connect to a web service as follows (using wsdl2java):
Here is how I am connecting:
SpringBusFactory bf = new SpringBusFactory();
uRL busFile = CpofWebServiceUtils.class.getResource("cxf-config.xml");
Bus bus = bf.createBus(busFile.toString());
RepositoryService_Service rsp = new RepositoryService_Service(new URL(WSDL_URL), SERVICE_NAME);
RepositoryService svc = rsp.getPort(PORT_NAME, RepositoryService.class);
In my pom I am including cxf-rt-core and cxf-rt-transports-http.
My cxf-config.xml looks as follows:
I can connect to the WS no problem, but when a method is invoked I get the following exception:
com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 401: Unauthorized
Edited by: jamie3 on Jun 27, 2011 11:44 AM
How did you do this "I can connect to the WS no problem" ?
Can you check if the address in the WSDL is right?