Hi everyone, I apologies for asking such a trivial question but I am very new to the world of web services,
I have been playing with Axis 2 web services and have been encountering a strange error that has had me going nuts:
My wsdl is located in at:
http://127.0.0.1:8080/axis2/services/Version?wsdl and is accessible through a browser, I can also retrieve the version number when I
test it in SoapUI version 5.0 (It is the default AXIS2).
When I try accessing it through a program implementing ServiceClient model, the EPR if passed using the EndpointReference() function. But when I run it I get an error like this:
org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is 127.0.0.1/axis2/services/Version and the WSA Action = urn:getVersionResponse
I noticed that the URL that I fed in is no the same as the one that AXIS considered. It is missing the port number(8080) which I presume is causing all the problem, but I cant figure out how to add it to on... I have googled extensively but haven't found anything close to it.
Am I missing out some configuration, on the server side, If so how am I able to query it using SoapUI
any help will be much appreciated
(I am currently using 1.3 version ... I know it is archived but that is in the requirements specification )
My client code
public class xmlClass
{
static EndpointReference targetEPR = new EndpointReference("http://localhost:8080/axis2/services/Version");
public OMElement createPayLoad()
{
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://ws.apache.org/axis2/xsd", "axis");
OMElement method = fac.createOMElement("Body", omNs);
OMElement value = fac.createOMElement("getVersion", omNs);
method.addChild(value);
return method;
}
public static void main(
String[] args) throws AxisFault
{
xmlClass obj = new xmlClass();
System.out.println(obj.createPayLoad());
ServiceClient client = new ServiceClient();
Options opts = new Options();
opts.setTo(targetEPR);
System.out.println(targetEPR);
opts.setAction("urn:getVersionResponse");
client.setOptions(opts);
try{
OMElement res = client.sendReceive(obj.createPayLoad());
System.out.println(res);
}catch(Exception e)
{System.out.println("The Error occoured \n "+e);}
}
}