Package org.jboss.ws.core.soap

Examples of org.jboss.ws.core.soap.NameImpl


      QName faultCode = faultEx.getFaultCode();
      if (faultCode.getNamespaceURI().length() > 0)
         faultCode = nsRegistry.registerQName(faultCode);

      String faultString = getValidFaultString(faultEx);
      SOAPFault soapFault = soapBody.addFault(new NameImpl(faultCode), faultString);

      String faultActor = faultEx.getFaultActor();
      if (faultActor != null)
      {
         SOAPElement soapElement = soapFault.addChildElement("faultactor");
View Full Code Here


       * 1. SOAPFaultException.getFault().getFaultCodeAsQName()
       * X. env:Server (Subcode omitted for SOAP 1.2) */
      Name faultCode = sourceFault.getFaultCodeAsName();
      if (faultCode != null)
      {
         faultCode = new NameImpl(faultCode.getLocalName(), "codeNS", faultCode.getURI());
      }
      else
      {
         faultCode = getFallbackFaultCode();
      }
View Full Code Here

      SOAPFault soapFault = soapBody.addFault(getFallbackFaultCode(), getFallbackFaultString(ex));

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SerializationContext serContext = msgContext.getSerializationContext();

      NameImpl faultCode = (NameImpl)soapFault.getFaultCodeAsName();
      if (faultCode.getURI().length() > 0)
         serContext.getNamespaceRegistry().registerQName(faultCode.toQName());

      OperationMetaData opMetaData = msgContext.getOperationMetaData();
      Class<? extends Exception> exClass = ex.getClass();
      if (opMetaData != null && opMetaData.getFaultMetaData(exClass) != null)
      {
View Full Code Here

      /* faultcode
       * X. SOAPFaultException.getFault().getFaultCodeAsQName()
       * 2. env:Server (Subcode omitted for SOAP 1.2) */
      if (isSOAP12() == false)
      {
         return new NameImpl(Constants.SOAP11_FAULT_CODE_SERVER);
      }
      else
      {
         return new NameImpl(SOAPConstants.SOAP_RECEIVER_FAULT);
      }
   }
View Full Code Here

         // Get the corresponding wrapper type
         if (JavaUtils.isPrimitive(value.getClass()))
            value = JavaUtils.getWrapperValueArray(value);

         String nodeName = new NameImpl(compXmlName).getQualifiedName();

         buffer = new StringBuilder("<" + nodeName + " xmlns:" + Constants.PREFIX_SOAP11_ENC + "='" + Constants.URI_SOAP11_ENC + "' ");

         if (!(value instanceof Object[]))
            throw new WSException("Unsupported array type: " + javaType);
View Full Code Here

      soapHeader.addNamespaceDeclaration(ADDR.getNamespacePrefix(), ADDR.getNamespaceURI());
           
      // Write wsa:To
      if (getTo() != null)
      {
        SOAPElement element = soapHeader.addChildElement(new NameImpl(ADDR.getToQName()));
        element.addTextNode(getTo().getURI().toString());
      }

      // Write wsa:From
      if (getFrom() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getFrom();
        epr.setRootQName(ADDR.getFromQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      // Write wsa:ReplyTo
      if (getReplyTo() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getReplyTo();
        epr.setRootQName(ADDR.getReplyToQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      // Write wsa:FaultTo
      if (getFaultTo() != null)
      {
        EndpointReferenceImpl epr = (EndpointReferenceImpl)getFaultTo();
        epr.setRootQName(ADDR.getFaultToQName());
        SOAPElement soapElement = factory.createElement(epr.toElement());
        soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
        soapHeader.addChildElement(soapElement);
      }

      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(), getPrefixedName(rel.getType()));
          }
          wsaRelatesTo.addTextNode(rel.getID().toString());
        }
      }

      // Write wsa:ReferenceParameters
      ReferenceParameters refParams = getReferenceParameters();
      if (refParams.getElements().size() > 0 || refParams.getAttributes().size() > 0)
      {
        SOAPElement wsaRefParams = soapHeader.addChildElement(new NameImpl(ADDR.getReferenceParametersQName()));
        appendAttributes(wsaRefParams, refParams.getAttributes());
        appendElements(wsaRefParams, refParams.getElements());
      }

      appendElements(soapHeader, getElements());
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)
    {
      // add soap:mustUnderstand=1
View Full Code Here

       * 1. SOAPFaultException.getFault().getFaultCodeAsQName()
       * X. env:Server (Subcode omitted for SOAP 1.2) */
      Name faultCode = sourceFault.getFaultCodeAsName();
      if (faultCode != null)
      {
         faultCode = new NameImpl(faultCode.getLocalName(), "codeNS", faultCode.getURI());
      }
      else
      {
         faultCode = getFallbackFaultCode();
      }
View Full Code Here

      }

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SerializationContext serContext = msgContext.getSerializationContext();

      NameImpl faultCode = (NameImpl)soapFault.getFaultCodeAsName();
      if (faultCode.getURI().length() > 0)
         serContext.getNamespaceRegistry().registerQName(faultCode.toQName());

      OperationMetaData opMetaData = msgContext.getOperationMetaData();
      Class<? extends Exception> exClass = ex.getClass();
      if (opMetaData != null && opMetaData.getFaultMetaData(exClass) != null)
      {
View Full Code Here

   private static Name getFallbackFaultCode()
   {
      /* faultcode
       * X. SOAPFaultException.getFault().getFaultCodeAsQName()
       * 2. env:Server (Subcode omitted for SOAP 1.2) */
      return new NameImpl(Constants.SOAP11_FAULT_CODE_SERVER);
   }
View Full Code Here

TOP

Related Classes of org.jboss.ws.core.soap.NameImpl

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.