Discussion:
faultString: (401)Unauthorized
(too old to reply)
Haythem
2010-06-12 20:43:31 UTC
Permalink
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
2010-06-16 19:15:44 UTC
Permalink
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/
Post by Haythem
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?
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
faultString: (401)Unauthorized
{}: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)
Derek Chan
2010-06-18 20:27:16 UTC
Permalink
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
Post by A. Peterson
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/
Post by Haythem
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?
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
faultString: (401)Unauthorized
{}: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)
Loading...