Discussion:
Implementing customer identification
(too old to reply)
Hema
2008-11-02 11:40:03 UTC
Permalink
Hi ,
I am using java for implementation customer identification.
Below is the sample code:

/
public void SetClientToken(String clientIP) throws AxisFault,
java.net.MalformedURLException, javax.naming.NamingException {
tokenSpec = new TokenSpecification();
commonStub = new CommonServiceSoapStub(new
URL("https://staging.common.virtualearth.net/find-30/common.asmx"),null );
env = (Context) new InitialContext().lookup("java:comp/env");
UserName = (String) env.lookup("UserName");
Password = (String) env.lookup("Password");

commonStub.setUsername(UserName);
commonStub.setPassword(Password);
tokenSpec.setClientIPAddress(clientIP);


// The maximum allowable token duration is 480 minutes (8 hours).
tokenSpec.setTokenValidityDurationMinutes(480);

}
/** Gets the VE Client Token from the VE Common Service
* @return The String representation of the VE Client Token
* @throws java.rmi.RemoteException If the VE Client Token cannot be
retrieved from the Common Service
*/
public String GetClientToken() throws java.rmi.RemoteException
{
try{

return (commonStub.getClientToken(tokenSpec));
}
catch(Exception ex)
{
System.err.println(ex);
return null;
}
}

Above are the 2 methods used to set the Token and Retreive the Token.
For setting the client token we need to send the client Ip.

setClientToken(theRequest.getRemoteHost());

I am getting the below exception while retreiving the token :

commonStub.getClientToken(tokenSpec))
error:

[11/2/08 16:55:00:508 IST] 0000013a SystemErr R AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.SocketException: Operation timed out: connect:could
be due to invalid address
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Operation
timed out: connect:could be due to invalid address
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:331)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:196)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
at java.net.Socket.connect(Socket.java:478)
at com.ibm.jsse2.by.connect(Unknown Source)
at com.ibm.jsse2.by.<init>(Unknown Source)
at com.ibm.jsse2.SSLSocketFactoryImpl.createSocket(Unknown Source)
at
org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
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.CommonServiceSoapStub.getClientToken(CommonServiceSoapStub.java:570)
at
cat.dds.dl.xml.service.TokenServiceRequest.GetClientToken(TokenServiceRequest.java:73)
at
cat.dds.dl.view.actions.LocationDetailAction.getLocationDetail(LocationDetailAction.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:150)
at cat.dds.dl.view.actions.BaseDLAction.execute(BaseDLAction.java:64)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:56)
at
cat.cis.tuf.server.directory.GroupModificationEventFilter.doFilter(GroupModificationEventFilter.java:34)
at
cat.cis.tuf.sys.server.filter.TUFFilterChainImpl.doFilter(TUFFilterChainImpl.java:47)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:54)
at
cat.cis.tuf.server.security.SecurityFilter.doFilter(SecurityFilter.java:67)
at
cat.cis.tuf.sys.server.filter.TUFFilterChainImpl.doFilter(TUFFilterChainImpl.java:47)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:54)
at
cat.cis.tuf.server.security.cws.CWSSecurityTokenContextFilter.doFilter(CWSSecurityTokenContextFilter.java:67)
at
cat.cis.tuf.sys.server.filter.TUFFilterChainImpl.doFilter(TUFFilterChainImpl.java:47)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:54)
at
cat.cis.tuf.server.logging.LoggingRequestIDFilter.doFilter(LoggingRequestIDFilter.java:34)
at
cat.cis.tuf.sys.server.filter.TUFFilterChainImpl.doFilter(TUFFilterChainImpl.java:47)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:54)
at
cat.cis.tuf.server.filter.TUFMasterFilter.doFilter(TUFMasterFilter.java:40)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)



Could any help me to solve the above issue.

Thanking you.

Hema.
Derek Chan
2008-11-03 19:24:10 UTC
Permalink
Hema,

