Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2005-2010 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.springframework.ws.soap.axiom;
 
 
 
Axiom-specific version of org.springframework.ws.soap.Soap12Body.

Author(s):
Arjen Poutsma
Since:
1.0.0
 
 class AxiomSoap12Body extends AxiomSoapBody implements Soap12Body {
 
     AxiomSoap12Body(SOAPBody axiomBodySOAPFactory axiomFactoryboolean payloadCaching) {
         super(axiomBodyaxiomFactorypayloadCaching);
     }
 
     public Soap12Fault addMustUnderstandFault(String reasonLocale locale) {
         Assert.notNull(locale"No locale given");
         SOAPFault fault = addStandardFault(.reasonlocale);
         return new AxiomSoap12Fault(faultgetAxiomFactory());
     }
 
     public Soap12Fault addClientOrSenderFault(String reasonLocale locale) {
         Assert.notNull(locale"No locale given");
         SOAPFault fault = addStandardFault(.reasonlocale);
         return new AxiomSoap12Fault(faultgetAxiomFactory());
     }
 
     public Soap12Fault addServerOrReceiverFault(String reasonLocale locale) {
         Assert.notNull(locale"No locale given");
         SOAPFault fault = addStandardFault(.reasonlocale);
         return new AxiomSoap12Fault(faultgetAxiomFactory());
     }
 
     public Soap12Fault addVersionMismatchFault(String reasonLocale locale) {
         Assert.notNull(locale"No locale given");
         SOAPFault fault = addStandardFault(.reasonlocale);
         return new AxiomSoap12Fault(faultgetAxiomFactory());
     }
 
     public Soap12Fault addDataEncodingUnknownFault(QName[] subcodesString reasonLocale locale) {
         Assert.notNull(locale"No locale given");
         SOAPFault fault = addStandardFault(.reasonlocale);
         return new AxiomSoap12Fault(faultgetAxiomFactory());
     }
 
     private SOAPFault addStandardFault(String localNameString faultStringOrReasonLocale locale) {
         Assert.notNull(faultStringOrReason"No faultStringOrReason given");
         try {
             AxiomUtils.removeContents(getAxiomBody());
             SOAPFault fault = getAxiomFactory().createSOAPFault(getAxiomBody());
             SOAPFaultCode code = getAxiomFactory().createSOAPFaultCode(fault);
             SOAPFaultValue value = getAxiomFactory().createSOAPFaultValue(code);
             value.setText(fault.getNamespace().getPrefix() + ":" + localName);
             SOAPFaultReason reason = getAxiomFactory().createSOAPFaultReason(fault);
             SOAPFaultText text = getAxiomFactory().createSOAPFaultText(reason);
             if (locale != null) {
                 text.setLang(AxiomUtils.toLanguage(locale));
             }
             text.setText(faultStringOrReason);
             return fault;
         }
         catch (SOAPProcessingException ex) {
             throw new AxiomSoapFaultException(ex);
         }
     }
 
    public Soap12Fault getFault() {
        SOAPFault axiomFault = getAxiomBody().getFault();
        return axiomFault != null ? new AxiomSoap12Fault(axiomFaultgetAxiomFactory()) : null;
    }
New to GrepCode? Check out our FAQ X