Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the endpoint URL from an Axis2 generated Stub

I've generated a web service stub using wsdl2java on Axis2 1.5.6 and I'm creating the Stub and injecting it into my code in my Spring context.

I'd like to log the endpoint URL that the stub is using, but I can't seem to find a way to access it.

The closest I can find is: stub._getServiceClient().getServiceContext().getTargetEPR().getAddress()

But that throws a null pointer exception.

like image 415
Omar Kooheji Avatar asked Nov 06 '25 16:11

Omar Kooheji


1 Answers

I believe this will get you what you want.

stub._getServiceClient().getOptions().getTo().getAddress();
like image 142
Kevin D Avatar answered Nov 09 '25 11:11

Kevin D