use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class SOAP11ClientHandler method handleInbound.
@Override
public boolean handleInbound(SOAPMessageContext msgContext) {
log.info("handleInbound");
try {
SOAPEnvelope soapEnvelope = msgContext.getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(nsURI)) {
return false;
}
} catch (SOAPException se) {
throw new WebServiceException(se);
}
ContentType contentType = getContentType(msgContext);
if (contentType != null) {
log.info("contentType=" + contentType);
String startInfo = contentType.getParameter("start-info");
if (!startInfo.equals(SOAPConstants.SOAP_1_1_CONTENT_TYPE)) {
return false;
}
} else {
return false;
}
return true;
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class SOAP11ServerHandler method handleInbound.
@Override
public boolean handleInbound(SOAPMessageContext msgContext) {
log.info("handleInbound");
ContentType contentType = getContentType(msgContext);
if (contentType != null) {
log.info("contentType=" + contentType);
String startInfo = contentType.getParameter("start-info");
if (!startInfo.equals(SOAPConstants.SOAP_1_1_CONTENT_TYPE)) {
return false;
}
} else {
return false;
}
try {
SOAPEnvelope soapEnvelope = ((SOAPMessageContext) msgContext).getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(nsURI)) {
return false;
}
} catch (SOAPException se) {
throw new WebServiceException(se);
}
return true;
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class SOAP12ClientHandler method handleInbound.
@Override
public boolean handleInbound(SOAPMessageContext msgContext) {
log.info("handleInbound");
try {
SOAPEnvelope soapEnvelope = msgContext.getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(nsURI)) {
return false;
}
} catch (SOAPException se) {
throw new WebServiceException(se);
}
ContentType contentType = getContentType(msgContext);
if (contentType != null) {
log.info("contentType=" + contentType);
String startInfo = contentType.getParameter("start-info");
if (!startInfo.equals(SOAPConstants.SOAP_1_2_CONTENT_TYPE)) {
return false;
}
} else {
return false;
}
return true;
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class ClientHandler method handleInbound.
public boolean handleInbound(SOAPMessageContext msgContext) {
log.info("handleInbound");
try {
SOAPEnvelope soapEnvelope = (SOAPEnvelope) msgContext.getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(nsURI)) {
throw new RuntimeException("Wrong NS uri: " + nsURI);
}
} catch (SOAPException se) {
throw new WebServiceException(se);
}
ContentType contentType = getContentType(msgContext);
if (contentType != null) {
log.info("contentType=" + contentType);
String startInfo = contentType.getParameter("start-info");
if (!checkMtom) {
if (startInfo != null) {
throw new RuntimeException("Unexpected multipart/related message!");
} else {
return true;
}
}
if (!startInfo.equals(SOAPConstants.SOAP_1_1_CONTENT_TYPE)) {
throw new RuntimeException("Wrong start info: " + startInfo);
}
} else {
throw new RuntimeException("Missing content type");
}
return true;
}
use of javax.xml.soap.SOAPException in project jbossws-cxf by jbossws.
the class ProtocolHandler method appendHandlerName.
private boolean appendHandlerName(MessageContext msgContext) {
try {
SOAPMessage soapMessage = ((SOAPMessageContext) msgContext).getMessage();
SOAPElement soapElement = (SOAPElement) soapMessage.getSOAPBody().getChildElements().next();
soapElement = (SOAPElement) soapElement.getChildElements().next();
String value = soapElement.getValue();
String handlerName = getHandlerName();
soapElement.setValue(value + ":" + handlerName);
return true;
} catch (SOAPException ex) {
throw new WebServiceException(ex);
}
}
Aggregations