PDA

View Full Version : Problem with Java 1.5, Axis 1.2.1, httpclient 2.0.2, MapPoin



aspolito
10-19-2005, 06:38 PM
I am porting a Java 1.4 application over to Java 1.5, and we use Axis to communicate with Microsoft mappoint, which uses digest authentication, something axis doesn't support without some help.

With the old code we had a java file from Microsoft java_1_4.SimpleHTTPSender that we needed to make mappoint work. Now if I try to use that as the transport layer I get the exception.

Unable to get map from Mappoint
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.ProtocolException: Server redirected too many times (20)
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.ProtocolException: Server redirected too many times (20)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:494)
at sun.net.www.protocol.http.HttpURLConnection$6.run( HttpURLConnection.java:1186)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getCha inedException(HttpURLConnection.java:1180)
at sun.net.www.protocol.http.HttpURLConnection.getInp utStream(HttpURLConnection.java:877)
at java_1_4.SimpleHTTPSender.readFromConnection(Simpl eHTTPSender.java:99)
at java_1_4.SimpleHTTPSender.invoke(SimpleHTTPSender. java:60)
at org.apache.axis.strategies.InvocationStrategy.visi t(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain .java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.jav a:83)
at org.apache.axis.client.AxisClient.invoke(AxisClien t.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java :2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at net.mappoint.s.mappoint_30.RenderServiceSoapStub.g etMap(RenderServiceSoapStub.java:1333)

and so on...

Looking on the net I see that the solution is to use CommonsHTTPSender and commons-httpclient instead. So, after setting my client-config.wsdd to use CommonsHTTPSender and putting the commons-httpclient-2.0.2.jar in my class path I get an exception because the interface

org.apache.commons.httpclient.methods.RequestEntit y

doesn't exist int commons-httpclient-2.0.2. Strange, as that's the suggested version of the httpclient to use.

Looking at the source code for axis 1.2.1 it sure needs that interface, but it looks like that interface was defined in commons-httpclient-3.0. So that's my first bit of confusion. Is there another library I need as well. I've poked around quite a bit but I can't see anything refering to other jars needed.

If I add the commons-httpclient-3.0 release candidate jar instead of 2.0.2 things change. Now I seem to have all the classes I need, but it still doesn't work! Instead I get

Unable to get map from Mappoint
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (401)Unauthorized
faultActor:
faultNode:
faultDetail:
{}:return code: 401

{http://xml.apache.org/axis/}HttpErrorCode:401

(401)Unauthorized
at org.apache.axis.transport.http.CommonsHTTPSender.i nvoke(CommonsHTTPSender.java:208)
at org.apache.axis.strategies.InvocationStrategy.visi t(InvocationStrategy.java:32)
...

(and yes I'm using the right username/password combo, that's the first thing I looked at)

Help! Does anyone know what I'm doing wrong? I'm at my wits end. The microsoft support page has been no help, it just keeps telling me I need to use the CommonsHTTPSender, which I'm doing!

Thanks,
Anthony

Wilfried
10-21-2005, 12:09 PM
Hi,

Is this regarding mappoint web service ? Then pleas try to repost your question in the mappoint web service forum. You will get better answers then.