Haythem
2010-06-12 20:43:31 UTC
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)
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)