try
{
// We parse a new uri based on the listening host and port with the
// request parameters appended
// Using the soap prefix ensures that we use a soap endpoint builder
EndpointURI endpointUri = new MuleEndpointURI(context.getEndpointURI().toString(), context.getMuleContext());
//We need to re-parse the URI here because we are only give the listening endpoint, not the actual
//request endpoint. The request endpoint needs to have the query parameters from the client
//There is no need to do this for Servlet because it does things differently
if (!"true".equalsIgnoreCase((String) context.getMessage().getInvocationProperty("servlet.endpoint")))
{
String uri = SoapConstants.SOAP_ENDPOINT_PREFIX + context.getEndpointURI().getScheme()
+ "://" + context.getEndpointURI().getHost() + ":"
+ context.getEndpointURI().getPort();
uri += context.getMessage().getInboundProperty(HttpConnector.HTTP_REQUEST_PROPERTY, StringUtils.EMPTY);
endpointUri = new MuleEndpointURI(uri, context.getMuleContext());
}
endpointUri.initialise();
AxisEngine engine = getAxis();
String pathInfo = endpointUri.getPath();
boolean wsdlRequested = false;
boolean listRequested = false;
if (endpointUri.getAddress().endsWith(".jws"))
{
throw new AxisFault("Jws not supported by the Mule Axis service");
}
String queryString = endpointUri.getQuery();
if (queryString != null)
{
if (queryString.equalsIgnoreCase(SoapConstants.WSDL_PROPERTY))
{
wsdlRequested = true;
}
else
{
if (queryString.equalsIgnoreCase(SoapConstants.LIST_PROPERTY))
{
listRequested = true;
}
}
}
boolean hasNoPath = (StringUtils.isEmpty(pathInfo) || pathInfo.equals("/"));
if (!wsdlRequested && !listRequested && hasNoPath)
{
reportAvailableServices(context, response);
}
else
{
MessageContext msgContext = new MessageContext(engine);
populateMessageContext(msgContext, context, endpointUri);
msgContext.setProperty("transport.url", endpointUri.toString());
if (wsdlRequested)
{
processWsdlRequest(msgContext, response);
}
else if (listRequested)