use of javax.xml.soap.SOAPEnvelope 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.SOAPEnvelope 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.SOAPEnvelope 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.SOAPEnvelope 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.SOAPEnvelope in project jbossws-cxf by jbossws.
the class JBWS1815TestCase method testProviderMessage.
@Test
@RunAsClient
public void testProviderMessage() throws Exception {
SOAPMessage reqMsg = getRequestMessage();
URL epURL = new URL(baseURL + "/jaxws-jbws1815/ProviderImpl");
SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
SOAPMessage resMsg = con.call(reqMsg, epURL);
SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
Detail detail = resEnv.getBody().getFault().getDetail();
assertNotNull(detail);
SOAPElement exception = (SOAPElement) detail.getDetailEntries().next();
assertNotNull(exception);
assertEquals("MyWSException", exception.getElementQName().getLocalPart());
assertEquals("http://www.my-company.it/ws/my-test", exception.getElementQName().getNamespaceURI());
SOAPElement message = (SOAPElement) exception.getChildElements().next();
assertNotNull(message);
assertEquals("message", message.getNodeName());
assertEquals("This is a faked error", message.getValue());
}
Aggregations