How to avoid "Unable to generate EPR for transport" error in Axis2

How to avoid "Unable to generate EPR for transport" error in Axis2
"Unable to generate EPR for transport: http" is a FAQ in Axis2 mailing list. You may have experienced this when invoking a service using generated stubs.

Solution:

It's really simple. When creating the instance of stub, pass the actual service end point (epr) to the constructor as follows.

YourserviceStub stub = new YourserviceStub("http://<IP>:<PORT>/axis2/services/YourService")


Ideally when u generate a stub for a service it will pick up the Endpoint reference from the WSDL. So just instantiating stub with YourserviceStub stub = new YourserviceStub() could send the request to the address defined in the WSDL. In case you get the "Unable to generate EPR for transport: http" error, give a try with the above as well.

你可能感兴趣的:(UP)