wood burning stoves 2.0*
The moose likes Web Services and the fly likes [Axis2]Transport error: 411 Error: Length Required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "[Axis2]Transport error: 411 Error: Length Required" Watch "[Axis2]Transport error: 411 Error: Length Required" New topic
Author

[Axis2]Transport error: 411 Error: Length Required

eva peng
Greenhorn

Joined: Jun 28, 2010
Posts: 1
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 .
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!


My free books and tutorials: http://www.slideshare.net/krizsan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Axis2]Transport error: 411 Error: Length Required
 
Similar Threads
EWS : Transport error: 401 Error: Unauthorized
org.apache.axis2.AxisFault: Transport error: 411 Error: Invalid Request
axis2 ntlm authentication - No credentials available for NTLM
javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: Transport error: 403 Error: Forbidden
Need Help in finding out the issue