* @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();
}
Options options = new Options();
call.setClientOptions(options);
options.setTo(
new EndpointReference(url.toString()));
MessageContext requestContext = ClientUtil.getMessageContext();
try {
options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
options.setUseSeparateListener(false);
requestContext.getEnvelope().serializeAndConsume(
XMLOutputFactory.newInstance()
.createXMLStreamWriter
(System.out));
QName opName = new QName("urn:GoogleSearch", "doGoogleSearch");
AxisOperation opdesc = new OutInAxisOperation(opName);
call.invokeNonBlocking(opdesc,
requestContext,
new ClientCallbackHandler());
} catch (AxisFault e1) {
e1.printStackTrace();
} catch (XMLStreamException e) {