This newsgroups is for Mappoint Web Service related issues only. Please
post developer questions related to Virtual Earth here:

http://social.msdn.microsoft.com/forums/en-US/vemapcontroldev/threads/

Hope to see you there,
--
Infusion Development
http://www.infusion.com
Post by Hema
Hi ,
I am using java for implementation customer identification.
/
public void SetClientToken(String clientIP) throws AxisFault,
java.net.MalformedURLException, javax.naming.NamingException {
tokenSpec = new TokenSpecification();
commonStub = new CommonServiceSoapStub(new
URL("https://staging.common.virtualearth.net/find-30/common.asmx"),null );
env = (Context) new InitialContext().lookup("java:comp/env");
UserName = (String) env.lookup("UserName");
Password = (String) env.lookup("Password");
commonStub.setUsername(UserName);
commonStub.setPassword(Password);
tokenSpec.setClientIPAddress(clientIP);
// The maximum allowable token duration is 480 minutes (8 hours).
tokenSpec.setTokenValidityDurationMinutes(480);
}
/** Gets the VE Client Token from the VE Common Service
retrieved from the Common Service
*/
public String GetClientToken() throws java.rmi.RemoteException
{
try{
return (commonStub.getClientToken(tokenSpec));
}
catch(Exception ex)
{
System.err.println(ex);
return null;
}
}
Above are the 2 methods used to set the Token and Retreive the Token.
For setting the client token we need to send the client Ip.
setClientToken(theRequest.getRemoteHost());
commonStub.getClientToken(tokenSpec))
[11/2/08 16:55:00:508 IST] 0000013a SystemErr R AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultString: java.net.SocketException: Operation timed out: connect:could
be due to invalid address
{http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Operation
timed out: connect:could be due to invalid address
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:331)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:196)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183)
at java.net.Socket.connect(Socket.java:478)
at com.ibm.jsse2.by.connect(Unknown Source)
at com.ibm.jsse2.by.<init>(Unknown Source)
at com.ibm.jsse2.SSLSocketFactoryImpl.createSocket(Unknown Source)
at
org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
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.CommonServiceSoapStub.getClientToken(CommonServiceSoapStub.java:570)
at
cat.dds.dl.xml.service.TokenServiceRequest.GetClientToken(TokenServiceRequest.java:73)
at
cat.dds.dl.view.actions.LocationDetailAction.getLocationDetail(LocationDetailAction.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
at
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:150)
at cat.dds.dl.view.actions.BaseDLAction.execute(BaseDLAction.java:64)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1173)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:56)
at
cat.cis.tuf.server.directory.GroupModificationEventFilter.doFilter(GroupModificationEventFilter.java:34)
at
cat.cis.tuf.sys.server.filter.TUFFilterChainImpl.doFilter(TUFFilterChainImpl.java:47)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:54)
at
cat.cis.tuf.server.security.SecurityFilter.doFilter(SecurityFilter.java:67)
at
cat.cis.tuf.sys.server.filter.TUFFilterChainImpl.doFilter(TUFFilterChainImpl.java:47)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:54)
at
cat.cis.tuf.server.security.cws.CWSSecurityTokenContextFilter.doFilter(CWSSecurityTokenContextFilter.java:67)
at
cat.cis.tuf.sys.server.filter.TUFFilterChainImpl.doFilter(TUFFilterChainImpl.java:47)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:54)
at
cat.cis.tuf.server.logging.LoggingRequestIDFilter.doFilter(LoggingRequestIDFilter.java:34)
at
cat.cis.tuf.sys.server.filter.TUFFilterChainImpl.doFilter(TUFFilterChainImpl.java:47)
at
cat.cis.tuf.server.filter.TUFExtendedFilterChainImpl.doFilter(TUFExtendedFilterChainImpl.java:54)
at
cat.cis.tuf.server.filter.TUFMasterFilter.doFilter(TUFMasterFilter.java:40)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:626)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at
com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
Could any help me to solve the above issue.
Thanking you.
Hema.
Loading...