String input = "IBM";
Map properties = new HashMap();
properties.put(SoapConstants.SOAP_ACTION_PROPERTY, "${methodNamespace}${method}");
properties.put(SoapConstants.METHOD_NAMESPACE_PROPERTY, "http://www.webserviceX.NET/");
String url = "wsdl:http://www.webservicex.net/stockquote.asmx?WSDL&method=GetQuote";
MuleMessage result = null;
String resultPayload = StringUtils.EMPTY;
try
{
MuleClient client = new MuleClient(muleContext);
result = client.send(url, input, properties);
resultPayload = (result != null ? result.getPayloadAsString() : StringUtils.EMPTY);
}
catch (MuleException e)
{
fail(ExceptionUtils.getStackTrace(e));
}
if (result != null)
{
logger.debug("The quote for " + input + " is: " + result.getPayload());
}
assertNotNull(result);
assertTrue(resultPayload.startsWith("<StockQuotes><Stock><Symbol>IBM</Symbol>"));
}