I have a webservice client generated from SoapUI and Apache CXF component. When I run it at Mule ESB server I receive the following error:
org.mule.transport.http.HttpClientMessageDispatcher - Received a redirect, but followRedirects=false. Response code: 401 Unauthorized
The interesting fact here is that when I run it locally from Anypoint Studio everything works fine. How can I allow my service client to handle redirections. Is there any other error?
Here is my code:
URL wsdlURL = MPServiceService.WSDL_LOCATION;
MPServiceService ss = new MPServiceService(wsdlURL, SERVICE_NAME);
MPService port = ss.getDomino();
BindingProvider prov = (BindingProvider) port;
prov.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
requestpath);
prov.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
prov.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
String result = port.webServiceFoo();
return result;