You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Rajesh Jain <ra...@readiminds.com> on 2003/03/21 03:53:06 UTC
SOAP Fault Handling with Custom Error Messages
Hi
I am trying to trap the AXIS fault from my webservice in a server
request handler and modify SOAP Fault Block
with a custom message.
public void onFault(MessageContext ctx) {
System.out.println("Hello, got invoked. I'm onFault method of
ErrorHandler.");
try {
Message message = ctx.getResponseMessage();
SOAPEnvelope soapEnvelope = message.getSOAPEnvelope();
SOAPBody soapBody = (org.apache.axis.message.SOAPBody)
soapEnvelope.getBody();
SOAPFault soapFault = (org.apache.axis.message.SOAPFault)
soapBody.getFault();
AxisFault af = new AxisFault();
af.setFaultActor("http://localhost/CustomerService");
af.setFaultCode("ABCD123456789");
af.setFaultString("Internationalized Error Messgae");
soapFault.setFault(af);
message.saveChanges();
}
But at the client side the SOAP Fault message is still the orginal one
and not the modified one.
How do I add my own customer error Message?
regards
Rajesh
Maximum Connections
Posted by "E.Narayanan" <ed...@pspl.co.in>.
MessageHi,
I have an Axis Web service hosted on Jboss. For performance testing I had made a java client which creates threads and makes webservice calls. The calls were using the proxies generated from wsdl2java.It worked fine with 100 and 200 threads. When I tried with 300 threads it failed(Error given Below...). Is there some limit or am I missing something here.I am running both client and server on the same machine (win2k Server).
Please let me know how I can do this.
Thanks,
Narayanan
java.net.ConnectException: Connection refused: connect
at org.apache.axis.AxisFault.makeFault(AxisFault.java:120)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStr
y.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:126)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:182)
at org.apache.axis.client.Call.invokeEngine(Call.java:2113)
at org.apache.axis.client.Call.invoke(Call.java:2102)
at org.apache.axis.client.Call.invoke(Call.java:1851)
at org.apache.axis.client.Call.invoke(Call.java:1777)
at org.apache.axis.client.Call.invoke(Call.java:1315)
at localhost.CoprindmWebServiceSoapBindingStub.getProjSvrData(Coprin
bServiceSoapBindingStub.java:134)
at StressTester.run(Unknown Source)........................................../** My file*/
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:17
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at java.net.Socket.connect(Socket.java:376)
at java.net.Socket.<init>(Socket.java:291)
at java.net.Socket.<init>(Socket.java:119)
at org.apache.axis.components.net.DefaultSocketFactory.create(Defaul
ketFactory.java:131)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.ja
75)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java: