Package org.jboss.ws.core.soap

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


      /* 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


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

      {
         SOAPMessage soapMessage = ((SOAPMessageContext)messageContext).getMessage();
         SOAPBody soapBody = soapMessage.getSOAPBody();

         SOAPElement bodyElement = (SOAPElement)soapBody.getChildElements().next();
         SOAPElement wrapper = (SOAPElement)bodyElement.getChildElements(new NameImpl(parentName)).next();
         SOAPElement xopElement = (SOAPElement)wrapper.getChildElements(new NameImpl("xopContent")).next();
         String base64Value = xopElement.getValue();
         log.debug("base64Value: " + base64Value);
         messageContext.setProperty("xop.inline.value", base64Value);
      }
      catch (Exception e)
View Full Code Here

      {
         SOAPMessage soapMessage = ((SOAPMessageContext)messageContext).getMessage();
         SOAPBody soapBody = soapMessage.getSOAPBody();

         SOAPElement bodyElement = (SOAPElement)soapBody.getChildElements().next();
         SOAPElement xopElement = (SOAPElement)bodyElement.getChildElements(new NameImpl("xopContent")).next();
         String base64Value = xopElement.getValue();
         log.debug("base64Value: " + base64Value);
         messageContext.setProperty("xop.inline.value", base64Value);
      }
      catch (Exception e)
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(), getQualifiedName(rel.getType()));
          }
          wsaRelatesTo.addTextNode(rel.getID().toString());
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

            }

            if (serialize)
            {
               QName opQName = opMetaData.getQName();
               Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));

               if (log.isDebugEnabled())
                  log.debug("Create RPC body element: " + opName);

               soapBodyElement = new SOAPBodyElementRpc(opName);
               soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);

               // Add soap encodingStyle
               if (opMetaData.getUse() == Use.ENCODED)
               {
                  String envURI = soapEnvelope.getNamespaceURI();
                  String envPrefix = soapEnvelope.getPrefix();
                  soapBodyElement.setAttributeNS(envURI, envPrefix + ":encodingStyle", Constants.URI_SOAP11_ENC);
               }
            }
         }

         for (ParameterMetaData paramMetaData : opMetaData.getInputParameters())
         {
            QName xmlName = paramMetaData.getXmlName();
            Object value = epInv.getRequestParamValue(xmlName);

            if (paramMetaData.isSwA())
            {
               // NOTE: swa:ref is handled by the AttachmentMarshaller callback
               CIDGenerator cidGenerator = reqMessage.getCidGenerator();
               AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
               reqMessage.addAttachmentPart(part);

               // Add the attachment to the standard property
               if (value instanceof DataHandler && msgContext instanceof MessageContextJAXWS)
               {
                  DataHandler dataHandler = (DataHandler)value;
                  Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
                  attachments.put(dataHandler.getContentType(), dataHandler);
               }
            }
            else
            {
               SOAPElement soapElement = paramMetaData.isInHeader() ? (SOAPElement)soapHeader : soapBodyElement;
               addParameterToMessage(paramMetaData, value, soapElement);
            }
         }

         // Add unbound headers
         if (unboundHeaders != null)
         {
            Iterator it = unboundHeaders.values().iterator();
            while (it.hasNext())
            {
               UnboundHeader unboundHeader = (UnboundHeader)it.next();
               if (unboundHeader.getMode() != ParameterMode.OUT)
               {
                  QName xmlName = unboundHeader.getXmlName();
                  Object value = unboundHeader.getHeaderValue();

                  xmlName = namespaceRegistry.registerQName(xmlName);
                  Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());

                  log.debug("Add unboundHeader element: " + soapName);
                  SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
                  contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
View Full Code Here

         {
            QName opQName = opMetaData.getResponseName();

            if (false == RMHelper.isRMOperation(opQName)) // RM hack
            {
               Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
               soapBodyElement = new SOAPBodyElementRpc(opName);
               soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);

               // Add soap encodingStyle
               if (opMetaData.getUse() == Use.ENCODED)
View Full Code Here

         CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
         NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
         xmlName = namespaceRegistry.registerQName(xmlName);
      }

      Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());

      SOAPContentElement contentElement;
      if (soapElement instanceof SOAPHeader)
      {
         contentElement = new SOAPHeaderElementImpl(soapName);
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.