• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Axis2 client cannot locate EPR

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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);}

}


}
 
neshant somanath
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
turns out my problem in the Name Space ... a change in the namespace seems to have got me going .... any thanks a lot guys
 
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic