Package com.arjuna.webservices.wsaddr2005.handlers

Examples of com.arjuna.webservices.wsaddr2005.handlers.ActionHandler


    public SoapBody invoke(final InterceptorChain chain, final SoapService soapService,
        final SoapDetails soapDetails, final MessageContext context, final MessageContext responseContext,
        final String action, final XMLStreamReader in)
        throws XMLStreamException, SoapFault
    {
        final AddressingContext addressingContext = AddressingContext.getContext(context) ;
        final EndpointReferenceType replyTo = addressingContext.getReplyTo() ;
        if (replyTo != null)
        {
            if (!replyTo.isValid())
            {
                if (WSCLogger.arjLoggerI18N.isDebugEnabled())
                {
                    WSCLogger.arjLoggerI18N.debug("com.arjuna.webservices.wsaddr2005.handlers.AddressingInterceptorHandler_1") ;
                }
            }
            else if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(replyTo.getAddress().getValue()))
            {
                final EndpointReferenceType faultTo = addressingContext.getFaultTo() ;
                if (faultTo != null)
                {
                    if (!faultTo.isValid())
                    {
                        if (WSCLogger.arjLoggerI18N.isDebugEnabled())
View Full Code Here


    private SoapBody processInvocation(final InterceptorChain chain, final SoapService soapService,
            final SoapDetails soapDetails, final MessageContext context, final MessageContext responseContext,
            final String action, final XMLStreamReader in)
            throws SoapFault
    {
        final AddressingContext addressingContext = AddressingContext.getContext(context) ;
        try
        {
            final SoapBody response = invokeNext(chain, soapService, soapDetails, context, responseContext, action, in) ;
            if (response != null)
            {
                final AddressingContext responseAddressingContext = AddressingContext.createResponseContext(addressingContext, MessageId.getMessageId()) ;
                final String soapBodyAction = response.getAction() ;
                if (soapBodyAction != null)
                {
                    responseAddressingContext.setAction(new AttributedURIType(soapBodyAction)) ;
                }
                AddressingContext.setContext(responseContext, responseAddressingContext) ;
               
                final AttributedURIType to = responseAddressingContext.getTo() ;
                if (to != null)
                {
                    if (!to.isValid())
                    {
                        if (WSCLogger.arjLoggerI18N.isDebugEnabled())
                        {
                            WSCLogger.arjLoggerI18N.debug("com.arjuna.webservices.wsaddr2005.handlers.AddressingInterceptorHandler_4") ;
                        }
                    }
                    else
                    {
                        final String toURI = to.getValue() ;
                        if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(toURI))
                        {
                            if (!AddressingConstants.WSA_ADDRESS_NONE.equals(toURI))
                            {
                                try
                                {
                                    WSAddr2005Client.sendOneWay(response, responseAddressingContext, soapDetails, soapService) ;
                                }
                                catch (final IOException ioe)
                                {
                                    // Something happened while sending an async response so null out the replyTo and throw a fault.
                                    addressingContext.setReplyTo(null) ;
                                   
                                    final AnyElement detail = new AnyElement() ;
                                    detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_IRI, responseAddressingContext.getTo())) ;
                                    final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
                                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_DESTINATION_UNREACHABLE,
                                        "Destination unreachable", detailElement) ;
                                    soapFault.setAction(AddressingConstants.WSA_ACTION_FAULT) ;
                                    throw soapFault ;
                                }
                            }
                            return null ;
                        }
                    }
                }
            }
           
            return response ;
        }
        catch (final SoapFault soapFault)
        {
            final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
           
            final String soapFaultAction = soapFault.getAction() ;
            final String faultAction = (soapFaultAction != null ? soapFaultAction : AddressingConstants.WSA_ACTION_SOAP_FAULT) ;
           
            faultAddressingContext.setAction(new AttributedURIType(faultAction)) ;
           
            final AttributedURIType to = faultAddressingContext.getTo() ;
            if (to != null)
            {
                if (!to.isValid())
                {
                    if (WSCLogger.arjLoggerI18N.isDebugEnabled())
                    {
                        WSCLogger.arjLoggerI18N.debug("com.arjuna.webservices.wsaddr2005.handlers.AddressingInterceptorHandler_5") ;
                    }
                }
                else
                {
                    final String toURI = to.getValue() ;
                    if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(toURI))
                    {
                        if (!AddressingConstants.WSA_ADDRESS_NONE.equals(toURI))
                        {
                            try
                            {
                                WSAddr2005Client.sendSoapFault(soapFault, faultAddressingContext,
                                        soapDetails, soapService) ;
                            }
                            catch (final IOException ioe)
                            {
                                throw new SoapFault10(ioe) ;
                            }
                        }
                        return null ;
                    }
                }
            }
           
            if (soapFault.isHeaderFault())
            {
                faultAddressingContext.updateSoapFaultHeaders(soapFault) ;
            }
            else
            {
                AddressingContext.setContext(responseContext, faultAddressingContext) ;
            }
View Full Code Here

     */
    public void writeContent(final XMLStreamWriter out, final QName headerElementName,
        final MessageContext context, final SoapDetails soapDetails)
        throws XMLStreamException
    {
        final AddressingContext addressingContext = AddressingContext.getContext(context) ;
        if (addressingContext != null)
        {
            addressingContext.writeContent(out) ;
        }
    }
View Full Code Here

    public SoapBody invoke(final InterceptorChain chain, final SoapService soapService,
        final SoapDetails soapDetails, final MessageContext context, final MessageContext responseContext,
        final String action, final XMLStreamReader in)
        throws XMLStreamException, SoapFault
    {
        final AddressingContext addressingContext = AddressingContext.getContext(context) ;
        final EndpointReferenceType replyTo = addressingContext.getReplyTo() ;
        if (replyTo != null)
        {
            if (!replyTo.isValid())
            {
                if (WSCLogger.arjLoggerI18N.isDebugEnabled())
                {
                    WSCLogger.arjLoggerI18N.debug("com.arjuna.webservices.wsaddr2005.handlers.AddressingInterceptorHandler_1") ;
                }
            }
            else if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(replyTo.getAddress().getValue()))
            {
                final EndpointReferenceType faultTo = addressingContext.getFaultTo() ;
                if (faultTo != null)
                {
                    if (!faultTo.isValid())
                    {
                        if (WSCLogger.arjLoggerI18N.isDebugEnabled())
View Full Code Here

    private SoapBody processInvocation(final InterceptorChain chain, final SoapService soapService,
            final SoapDetails soapDetails, final MessageContext context, final MessageContext responseContext,
            final String action, final XMLStreamReader in)
            throws SoapFault
    {
        final AddressingContext addressingContext = AddressingContext.getContext(context) ;
        try
        {
            final SoapBody response = invokeNext(chain, soapService, soapDetails, context, responseContext, action, in) ;
            if (response != null)
            {
                final AddressingContext responseAddressingContext = AddressingContext.createResponseContext(addressingContext, MessageId.getMessageId()) ;
                final String soapBodyAction = response.getAction() ;
                if (soapBodyAction != null)
                {
                    responseAddressingContext.setAction(new AttributedURIType(soapBodyAction)) ;
                }
                AddressingContext.setContext(responseContext, responseAddressingContext) ;
               
                final AttributedURIType to = responseAddressingContext.getTo() ;
                if (to != null)
                {
                    if (!to.isValid())
                    {
                        if (WSCLogger.arjLoggerI18N.isDebugEnabled())
                        {
                            WSCLogger.arjLoggerI18N.debug("com.arjuna.webservices.wsaddr2005.handlers.AddressingInterceptorHandler_4") ;
                        }
                    }
                    else
                    {
                        final String toURI = to.getValue() ;
                        if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(toURI))
                        {
                            if (!AddressingConstants.WSA_ADDRESS_NONE.equals(toURI))
                            {
                                try
                                {
                                    WSAddr2005Client.sendOneWay(response, responseAddressingContext, soapDetails, soapService) ;
                                }
                                catch (final IOException ioe)
                                {
                                    // Something happened while sending an async response so null out the replyTo and throw a fault.
                                    addressingContext.setReplyTo(null) ;
                                   
                                    final AnyElement detail = new AnyElement() ;
                                    detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_IRI, responseAddressingContext.getTo())) ;
                                    final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
                                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_DESTINATION_UNREACHABLE,
                                        "Destination unreachable", detailElement) ;
                                    soapFault.setAction(AddressingConstants.WSA_ACTION_FAULT) ;
                                    throw soapFault ;
                                }
                            }
                            return null ;
                        }
                    }
                }
            }
           
            return response ;
        }
        catch (final SoapFault soapFault)
        {
            final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
           
            final String soapFaultAction = soapFault.getAction() ;
            final String faultAction = (soapFaultAction != null ? soapFaultAction : AddressingConstants.WSA_ACTION_SOAP_FAULT) ;
           
            faultAddressingContext.setAction(new AttributedURIType(faultAction)) ;
           
            final AttributedURIType to = faultAddressingContext.getTo() ;
            if (to != null)
            {
                if (!to.isValid())
                {
                    if (WSCLogger.arjLoggerI18N.isDebugEnabled())
                    {
                        WSCLogger.arjLoggerI18N.debug("com.arjuna.webservices.wsaddr2005.handlers.AddressingInterceptorHandler_5") ;
                    }
                }
                else
                {
                    final String toURI = to.getValue() ;
                    if (!AddressingConstants.WSA_ADDRESS_ANONYMOUS.equals(toURI))
                    {
                        if (!AddressingConstants.WSA_ADDRESS_NONE.equals(toURI))
                        {
                            try
                            {
                                WSAddr2005Client.sendSoapFault(soapFault, faultAddressingContext,
                                        soapDetails, soapService) ;
                            }
                            catch (final IOException ioe)
                            {
                                throw new SoapFault(ioe) ;
                            }
                        }
                        return null ;
                    }
                }
            }
           
            if (soapFault.isHeaderFault())
            {
                faultAddressingContext.updateSoapFaultHeaders(soapFault) ;
            }
            else
            {
                AddressingContext.setContext(responseContext, faultAddressingContext) ;
            }
View Full Code Here

     */
    public void writeContent(final XMLStreamWriter out, final QName headerElementName,
        final MessageContext context, final SoapDetails soapDetails)
        throws XMLStreamException
    {
        final AddressingContext addressingContext = AddressingContext.getContext(context) ;
        if (addressingContext != null)
        {
            addressingContext.writeContent(out) ;
        }
    }
View Full Code Here

     * @return The SOAP fault.
     */
    protected SoapFault initialiseMissingActionSoapFault(final MessageContext context)
    {
        final AnyElement detail = new AnyElement() ;
        detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER_QNAME, new AttributedQNameType(AddressingConstants.WSA_ELEMENT_QNAME_ACTION))) ;
       
        final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
        final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_MESSAGING_ADDRESSING_HEADER_REQUIRED,
            "Missing Addressing Header", detailElement) ;
        soapFault.setAction(AddressingConstants.WSA_ACTION_FAULT) ;
View Full Code Here

    {
        final AnyElement problemHeader = new AnyElement() ;
        problemHeader.putAnyContent(new NamedElement(headerName, header)) ;

        final AnyElement detail = new AnyElement() ;
        detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER_QNAME, new AttributedQNameType(headerName))) ;
        detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER, problemHeader)) ;
        final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
        final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_INVALID_ADDRESSING_HEADER,
            "Duplicate Addressing Header", detailElement) ;
        soapFault.setSubSubcode(AddressingConstants.WSA_FAULT_CODE_QNAME_INVALID_CARDINALITY) ;
View Full Code Here

     * @return The SOAP fault.
     */
    protected SoapFault initialiseMissingActionSoapFault(final MessageContext context)
    {
        final AnyElement detail = new AnyElement() ;
        detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER_QNAME, new AttributedQNameType(AddressingConstants.WSA_ELEMENT_QNAME_ACTION))) ;
       
        final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
        final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_MESSAGING_ADDRESSING_HEADER_REQUIRED,
            "Missing Addressing Header", detailElement) ;
        soapFault.setAction(AddressingConstants.WSA_ACTION_FAULT) ;
View Full Code Here

    {
        final AnyElement problemHeader = new AnyElement() ;
        problemHeader.putAnyContent(new NamedElement(headerName, header)) ;

        final AnyElement detail = new AnyElement() ;
        detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER_QNAME, new AttributedQNameType(headerName))) ;
        detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER, problemHeader)) ;
        final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
        final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_INVALID_ADDRESSING_HEADER,
            "Duplicate Addressing Header", detailElement) ;
        soapFault.setSubSubcode(AddressingConstants.WSA_FAULT_CODE_QNAME_INVALID_CARDINALITY) ;
View Full Code Here

TOP

Related Classes of com.arjuna.webservices.wsaddr2005.handlers.ActionHandler

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.