public void invoke() throws AxisFault {
if (log.isDebugEnabled()) {
log.debug("Enter: Call::invoke()");
}
Message reqMsg = null ;
SOAPEnvelope reqEnv = null ;
msgContext.reset();
msgContext.setResponseMessage(null);
msgContext.setProperty( MessageContext.CALL, this );
msgContext.setProperty( WSDL_SERVICE, service );
msgContext.setProperty( WSDL_PORT_NAME, getPortName() );
if ( isMsg )
msgContext.setProperty( MessageContext.IS_MSG, "true" );
if (username != null) {
msgContext.setUsername(username);
}
if (password != null) {
msgContext.setPassword(password);
}
msgContext.setMaintainSession(maintainSession);
msgContext.setOperation(operation);
operation.setStyle(getOperationStyle());
msgContext.setOperationStyle(getOperationStyle());
if (useSOAPAction) {
msgContext.setUseSOAPAction(true);
}
if (SOAPActionURI != null) {
msgContext.setSOAPActionURI(SOAPActionURI);
}
if (timeout != null) {
msgContext.setTimeout(timeout.intValue());
}
// Determine client target service
if (myService != null) {
// If we have a SOAPService kicking around, use that directly
msgContext.setService(myService);
} else {
if (portName != null) {
// No explicit service. If we have a target service name,
// try that.
msgContext.setTargetService(portName.getLocalPart());
} else {
// No direct config, so try the namespace of the first body.
reqMsg = msgContext.getRequestMessage();
reqEnv = reqMsg.getSOAPEnvelope();
// If we have headers to insert, do so now.
for (int i = 0 ; myHeaders != null && i < myHeaders.size() ; i++ )
reqEnv.addHeader((SOAPHeaderElement)myHeaders.get(i));