Hello SAP Community, here is my issue:
I need to access a web service in my web dynpro application, so I generated a deployable proxy from the wsdl file and deployed it to the server. I added the proxy's ClientAPI.jar to my web dynpro build path and tried to get its interface via jndi lookup, but I get a ClassCastException.
The problem here is that when I look for my proxy in Visual Administrator's JNDI Registry, the class name is different from the one in Client API, as follows:
JNDI Registry: ConsultaPadronServiceImpl
Client API: ConsultaPadronService
Debugging the code I can see that I get ConsultaPadronServiceImpl in my lookup, but when I try to do the casting to ConsultaPadronService I get the exception.
Here is my code:
try{
InitialContext ctx = new InitialContext();
Object obj = ctx.lookup("wsclients/proxies/sap.com/FonhapoWS/mx.gob.conavi.sap.ws.fonhapo.FonhapoProxy");
ConsultaPadronService ser = (ConsultaPadronService)PortableRemoteObject.narrow(obj, ConsultaPadronService.class);
port = (WsConsultaPadron)ser.getLogicalPort("WsConsultaPadronSoapHttpPort");
...
}catch (Exception ex){
IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
msgMgr.reportException(ex.getMessage(), true);
}
I really hope someone can help me out with this, I have already added the sharing reference to the proxy in my Web Dynpro project like <provider>/<EAR name> and still not working.
Regards.