aspose file tools*
The moose likes Web Services and the fly likes Invoking Live Search Web Service - via Axis Client -error AxisFault  connection abort Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Invoking Live Search Web Service - via Axis Client -error AxisFault  connection abort" Watch "Invoking Live Search Web Service - via Axis Client -error AxisFault  connection abort" New topic
Author

Invoking Live Search Web Service - via Axis Client -error AxisFault connection abort

James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
I am trying to invoke this web service:
http://soap.search.msn.com/webservices.asmx?wsdl
Using this i want to be able to do a search.

The error is get is:
org.apache.axis2.AxisFault: Software caused connection abort: recv failed

Either i am doing something wrong in the code i.e giving wrong service name or parameter etc. OR This is a Proxy problem OR the service itself is not active.

My code for invoking the web service is :

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;

public class WeatherClient {

public static void main(String[] args) throws Exception {
System.setProperty("http.proxyHost", "192.168.0.9");
System.setProperty("http.proxyPort", "3128");

ServiceClient client = new ServiceClient();
// create option object
Options opts = new Options();
//setting target EPR
opts.setTo(new EndpointReference("http://soap.search.live.com:80/webservices.asmx"));
//Setting action ,and which can be found from the wsdl of the service
opts.setAction("urn:SearchMessage");
client.setOptions(opts);
OMElement res = client.sendReceive(createPayLoad());
System.out.println(res);

}

public static OMElement createPayLoad() {
OMFactory fac = OMAbstractFactory.getOMFactory();
//OMNamespace omNs = fac.createOMNamespace("http://ws.apache.org/axis2/xsd", "ns1");
OMNamespace omNs = fac.createOMNamespace("http://schemas.microsoft.com/MSNSearch/2005/09/fex", "ns1");
OMElement method = fac.createOMElement("SearchMessage", omNs);
OMElement value = fac.createOMElement("Search", omNs);
value.setText("New York India Tarrif rangeela desi no way meet up ranso");
method.addChild(value);
return method;
}

}
 
 
subject: Invoking Live Search Web Service - via Axis Client -error AxisFault connection abort