Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

faultString: (401)Unauthorized

51 views
Skip to first unread message

Haythem

unread,
Jun 12, 2010, 4:43:31 PM6/12/10
to
Dear Support Team,

I am a new Developer in Mappoint and I am trying to use the
FindServiceSoapStub with java and I have this Error.
Can you tell me please if I allowed to use this service with my staging
developer account?
Is this service still support by bing maps?
You find here my code and the Error Message:

Thanks for a reply and best regards.

import java.net.URL;
import net.mappoint.s.mappoint_30.*;

public class DrawRoute {
public static void main(String[] args) {

final String serviceUrl =
"http://findv3.staging.mappoint.net/Find-30/FindService.asmx";
FindServiceSoap findService = null;

try {
findService =
new FindServiceLocator().getFindServiceSoap(new
URL(serviceUrl));
((FindServiceSoapStub)findService).setUsername("xxxxxxx");
((FindServiceSoapStub)findService).setPassword("yyyyyy");

Address address = new Address();
address.setPostalCode("38100");
address.setCountryRegion("Germany");



FindAddressSpecification findSpec = new
FindAddressSpecification();
findSpec.setInputAddress(address);
findSpec.setDataSourceName("MapPoint.EU");

FindResults results = findService.findAddress(findSpec);

if (results.getNumberFound() >= 1) {

System.out.println(results.getResults()[0].getFoundLocation().getLatLong().getLatitude());
}

} catch (Exception e) {
e.printStackTrace();
}
}
}

log4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
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.invoke(CommonsHTTPSender.java:218)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at
net.mappoint.s.mappoint_30.FindServiceSoapStub.findAddress(FindServiceSoapStub.java:1493)
at DrawRoute.main(DrawRoute.java:32)

A. Peterson

unread,
Jun 16, 2010, 3:15:44 PM6/16/10
to
Make sure the password and username are correct, also to connect via Java
your application must implement Digest authentication

check out more information here: http://go.mappoint.net/mappointmpac/

Derek Chan

unread,
Jun 18, 2010, 4:27:16 PM6/18/10
to
Hi,

You can also refer to an article I've written on handling 401 errors in Java
(namely Eclipse) at:

http://wldchan.spaces.live.com/blog/cns!8AB026AF304D9CA5!161.entry

Regards,
--
Windows Live Platform MVP

0 new messages