I'm running Axis2 version 1.2. I'm getting the following error when attempting
to send a request to the Axis2 server.
org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation
not found is /axis2/services/MyService and the WSA Action = null
This service is just a simple test service that came packaged with Axis2.
Using the RESTClient also in the samples it works fine. The problem though is
incoming requests might not always be coming from an Axis2 API. To test I
created a simple HttpClient, but now get the error above. Attached below is
the code used for sending the request.
Any help is very much appreciated. Thanks in advance.
~ Wes
public class HttpClient {
private static String toEpr = "http://localhost/axis2/services/MyService";
/**
* @param args
*/
public static void main(String[] args) {
// content to test
String content = "http://example1.org/example1\">Axis2 Echo String ";
byte[] output = content.getBytes();
HttpURLConnection httpConn = null;
try {
// crate http url connection
URL url = new URL(toEpr);
URLConnection connection = url.openConnection();
httpConn = (HttpURLConnection) connection;
httpConn.setRequestProperty("Content-Length",
String.valueOf(output.length));
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
// write to output stream
OutputStream out = httpConn.getOutputStream();
out.write(output);
out.close();
// read response
StringBuffer res = new StringBuffer();
InputStreamReader isr = new
InputStreamReader(httpConn.getInputStream());
BufferedReader in = new BufferedReader(isr);
String inputLine;
while ((inputLine = in.readLine()) != null) {
res.append(inputLine);
}
in.close();
System.out.println("Response: " + res.toString());
}
catch (Exception e) {
e.printStackTrace();
}
}
}