Package javax.xml.ws.addressing

Examples of javax.xml.ws.addressing.AddressingException


        }
      }
    }
    catch (SOAPException ex)
    {
      throw new AddressingException("Cannot read headers", ex);
    }
    catch (URISyntaxException ex)
    {
      throw new AddressingException("Cannot read headers", ex);
    }
  }
View Full Code Here


      appendRequiredHeader(soapHeader, ADDR.getActionQName(), getAction());
     
      // Write wsa:MessageID
      if( (getReplyTo()!=null || getFaultTo()!=null) && null==getMessageID())
      {
        throw new AddressingException("Required addressing header missing:" + ADDR.getMessageIDQName());
      }
      else if (getMessageID() != null)
      {
        SOAPElement wsaMessageId = soapHeader.addChildElement(new NameImpl(ADDR.getMessageIDQName()));
        wsaMessageId.addTextNode(getMessageID().getURI().toString());
      }

      // Write wsa:RelatesTo
      if (getRelatesTo() != null)
      {
        for (Relationship rel : getRelatesTo())
        {
          SOAPElement wsaRelatesTo = soapHeader.addChildElement(new NameImpl(ADDR.getRelatesToQName()));
          if (rel.getType() != null)
          {
            wsaRelatesTo.setAttribute(ADDR.getRelationshipTypeName(), getQualifiedName(rel.getType()));
          }
          wsaRelatesTo.addTextNode(rel.getID().toString());
        }
      }

      // Write wsa:ReferenceParameters
      ReferenceParameters refParams = getReferenceParameters();
      if (refParams.getElements().size() > 0)
      {
            for (Object obj : refParams.getElements())
            {
               SOAPElement refElement = appendElement(soapHeader, obj);
               QName refQName = new QName(ADDR.getNamespaceURI(), "IsReferenceParameter", ADDR.getNamespacePrefix());
               refElement.addAttribute(refQName, "true");
            }
      }

      appendElements(soapHeader, getElements());
    }
    catch (SOAPException ex)
    {
      throw new AddressingException("Cannot read ws-addressing headers", ex);
    }
  }
View Full Code Here

  }

  private void appendRequiredHeader(SOAPHeader soapHeader, QName name, AttributedURI value) throws SOAPException
  {
    if(null == value)
      throw new AddressingException("Required addressing property missing: " + name);
   
    SOAPElement element = soapHeader.addChildElement(new NameImpl(name));
    element.addTextNode(value.getURI().toString());

    if(mustunderstand)
View Full Code Here

    {
      throw rte;
    }
    catch (Exception ex)
    {
      throw new AddressingException("Cannot append elements", ex);
    }
  }
View Full Code Here

            child = factory.createElement(el);
            soapElement.addChildElement(child);
         }
         else
         {
            throw new AddressingException("Unsupported element: " + obj.getClass().getName());
         }
         return child;
      }
      catch (RuntimeException rte)
      {
         throw rte;
      }
      catch (Exception ex)
      {
         throw new AddressingException("Cannot append elements", ex);
      }
   }
View Full Code Here

            msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND, Scope.APPLICATION);
      }
    }
    catch (SOAPException ex)
    {
      throw new AddressingException("Cannot handle response", ex);
    }

    return true;
  }
View Full Code Here

/*     */   private boolean mustunderstand;
/*     */
/*     */   private String getRequiredHeaderContent(SOAPHeader soapHeader, QName qname)
/*     */   {
/*  70 */     Element element = DOMUtils.getFirstChildElement(soapHeader, qname);
/*  71 */     if (null == element) throw new AddressingException("Required element " + qname + " is missing");
/*     */
/*  73 */     String value = DOMUtils.getTextContent(element);
/*  74 */     if ((null == value) || (value.equals(""))) throw new AddressingException("Required element " + qname + " is missing");
/*     */
/*  76 */     return value;
/*     */   }
View Full Code Here

/*     */         }
/*     */       }
/*     */     }
/*     */     catch (SOAPException ex)
/*     */     {
/* 182 */       throw new AddressingException("Cannot read headers", ex);
/*     */     }
/*     */     catch (URISyntaxException ex)
/*     */     {
/* 186 */       throw new AddressingException("Cannot read headers", ex);
/*     */     }
/*     */   }
View Full Code Here

/*     */
/* 257 */       appendRequiredHeader(soapHeader, ADDR.getActionQName(), getAction());
/*     */
/* 260 */       if (((getReplyTo() != null) || (getFaultTo() != null)) && (null == getMessageID()))
/*     */       {
/* 262 */         throw new AddressingException("Required addressing header missing:" + ADDR.getMessageIDQName());
/*     */       }
/* 264 */       if (getMessageID() != null)
/*     */       {
/* 266 */         SOAPElement wsaMessageId = soapHeader.addChildElement(new NameImpl(ADDR.getMessageIDQName()));
/* 267 */         wsaMessageId.addTextNode(getMessageID().getURI().toString());
/*     */       }
/*     */
/* 271 */       if (getRelatesTo() != null)
/*     */       {
/* 273 */         for (Relationship rel : getRelatesTo())
/*     */         {
/* 275 */           SOAPElement wsaRelatesTo = soapHeader.addChildElement(new NameImpl(ADDR.getRelatesToQName()));
/* 276 */           if (rel.getType() != null)
/*     */           {
/* 278 */             wsaRelatesTo.setAttribute(ADDR.getRelationshipTypeName(), getPrefixedName(rel.getType()));
/*     */           }
/* 280 */           wsaRelatesTo.addTextNode(rel.getID().toString());
/*     */         }
/*     */
/*     */       }
/*     */
/* 285 */       ReferenceParameters refParams = getReferenceParameters();
/* 286 */       if ((refParams.getElements().size() > 0) || (refParams.getAttributes().size() > 0))
/*     */       {
/* 288 */         SOAPElement wsaRefParams = soapHeader.addChildElement(new NameImpl(ADDR.getReferenceParametersQName()));
/* 289 */         appendAttributes(wsaRefParams, refParams.getAttributes());
/* 290 */         appendElements(wsaRefParams, refParams.getElements());
/*     */       }
/*     */
/* 293 */       appendElements(soapHeader, getElements());
/*     */     }
/*     */     catch (SOAPException ex)
/*     */     {
/* 297 */       throw new AddressingException("Cannot read ws-addressing headers", ex);
/*     */     }
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   private void appendRequiredHeader(SOAPHeader soapHeader, QName name, AttributedURI value) throws SOAPException
/*     */   {
/* 303 */     if (null == value) {
/* 304 */       throw new AddressingException("Required addressing property missing: " + name);
/*     */     }
/* 306 */     SOAPElement element = soapHeader.addChildElement(new NameImpl(name));
/* 307 */     element.addTextNode(value.getURI().toString());
/*     */
/* 309 */     if (this.mustunderstand)
View Full Code Here

TOP

Related Classes of javax.xml.ws.addressing.AddressingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.