{
try
{
if (this.validator.isOneWayResponse(entryContext))
{
throw new AssertionNotApplicableException();
}
// Parse message
Document doc = entryContext.getMessageEntryDocument();
// Parse request message
Document docRequest = entryContext.getRequestDocument();
if (doc == null || docRequest == null)
throw new AssertionNotApplicableException();
// Check if there is a soap body element
if (!this.validator.containsSoapBodyWithChild(doc))
{
throw new AssertionNotApplicableException();
}
if (this.validator.isFault(doc))
{
throw new AssertionFailException(
AssertionResult.RESULT_NOT_APPLICABLE);
}
// get SOAPAction
String headers = entryContext.getRequest().getHTTPHeaders();
String action = null;
if (headers != null)
action = (String) HTTPUtils.getHttpHeaderTokens(headers, ":").get("SOAPAction".toUpperCase());
Binding binding = validator.analyzerContext.getCandidateInfo().getBindings()[0];
TypesRegistry registry =
new TypesRegistry(
this.validator.getWSDLDocument().getDefinitions(),
validator);
OperationSignature.OperationMatch match =
OperationSignature.matchOperation(
docRequest,
action,
binding,
registry);
if (match == null)
{
throw new AssertionNotApplicableException();
}
BindingOperation bindingOperation = match.getOperation();
// If this is a one-way operation and we are processing a response, then set result to notApplicable
if (bindingOperation
.getOperation()
.getStyle()
.equals(OperationType.ONE_WAY)
&& (entryContext
.getMessageEntry()
.getType()
.equals(MessageEntry.TYPE_RESPONSE)))
{
throw new AssertionNotApplicableException();
}
// find body
NodeList soapBodyList =
doc.getElementsByTagNameNS(