XmlObject[] childElems = XmlBeanUtils.getChildElements( body.getXmlObject() );
Method serviceMethod = null;
if ( childElems.length > 1 )
{
throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
"SOAP request Body contains more than one body element - this service requires that all SOAP requests contain at most one body element." );
}
// TODO: refactor below if-else - too much code duplication
if ( childElems.length == 0 ) // empty Body
{
if ( methodNameFromAction != null )
{
// try to find a method based on the wsa:Action...
serviceMethod = getServiceMethod( service, methodNameFromAction );
LOG.debug( MSG.getMessage( Keys.INVOKE_RESOURCE_METHOD,
serviceMethod.getName() ) );
XmlObject responseXBean = invokeServiceMethod( serviceMethod, service, null, serviceClass );
if ( responseXBean != null )
{
responseBodyElems.add( responseXBean );
}
}
else // empty Body and unmapped wsa:Action
{
throw new FaultException( Soap1_1Constants.FAULT_CLIENT,
"No SOAP Body elements were defined, and the value of the WS-Addressing Action header was not recognized - unable to dispatch request." );
}
}
else // childElems.length == 1
{