QName contentQName = XmlUtils.getQName( contentElm.getDomNode() );
NodeList contentChildNodes = null;
for( int c = 0; c < operations.size(); c++ )
{
WsdlOperation wsdlOperation = operations.get( c );
String action = wsdlOperation.getAction();
// matches soapAction?
if( !requireSoapActionMatch
|| ( ( soapAction == null && wsdlOperation.getAction() == null ) || ( action != null && action
.equals( soapAction ) ) ) )
{
QName qname = wsdlOperation.getRequestBodyElementQName();
if( !contentQName.equals( qname ) )
continue;
SoapVersion ifaceSoapVersion = wsdlOperation.getInterface().getSoapVersion();
if( requireSoapVersionMatch && ifaceSoapVersion != soapVersion )
{
continue;
}
// check content
if( wsdlOperation.getStyle().equals( WsdlOperation.STYLE_DOCUMENT ) )
{
// check that all attachments match
BindingOperation bindingOperation = wsdlOperation.getBindingOperation();
Message message = bindingOperation.getOperation().getInput().getMessage();
List<Part> parts = message.getOrderedParts( null );
for( int x = 0; x < parts.size(); x++ )
{
// check for attachment part
if( WsdlUtils.isAttachmentInputPart( parts.get( x ), bindingOperation ) )
{
for( Attachment attachment : attachments )
{
if( attachment.getPart().equals( parts.get( x ).getName() ) )
{
parts.remove( x );
x-- ;
}
}
}
else
{
parts.remove( x );
x-- ;
}
}
// matches!
if( parts.isEmpty() )
{
return wsdlOperation;
}
}
else if( wsdlOperation.getStyle().equals( WsdlOperation.STYLE_RPC ) )
{
BindingOperation bindingOperation = wsdlOperation.getBindingOperation();
Message message = bindingOperation.getOperation().getInput().getMessage();
List<Part> parts = message.getOrderedParts( null );
if( contentChildNodes == null )
contentChildNodes = XmlUtils.getChildElements( ( Element )contentElm.getDomNode() );