use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class AuthorizationHandler method handleOutbound.
@Override
protected boolean handleOutbound(SOAPMessageContext msgContext) {
log.info("handleOutbound");
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPHeader soapHeader = soapMessage.getSOAPHeader();
SOAPBody soapBody = soapMessage.getSOAPBody();
SOAPFactory soapFactory = SOAPFactory.newInstance();
Name headerName = soapFactory.createName("AuthorizationHandlerOutbound", "ns1", "http://somens");
SOAPHeaderElement she = soapHeader.addHeaderElement(headerName);
she.setValue("true");
SOAPBodyElement soapBodyElement = (SOAPBodyElement) soapBody.getChildElements().next();
SOAPElement soapElement = (SOAPElement) soapBodyElement.getChildElements().next();
String value = soapElement.getValue();
soapElement.setValue(value + "|AuthOut");
} catch (SOAPException e) {
throw new WebServiceException(e);
}
return true;
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class PortHandler method appendHandlerName.
private boolean appendHandlerName(SOAPMessageContext msgContext, String direction) {
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPElement soapElement = getFirstChildElement(soapMessage.getSOAPBody());
soapElement = getFirstChildElement(soapElement);
String oldValue = soapElement.getValue();
String newValue = oldValue + ":" + direction + ":PortHandler";
soapElement.setValue(newValue);
log.debug("oldValue: " + oldValue);
log.debug("newValue: " + newValue);
return true;
} catch (SOAPException ex) {
throw new WebServiceException(ex);
}
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class ProtocolHandler method appendHandlerName.
private boolean appendHandlerName(SOAPMessageContext msgContext, String direction) {
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPElement soapElement = (SOAPElement) soapMessage.getSOAPBody().getChildElements().next();
soapElement = (SOAPElement) soapElement.getChildElements().next();
String oldValue = soapElement.getValue();
String newValue = oldValue + ":" + direction + ":ProtocolHandler";
soapElement.setValue(newValue);
log.debug("oldValue: " + oldValue);
log.debug("newValue: " + newValue);
return true;
} catch (SOAPException ex) {
throw new WebServiceException(ex);
}
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class LogHandler method handleOutbound.
@Override
protected boolean handleOutbound(SOAPMessageContext msgContext) {
log.info("handleOutbound");
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPBody soapBody = soapMessage.getSOAPBody();
SOAPBodyElement soapBodyElement = (SOAPBodyElement) soapBody.getChildElements().next();
SOAPElement soapElement = (SOAPElement) soapBodyElement.getChildElements().next();
String value = soapElement.getValue();
soapElement.setValue(value + "|LogOut");
} catch (SOAPException e) {
throw new WebServiceException(e);
}
return true;
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class LogHandler method handleInbound.
@Override
protected boolean handleInbound(SOAPMessageContext msgContext) {
log.info("handleInbound");
try {
SOAPMessage soapMessage = msgContext.getMessage();
SOAPBody soapBody = soapMessage.getSOAPBody();
SOAPBodyElement soapBodyElement = (SOAPBodyElement) soapBody.getChildElements().next();
SOAPElement soapElement = (SOAPElement) soapBodyElement.getChildElements().next();
String value = soapElement.getValue();
soapElement.setValue(value + "|LogIn");
} catch (SOAPException e) {
throw new WebServiceException(e);
}
return true;
}
Aggregations