Hi All,Thanks to all in advance
I am unable to consume external web service through Axis2 from resource
http://www.webservicex.net/CurrencyConvertor.asmx
Please help me to solve the issue,I am getting this exception in production environment,it is working fine in my development environment
Please help me how to get out of this problem how can I enable redirects do I need to to any axis2 configuration changes or else can it be done from code.
Stack Trace I am getting
----------------------------------
10:36:22,751 INFO [HttpMethodDirector] Redirect requested but followRedirects is disabled
10:36:22,751 INFO [HTTPSender] Unable to sendViaPost to url[http://www.webservicex.net/CurrencyConvertor.asmx]
org.apache.axis2.AxisFault: Transport error: 302 Error: Moved Temporarily
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:296)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at com.gsscrmservice.curconv.CurrencyConvertorStub.ConversionRate(CurrencyConvertorStub.java:322)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.gesmallworld.gss.lib.service.Axis2WebService.handleRequest(Axis2WebService.java:279)
at com.gsscrmservice.curconvEJB.CurrencyConvertorBean.ConversionRate(CurrencyConvertorBean.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.gesmallworld.gss.lib.service.Service.makeRequest(Service.java:489)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Delegati
I have given below code inorder for proxy configuration in dev but same is not working in prod Please help.
HttpTransportProperties.ProxyProperties pp = new HttpTransportProperties.ProxyProperties();
pp.setProxyName("172.16.108.174");
pp.setProxyPort(8080);
pp.setUserName(prop.getProperty("userName"));
pp.setPassWord(prop.getProperty("password"));
_serviceClient.getOptions().setProperty(HTTPConstants.PROXY,pp);
HttpTransportProperties.Authenticator auth =new HttpTransportProperties.Authenticator();
auth.setUsername(prop.getProperty("userName"));
auth.setPassword(prop.getProperty("password"));
auth.setPreemptiveAuthentication(true);
auth.setRealm(HttpTransportProperties.Authenticator.BASIC);
List authPrefs = new Vector<
String>(1);
authPrefs.add(AuthPolicy.BASIC);
_serviceClient.getOptions().setProperty(HTTPConstants.AUTHENTICATE,auth);
_serviceClient.getOptions().setProperty(AuthPolicy.AUTH_SCHEME_PRIORITY,authPrefs);
// _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION,org.apache.axis2.transport.http.HTTPConstants.HEADER_PROTOCOL_10);
THANKS IN ADVANCE to all.