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;
}
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;
}
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);
}
}
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());
}
}
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;
}
Aggregations