* @throws AxisFault
*/
public static void sendMsg() throws AxisFault {
search.trim();
prevSearch = search;
Call call = new Call();
URL url = null;
try {
url = new URL("http", "soap.amazon.com", "/onca/soap?Service=AlexaWebInfoService");
/** Uncomment the folowing to use TCP Monitor, and comment the above */
//url = new URL("http", "localhost",8080, "/onca/soap?Service=AlexaWebInfoService");
} catch (MalformedURLException e) {
e.printStackTrace();
}
call.setTo(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
MessageContext requestContext = ClientUtil.getMessageContext();
try {
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
System.out.println("Sending the Async message ....");
OMOutput omOutput = new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter
(System.out));
requestContext.getEnvelope().serialize(omOutput);
omOutput.flush();
System.out.println();
QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
OperationDescription opdesc = new OperationDescription(opName);
call.invokeNonBlocking(opdesc, requestContext, new ClientCallbackHandler());
} catch (AxisFault e1) {
e1.printStackTrace();
} catch (XMLStreamException e) {
e.printStackTrace();
}