Package org.apache.axis2.addressing.miheaders

Examples of org.apache.axis2.addressing.miheaders.RelatesTo


        mIHeaders.setReplyTo(epr);

        mIHeaders.setMessageId("123456-7890");
        mIHeaders.setAction("http://www.actions.org/action");

        RelatesTo relatesTo = new RelatesTo("http://www.relatesTo.org/service/", "TestRelation");
        mIHeaders.setRelatesTo(relatesTo);

        msgCtxt = new MessageContext(null);
        msgCtxt.setMessageInformationHeaders(mIHeaders);
        msgCtxt.setEnvelope(OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
View Full Code Here


            new MessageInformationHeadersCollection();
        messageInformationHeaders.setTo(oldMessageInfoHeaders.getReplyTo());
        messageInformationHeaders.setFaultTo(oldMessageInfoHeaders.getFaultTo());
        messageInformationHeaders.setFrom(oldMessageInfoHeaders.getTo());
        messageInformationHeaders.setRelatesTo(
            new RelatesTo(
                oldMessageInfoHeaders.getMessageId(),
                AddressingConstants.Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE));
        newmsgCtx.setMessageInformationHeaders(messageInformationHeaders);               
        newmsgCtx.setOperationContext(messgeCtx.getOperationContext());
        newmsgCtx.setServiceContext(messgeCtx.getServiceContext());
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.axis2.engine.MessageReceiver#recieve(org.apache.axis2.context.MessageContext)
     */
    public void recieve(MessageContext messgeCtx) throws AxisFault {
        //TODO find the related message ID and call the callback
        RelatesTo relatesTO = messgeCtx.getMessageInformationHeaders().getRelatesTo();

        String messageID = relatesTO.getValue();
        Callback callback = (Callback) callbackstore.get(messageID);
        AsyncResult result = new AsyncResult(messgeCtx);
        if (callback != null) {
            callback.onComplete(result);
            callback.setComplete(true);
View Full Code Here

        String messageID = messageInformationHeaders.getMessageId();
        if (messageID != null) {//optional
            processStringInfo(messageID, WSA_MESSAGE_ID, soapHeader);
        }

        RelatesTo relatesTo = messageInformationHeaders.getRelatesTo();
        OMElement relatesToHeader = null;

        if (relatesTo != null) {
            relatesToHeader = processStringInfo(relatesTo.getValue(), WSA_RELATES_TO, soapHeader);
        }

        if (relatesToHeader != null)
            if ("".equals(relatesTo.getRelationshipType())) {
                relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                        Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE,
                        addressingNamespaceObject);
            } else {
                relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                        relatesTo.getRelationshipType(),
                        addressingNamespaceObject);
            }
    }
View Full Code Here

                messageInformationHeadersCollection.setAction(soapHeaderBlock.getText());
            } else if (AddressingConstants.WSA_RELATES_TO.equals(soapHeaderBlock.getLocalName())) {
                String address = soapHeaderBlock.getText();
                OMAttribute relationshipType = soapHeaderBlock.getFirstAttribute(new QName(AddressingConstants.WSA_RELATES_TO_RELATIONSHIP_TYPE));
                String relationshipTypeDefaultValue = Submission.WSA_NAMESPACE.equals(addressingNamespace) ? Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE : Final.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE;
                RelatesTo relatesTo = new RelatesTo(address, relationshipType == null ? relationshipTypeDefaultValue : relationshipType.getValue());
                messageInformationHeadersCollection.setRelatesTo(relatesTo);
            }
        }

        return messageInformationHeadersCollection;
View Full Code Here

      OperationDescription axisOperation = new OperationDescription(new QName("test"));
      OperationContext operationContext1 = axisOperation.findOperationContext(messageContext1, sessionContext);
     
      MessageContext messageContext2 = this.getBasicMessageContext();
      messageContext2.setMessageID(new Long(System.currentTimeMillis()).toString());
      messageContext2.getMessageInformationHeaders().setRelatesTo(new RelatesTo(messageContext1.getMessageID()));
      OperationContext operationContext2 = axisOperation.findOperationContext(messageContext2, sessionContext);
      assertEquals(operationContext1, operationContext2);
    }
View Full Code Here

                        new QName(AddressingConstants.WSA_RELATES_TO_RELATIONSHIP_TYPE));
                String relationshipTypeDefaultValue =
                    Submission.WSA_NAMESPACE.equals(addressingNamespace)
                        ? Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE
                        : Final.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE;
                RelatesTo relatesTo =
                    new RelatesTo(
                        address,
                        relationshipType == null
                            ? relationshipTypeDefaultValue
                            : relationshipType.getValue());
                messageInformationHeaders.setRelatesTo(relatesTo);
View Full Code Here

        MessageContext messageContext2 = this.getBasicMessageContext();
        messageContext2.setMessageID(
                new Long(System.currentTimeMillis()).toString());
        messageContext2.getMessageInformationHeaders().setRelatesTo(
                new RelatesTo(messageContext1.getMessageID()));
        OperationContext operationContext2 = axisOperation.findOperationContext(
                messageContext2, sessionContext);
        assertEquals(operationContext1, operationContext2);
    }
View Full Code Here

        String messageID = messageInformationHeaders.getMessageId();
        if (messageID != null) {//optional
            processStringInfo(messageID, WSA_MESSAGE_ID, soapHeader);
        }

        RelatesTo relatesTo = messageInformationHeaders.getRelatesTo();
        OMElement relatesToHeader = null;

        if (relatesTo != null) {
            relatesToHeader =
                    processStringInfo(relatesTo.getValue(),
                            WSA_RELATES_TO,
                            soapHeader);
        }

        if (relatesToHeader != null)
            if ("".equals(relatesTo.getRelationshipType())) {
                relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                        Submission.WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE,
                        addressingNamespaceObject);
            } else {
                relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                        relatesTo.getRelationshipType(),
                        addressingNamespaceObject);
            }
    }
View Full Code Here

    public void addCallback(String MsgID, Callback callback) {
        callbackstore.put(MsgID, callback);
    }

    public void receive(MessageContext messgeCtx) throws AxisFault {
        RelatesTo relatesTO = messgeCtx.getMessageInformationHeaders()
                .getRelatesTo();

        String messageID = relatesTO.getValue();
        Callback callback = (Callback) callbackstore.get(messageID);
        AsyncResult result = new AsyncResult(messgeCtx);
        if (callback != null) {
            callback.onComplete(result);
            callback.setComplete(true);
View Full Code Here

TOP

Related Classes of org.apache.axis2.addressing.miheaders.RelatesTo

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.