Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-3887

The servlet transport does not set the HTTP response code to 500 when a SOAP fault is returned (unless an exception was thrown)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.4.1
    • transports
    • None

    Description

      Steps:
      Edit axis2-1.4/samples/userguide/src/userguide/example1/MyService.java and make it look like shown below:

      package userguide.example1;
      import org.apache.axiom.om.OMElement;

      import org.apache.axis2.AxisFault;

      import javax.xml.stream.XMLStreamException;

      public class MyService {

      public OMElement echo(OMElement element) throws XMLStreamException

      { return org.apache.axiom.om.OMAbstractFactory.getSOAP11Factory().getDefaultFaultEnvelope().getBody().getFirstElement(); }

      public void ping(OMElement element) throws XMLStreamException

      { //Do some processing }

      public void pingF(OMElement element) throws AxisFault

      { throw new AxisFault("Fault being thrown"); }

      }

      Invoking the echo service now returns:
      HTTP/1.1 200 OK

      Server: Apache-Coyote/1.1

      Content-Type: text/xml;charset=UTF-8

      Transfer-Encoding: chunked

      Date: Thu, 03 Jul 2008 08:42:40 GMT

      fd

      <?xml version='1.0' encoding='UTF-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Body>
      <soapenv:Fault>
      <faultcode></faultcode>
      <faultstring></faultstring>
      <detail />
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>
      0

      Attachments

        Activity

          People

            asankha Asankha Chamath Perera
            asankha Asankha Chamath Perera
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: