Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

AxisFault  RSS feed

 
Natalia Lopez
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have the following code to get a response from a web service

ws.generated.Prueba binding;
try {
binding = new ws.generated.PruebaServiceLocator().getSaludar();
}
catch (javax.xml.rpc.ServiceException jre) {
if (jre.getLinkedCause() != null) {
jre.getLinkedCause().printStackTrace();
}
throw new junit.framework.AssertionFailedError(
"JAX-RPC ServiceException caught: " + jre);
}

try {

String value = binding.getMessage("hello");

System.out.println("--> " + value);

}
catch (Exception eb){
eb.printStackTrace();

}


This code is working ok if the response came back in 10 seccond, but when the webservice response delay more than 20 seconds I get the following stack trace exception

AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (0)null
faultActor:
faultNode:
faultDetail:
{}:return code: 0

{http://xml.apache.org/axis/}HttpErrorCode:0

(0)null


What can I do to avoid this error and wait for a maximun time of 40 second for example?

Regards

Natalia
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Natalia
Try to
 
Natalia Lopez
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried doing this

ws.generated.PruebaSoapBindingStub binding;
try {
binding = (ws.generated.PruebaSoapBindingStub)
new ws.generated.PruebaServiceLocator().getPrueba();
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}

try {
// Time out after a minute
binding.setTimeout(600000);



// Test operation
String value = null;
value = binding.getMessage("hello");


System.out.println("--> " + value);

}
catch (Exception eb){
eb.printStackTrace();

}

and is the same I obtain


AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (0)null
faultActor:
faultNode:
faultDetail:
{}:return code: 0

{http://xml.apache.org/axis/}HttpErrorCode:0

(0)null
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
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:2765)


Any idea?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!