File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes The service cannot be found for the endpoint reference (EPR) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "The service cannot be found for the endpoint reference (EPR)" Watch "The service cannot be found for the endpoint reference (EPR)" New topic

The service cannot be found for the endpoint reference (EPR)

John Smith
Ranch Hand

Joined: Aug 21, 2004
Posts: 49
Hi All:

I need help!!!

I am using axis2-1.5.1, jdk 1.6, eclipse 3.5, and Axis2_Codegen_Wizard_1.3.0 and windows xp.
I used Axis2_Codegen_Wizard_1.3.0 to generate the client stub and proxy.
I get the following error when I tried to call the web service:


import java.rmi.RemoteException;

public class SimpleClient
public static void main(String[] args) throws RemoteException
SimpleServiceStub service = new SimpleServiceStub();
ConcatRequest request = new ConcatRequest();
ConcatResponse response = service.concat(request);
catch(Exception e)


Here is my SimpleService.wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="SimpleService" targetNamespace="" xmlns:wsdl="" xmlns:tns="" xmlns:xsd="" xmlns:soap="">
<xsd:schema targetNamespace="">
<xsd:element name="concatRequest">
<xsd:element name="s1" type="xsd:string"/>
<xsd:element name="s2" type="xsd:string"/>
<xsd:element name="concatResponse" type="xsd:string">

<wsdl:message name="concatResponse">
<wsdl:part name="parameters" element="tns:concatResponse">
<wsdl:message name="concatRequest">
<wsdl:part name="parameters" element="tns:concatRequest">
<wsdl:portType name="SimpleService">
<wsdlperation name="concat">
<wsdl:input message="tns:concatRequest">
<wsdlutput message="tns:concatResponse">
<wsdl:binding name="SimpleServiceSOAP" type="tns:SimpleService">
<soap:binding style="document" transport=""/>
<wsdlperation name="concat">
<soapperation soapAction=""/>
<soap:body use="literal"/>
<soap:body use="literal"/>
<wsdl:service name="SimpleService">
<wsdl:port name="SimpleServiceSOAP" binding="tns:SimpleServiceSOAP">
<soap:address location="http://localhost:8080/axis2/services/"/>

In the dos-prompt, I get the following error message:
[INFO] Listening on port 8080
[ERROR] The service cannot be found for the endpoint reference (EPR)
org.apache.axis2.AxisFault: The service cannot be found for the endpoint referen
ce (EPR)
at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPha
at org.apache.axis2.engine.Phase.invoke(
at org.apache.axis2.engine.AxisEngine.invoke(
at org.apache.axis2.engine.AxisEngine.receive(
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
at org.apache.axis2.transport.http.HTTPWorker.service(
at org.apache.axis2.transport.http.server.AxisHttpService.doService(Axis
at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
at java.util.concurrent.ThreadPoolExecutor$

Thank you for your help!!!


shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
[ERROR] The service cannot be found for the endpoint reference (EPR)

Says your endpoint url is not correct. It should be something like

SCJP 1.5(97%) My Blog
Carlo LF

Joined: Jan 28, 2009
Posts: 3
I had this problem too with my Axis2 webservices (reported by a BizTalk client). I heavily googled this and didn't find a solution.

Then we saw the strange thing, that the Axis2 generated WSDL (which was the basic information for the BizTalk client), listed a wrong port for the endpoint at element "soap:address location=...". It listed a port, that was used by another Tomcat instance on the same machine, whereas the Axis2 Tomcat was configured (in server.xml) on another port. Then the cause of the problem was clear: the configuration file "axis2.xml" (from axis2/WEB-INF/conf) contained the default ports. So all we had to do was to correctly configure these.

Oleg GoodBoy

Joined: Apr 04, 2011
Posts: 1
Your endpoint must be like: http://localhost:8080/axis2/services/SimpleService
At the end of the EPR you must add service's name (SimpleService - for example)!
I agree. Here's the link:
subject: The service cannot be found for the endpoint reference (EPR)
It's not a secret anymore!