Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.arjuna.webservices11;
  
  
Created by IntelliJ IDEA. User: adinn Date: Feb 1, 2008 Time: 4:57:16 PM To change this template use File | Settings | File Templates.
 
 public class SoapFault11 extends SoapFault {
    
The detailElement element.
 
      private Element detailElement;
     
The header elements.
 
      private Element[] headerElements ;
     
Default constructor.
 
      public SoapFault11()
      {
          super();
      }

     
Construct a SOAP fault based on a throwable.

Parameters:
th The throwable.
 
      public SoapFault11(final Throwable th)
      {
          super(th);
      }

     
Construct a SOAP header fault based on a throwable.

Parameters:
th The throwable.
headerElements The header elements.
 
      public SoapFault11(final Throwable thfinal Element[] headerElements)
      {
          super(th);
          this. = headerElements;
      }

     
Create a custom SOAP fault.

Parameters:
soapFaultType the soap fault type.
subcode The fault subcode.
reason The fault reason.
 
      public SoapFault11(final SoapFaultType soapFaultTypefinal QName subcodefinal String reason)
      {
          super(soapFaultTypesubcodereason) ;
      }

     
Create a custom SOAP fault.

Parameters:
soapFaultType the soap fault type.
subcode The fault subcode.
reason The fault reason.
headerElements The header elements.
 
      public SoapFault11(final SoapFaultType soapFaultTypefinal QName subcodefinal String reasonfinal Element[] headerElements)
      {
          super(soapFaultTypesubcodereasonnull);
          this. = headerElements ;
      }

     
Create a custom SOAP fault.

Parameters:
soapFaultType the soap fault type.
subcode The fault subcode.
reason The fault reason.
detailElement The fault detailElement.
 
      public SoapFault11(final SoapFaultType soapFaultTypefinal QName subcodefinal String reasonfinal Element detailElement)
      {
          super(soapFaultTypesubcodereasongetDetailString(detailElement)) ;
          this. = detailElement;
      }

     
Create a custom SOAP fault.

Parameters:
soapFaultType the soap fault type.
reason The fault reason.
     public SoapFault11(final SoapFaultType soapFaultTypefinal String reason)
     {
         this(soapFaultTypenullreasonnullnull) ;
     }

     
Create a custom SOAP fault.

Parameters:
soapFaultType the soap fault type.
reason The fault reason.
detailElement The fault detailElement.
     public SoapFault11(final SoapFaultType soapFaultType,
         final String reasonfinal Element detailElement)
     {
         this(soapFaultTypenullreasondetailElementnull) ;
     }

     
Create a custom SOAP fault.

Parameters:
soapFaultType the soap fault type.
subcode The fault subcode.
reason The fault reason.
detailElement The fault detailElement.
headerElements The fault header elements.
     public SoapFault11(final SoapFaultType soapFaultTypefinal QName subcode,
         final String reasonfinal Element detailElementfinal Element[] headerElements)
     {
         this. = soapFaultType ;
         this. = subcode ;
         this. = reason ;
         this. = detailElement;
         this. = headerElements ;
     }

    
factory to use for creating faults
    private static ObjectFactory factory = new ObjectFactory();
    // convert to/from fault we can send via the SoapFaultService
    public Fault toFault()
    {
        Fault fault = .createFault();
        QName faultcode = ;
        String faultstring = getReason();
        fault.setFaultcode(faultcode);
        fault.setFaultstring(faultstring);
        return fault;
    }
    public static SoapFault11 fromFault(Fault fault)
    {
        try {
            QName subcode = fault.getFaultcode();
            String reason = fault.getFaultstring();
            return new SoapFault11(.subcodereason);
        } catch (Throwable th) {
            return new SoapFault11(th);
        }
    }
    public static SoapFault11 create(SOAPFaultException sfe)
    {
        try {
            SOAPFault cause = sfe.getFault();
            QName faultCode = cause.getFaultCodeAsQName();
            String reason = cause.getFaultString();
            SoapFaultType soapFaultType = SoapFaultType.toState(reason);
            Detail detail = cause.getDetail();
            return new SoapFault11(soapFaultTypefaultCodenulldetail);
        } catch (InvalidEnumerationException e) {
            return new SoapFault11(e);
        }
    }
     
Get the SOAP fault detailElement.

Returns:
The SOAP fault detailElement.
     public Element getDetailElement()
     {
         return ;
     }

     
Set the SOAP fault detailElement.

Parameters:
detailElement The SOAP fault detailElement.
     public void setDetailElement(final Element detailElement)
     {
         this. = detailElement;
     }

     
Get the SOAP fault header elements.

Returns:
The SOAP fault header elements.
     public Element[] getHeaderElements()
     {
         return  ;
     }

     
Set the SOAP fault header elements.

Parameters:
headerElements The SOAP fault header elements.
     public void setHeaderElements(final Element[] headerElements)
     {
         this. = headerElements ;
     }

     
return a String representing the supplied detail element

Parameters:
detailElement
Returns:
     private static String getDetailString(Element detailElement)
     {
         return detailElement.getTextContent();
     }
New to GrepCode? Check out our FAQ X