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;
 
 import java.util.List;
 
 
Axiom-specific version of org.springframework.ws.soap.Soap12Header.

Author(s):
Arjen Poutsma
Since:
1.0.0
 
 class AxiomSoap12Header extends AxiomSoapHeader implements Soap12Header {
 
     AxiomSoap12Header(SOAPHeader axiomHeaderSOAPFactory axiomFactory) {
         super(axiomHeaderaxiomFactory);
     }
 
     public SoapHeaderElement addNotUnderstoodHeaderElement(QName headerName) {
         try {
             SOAPHeaderBlock notUnderstood =
                     getAxiomHeader().addHeaderBlock("NotUnderstood"getAxiomHeader().getNamespace());
             OMNamespace headerNamespace =
                     notUnderstood.declareNamespace(headerName.getNamespaceURI(), QNameUtils.getPrefix(headerName));
             notUnderstood.addAttribute("qname"headerNamespace.getPrefix() + ":" + headerName.getLocalPart(), null);
             return new AxiomSoapHeaderElement(notUnderstoodgetAxiomFactory());
         }
         catch (SOAPProcessingException ex) {
             throw new AxiomSoapHeaderException(ex);
         }
     }
 
     public SoapHeaderElement addUpgradeHeaderElement(String[] supportedSoapUris) {
         try {
             SOAPHeaderBlock upgrade = getAxiomHeader().addHeaderBlock("Upgrade"getAxiomHeader().getNamespace());
             for (String supportedSoapUri : supportedSoapUris) {
                 OMElement supportedEnvelope = getAxiomFactory()
                         .createOMElement("SupportedEnvelope"getAxiomHeader().getNamespace(), upgrade);
                 OMNamespace namespace = supportedEnvelope.declareNamespace(supportedSoapUri"");
                 supportedEnvelope.addAttribute("qname"namespace.getPrefix() + ":Envelope"null);
             }
             return new AxiomSoapHeaderElement(upgradegetAxiomFactory());
         }
         catch (OMException ex) {
             throw new AxiomSoapHeaderException(ex);
         }
     }
 
     @SuppressWarnings("unchecked")
     public Iterator<SoapHeaderElementexamineHeaderElementsToProcess(final String[] rolesfinal boolean isUltimateDestination)
             throws SoapHeaderException {
         RolePlayer rolePlayer = null;
         if (!ObjectUtils.isEmpty(roles)) {
             rolePlayer = new RolePlayer() {
 
                 public List<?> getRoles() {
                     return Arrays.asList(roles);
                 }
 
                 public boolean isUltimateDestination() {
                     return isUltimateDestination;
                 }
             };
         }
         return new AxiomSoapHeaderElementIterator(result);
     }
New to GrepCode? Check out our FAQ X