Search in sources :

Example 1 with Message

use of com.sun.xml.ws.api.message.Message in project Payara by payara.

the class SOAPAuthParam method putSOAPInPacket.

private boolean putSOAPInPacket(SOAPMessage m, Object p) {
    if (m == null) {
        ((Packet) p).setMessage(null);
    } else {
        Message msg = Messages.create(m);
        ((Packet) p).setMessage(msg);
    }
    return true;
}
Also used : Packet(com.sun.xml.ws.api.message.Packet) Message(com.sun.xml.ws.api.message.Message)

Example 2 with Message

use of com.sun.xml.ws.api.message.Message in project Payara by payara.

the class PipeHelper method isTwoWay.

public boolean isTwoWay(boolean twoWayIsDefault, Packet request) {
    boolean twoWay = twoWayIsDefault;
    Message m = request.getMessage();
    if (m != null) {
        WSDLPort wsdlModel = (WSDLPort) getProperty(PipeConstants.WSDL_MODEL);
        if (wsdlModel != null) {
            twoWay = (m.isOneWay(wsdlModel) ? false : true);
        }
    }
    return twoWay;
}
Also used : Message(com.sun.xml.ws.api.message.Message) WSDLPort(com.sun.xml.ws.api.model.wsdl.WSDLPort)

Example 3 with Message

use of com.sun.xml.ws.api.message.Message in project Payara by payara.

the class ClientSecurityTube method processResponse.

@Override
public NextAction processResponse(Packet response) {
    try {
        // check for response
        Message m = response.getMessage();
        if (m != null) {
            if (cAC != null) {
                AuthStatus status;
                info.setResponsePacket(response);
                try {
                    status = cAC.validateResponse(info, clientSubject, null);
                } catch (Exception e) {
                    return doThrow(new WebServiceException(localStrings.getLocalString("enterprise.webservice.cantValidateResponse", "Cannot validate response for {0}", new Object[] { helper.getModelName() }), e));
                }
                if (status == AuthStatus.SEND_CONTINUE) {
                    // response = processSecureRequest(info, cAC, clientSubject);
                    return doInvoke(super.next, info.getRequestPacket());
                } else {
                    response = info.getResponsePacket();
                }
            }
        }
        return doReturnWith(response);
    } catch (Throwable t) {
        if (!(t instanceof WebServiceException)) {
            t = new WebServiceException(t);
        }
        return doThrow(t);
    }
}
Also used : Message(com.sun.xml.ws.api.message.Message) WebServiceException(javax.xml.ws.WebServiceException) AuthStatus(javax.security.auth.message.AuthStatus) WSSecureConversationException(com.sun.xml.ws.security.secconv.WSSecureConversationException) WebServiceException(javax.xml.ws.WebServiceException)

Example 4 with Message

use of com.sun.xml.ws.api.message.Message in project Payara by payara.

the class WebServicesDelegateImpl method getAuthContextID.

public String getAuthContextID(MessageInfo messageInfo) {
    // make this more efficient by operating on packet
    String rvalue = null;
    if (messageInfo instanceof PacketMessageInfo) {
        PacketMessageInfo pmi = (PacketMessageInfo) messageInfo;
        Packet p = (Packet) pmi.getRequestPacket();
        if (p != null) {
            Message m = p.getMessage();
            if (m != null) {
                WSDLPort port = (WSDLPort) messageInfo.getMap().get("WSDL_MODEL");
                if (port != null) {
                    WSDLBoundOperation w = m.getOperation(port);
                    if (w != null) {
                        QName n = w.getName();
                        if (n != null) {
                            rvalue = n.getLocalPart();
                        }
                    }
                }
            }
        }
        return rvalue;
    } else {
        // make this more efficient by operating on packet
        return getOpName((SOAPMessage) messageInfo.getRequestMessage());
    }
}
Also used : Packet(com.sun.xml.ws.api.message.Packet) Message(com.sun.xml.ws.api.message.Message) SOAPMessage(javax.xml.soap.SOAPMessage) WSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation) QName(javax.xml.namespace.QName) PacketMessageInfo(com.sun.enterprise.security.jmac.provider.PacketMessageInfo) WSDLPort(com.sun.xml.ws.api.model.wsdl.WSDLPort)

Example 5 with Message

use of com.sun.xml.ws.api.message.Message in project Payara by payara.

the class ClientSecurityPipe method processSecureRequest.

private Packet processSecureRequest(PacketMessageInfo info, ClientAuthContext cAC, Subject clientSubject) throws WebServiceException {
    // send the request
    Packet response = next.process(info.getRequestPacket());
    // check for response
    Message m = response.getMessage();
    if (m != null) {
        if (cAC != null) {
            AuthStatus status;
            info.setResponsePacket(response);
            try {
                status = cAC.validateResponse(info, clientSubject, null);
            } catch (Exception e) {
                throw new WebServiceException(localStrings.getLocalString("enterprise.webservice.cantValidateResponse", "Cannot validate response for {0}", new Object[] { helper.getModelName() }), e);
            }
            if (status == AuthStatus.SEND_CONTINUE) {
                response = processSecureRequest(info, cAC, clientSubject);
            } else {
                response = info.getResponsePacket();
            }
        }
    }
    return response;
}
Also used : Packet(com.sun.xml.ws.api.message.Packet) Message(com.sun.xml.ws.api.message.Message) WebServiceException(javax.xml.ws.WebServiceException) AuthStatus(javax.security.auth.message.AuthStatus) WSSecureConversationException(com.sun.xml.ws.security.secconv.WSSecureConversationException) WebServiceException(javax.xml.ws.WebServiceException)

Aggregations

Message (com.sun.xml.ws.api.message.Message)6 Packet (com.sun.xml.ws.api.message.Packet)3 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)2 WSSecureConversationException (com.sun.xml.ws.security.secconv.WSSecureConversationException)2 AuthStatus (javax.security.auth.message.AuthStatus)2 SOAPMessage (javax.xml.soap.SOAPMessage)2 WebServiceException (javax.xml.ws.WebServiceException)2 PacketMessageInfo (com.sun.enterprise.security.jmac.provider.PacketMessageInfo)1 WSDLBoundOperation (com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation)1 QName (javax.xml.namespace.QName)1