Skip to Main Content

Setup WSClient endpoint at runtime from OEP App

Juan Sebastian QuinteroOct 6 2015 — edited Oct 6 2015

Hello folks,

Im actually having a problem when trying to set a wsclient endpoint URI from an OEP app. What im tryiing to do...

String endpoint = properties.getProperty("my_endpoint");

MyService service = new MyService();

MyPort port = service.getMyPort();

BindingProvider bp = (BindingProvider) port;

bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);

But the cast between port and BindingProvider is causing this exception:

Caused By: java.lang.ClassCastException: com.sun.proxy.$Proxy1021 cannot be cast to javax.xml.ws.BindingProvider

The same code works well from an isolated java app, dont know what is missing

What im doing wrong in here?

Thanks in advance

Post Details
Locked due to inactivity on Nov 3 2015
Added on Oct 6 2015
0 comments
213 views