AxisService axisServce = inMessage.getAxisService();
axisServce.addParameter(WSDL2FormGenerator.LAST_TOUCH_TIME,
Long.valueOf(System.currentTimeMillis()));
Map endpoints = axisServce.getEndpoints();
Set set = endpoints.keySet();
AxisEndpoint endpoint = null;
for (Iterator iterator = set.iterator(); iterator.hasNext();) {
String key = (String) iterator.next();
endpoint = (AxisEndpoint) endpoints.get(key);
String endpointURL = endpoint.getEndpointURL();
if (endpointURL.indexOf("http://") > -1) {
AxisBinding binding = endpoint.getBinding();
String wsoapVersion =
(String) binding.getProperty(WSDL2Constants.ATTR_WSOAP_VERSION);
String inSOAPNamespace = env.getNamespace().getNamespaceURI();
if (!inSOAPNamespace.equals(wsoapVersion)) {
continue;
}
break;
}
}
if (endpoint == null) {
String msg = ProxyMessageReceiver.class.getName() + " cannot find real endpoint";
log.error(msg);
throw new AxisFault(msg);
}
ConfigurationContext configCtx =
WSDL2FormServiceComponent.getConfigurationContextService().getClientConfigContext();
//Create ServiceClient with deafult config context.
ServiceClient client = new ServiceClient(configCtx, null);
OMElement element = env.getBody().getFirstElement();
if (element != null) {
element.detach();
}
Options options = new Options();
options.setTo(new EndpointReference(endpoint.getEndpointURL()));
options.setAction(inMessage.getWSAAction());
options.setSoapVersionURI(env.getNamespace().getNamespaceURI());
options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
options.setTimeOutInMilliSeconds(1000*60*10);
client.setOptions(options);