I have a problem when programing with
java on eclipse.I use the class Fetcher that generates the client API according to the WSDL provided by ECHO using AXIS2:http://api.echo.nasa.gov/echo-wsdl/v10/AuthenticationService.wsdl
andhttp://api.echo.nasa.gov/echo-wsdl/v10/CatalogService.wsdl, then the API is used to get NASA data.It run corretely before.It has no change.A weeks later, when I used it,the console show that output like this:
org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:296)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at gov.nasa.echo.v10.authenticationservice.AuthenticationServiceStub.Login(AuthenticationServiceStub.java:1647)
at edu.whu.liesmars.ipv6.Fetcher.login(Fetcher.java:86)
at edu.whu.liesmars.ipv6.Fetcher.doMODISFetcher(Fetcher.java:240)
at edu.whu.liesmars.ipv6.time.Ipv6TimerTask.run(Ipv6TimerTask.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
2010-03-29 16:20:26,250 FATAL [Timer-0] edu.whu.liesmars.ipv6.Fetcher: 登录时出现AxisFault错误:org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required
org.apache.axis2.AxisFault: Transport error: 411 Error: Length Required
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:296)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at gov.nasa.echo.v10.authenticationservice.AuthenticationServiceStub.Login(AuthenticationServiceStub.java:1647)
at edu.whu.liesmars.ipv6.Fetcher.login(Fetcher.java:86)
at edu.whu.liesmars.ipv6.Fetcher.doMODISFetcher(Fetcher.java:240)
at edu.whu.liesmars.ipv6.time.Ipv6TimerTask.run(Ipv6TimerTask.java:55)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
2010-03-29 16:20:26,937 INFO [Timer-0] org.apache.commons.httpclient.HttpMethodDirector: I/O exception (org.apache.axis2.AxisFault) caught when processing request: token cannot be null!!
2010-03-29 16:20:26,937 INFO [Timer-0] org.apache.commons.httpclient.HttpMethodDirector: Retrying request
2010-03-29 16:20:27,609 INFO [Timer-0] org.apache.commons.httpclient.HttpMethodDirector: I/O exception (org.apache.axis2.AxisFault) caught when processing request: token cannot be null!!
2010-03-29 16:20:27,609 INFO [Timer-0] org.apache.commons.httpclient.HttpMethodDirector: Retrying request
2010-03-29 16:20:28,281 INFO [Timer-0] org.apache.commons.httpclient.HttpMethodDirector: I/O exception (org.apache.axis2.AxisFault) caught when processing request: token cannot be null!!
2010-03-29 16:20:28,281 INFO [Timer-0] org.apache.commons.httpclient.HttpMethodDirector: Retrying request
2010-03-29 16:20:28,953 INFO [Timer-0] org.apache.axis2.transport.http.HTTPSender: Unable to sendViaPost to url[https://api.echo.nasa.gov:443/echo-v10/CatalogServicePortImpl]
org.apache.axis2.AxisFault: token cannot be null!!
///////////////
the code is like that:
public
String login(){
try{
AuthenticationServiceStub authenticationServiceStub = new AuthenticationServiceStub();
//authenticationServiceStub._getServiceClient().getOptions().setTimeOutInMilliSeconds(600000L);
AuthenticationServiceStub.Login login = new AuthenticationServiceStub.Login();
AuthenticationServiceStub.ClientInformation clientInformation = new AuthenticationServiceStub.ClientInformation();
clientInformation.setClientId(config.getLoginInformation("clientId"));
clientInformation.setUserIpAddress(config.getLoginInformation("userIpAddress"));
login.setClientInfo(clientInformation);
login.setUsername(config.getLoginInformation("username").trim());
System.out.println("user = "+login.getUsername());
login.setPassword(config.getLoginInformation("password").trim());
System.out.println("password = "+login.getPassword());
AuthenticationServiceStub.LoginResponse loginResponse = authenticationServiceStub.Login(login);
setToken(loginResponse.getResult());
System.out.println("token = "+token);
log.info("token = "+token);
return getToken();
}catch(AxisFault e){
log.fatal("登录时出现AxisFault错误:"+e.toString());
e.printStackTrace();
/////////////////////////
I don't know what the prolem is.Could you please me ?How to deal with the problem?
Look forward to your reply .