• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

[Axis2]Transport error: 411 Error: Length Required

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
First of all, in case you haven't seen it, an explanation of the HTTP 411 error: http://www.checkupdown.com/status/E411.html
Second, I do not know why your client has stopped working. If you are using generated artifacts, have you tried to re-generate them?
I do suspect that there may have been some change in the service.
To determine what such a change may include and how to fix your client, you can use the following strategy:
- Invoke the service using soapUI or similar tool to see what legal requests look like.
- Compare legal requests with requests from your client to determine what is wrong with the requests from your client.
- Fix your client accordingly.

Sounds simple, eh?!? I suspect it may be slightly tedious work, though.
Best wishes!
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic