Skip to Content
0
Former Member
Jan 09, 2008 at 05:59 AM

Establishing an HTTP Connection Using an Existing Destination

44 Views

Hi Experts,

I have created a destination in the Visual Admin say 'MyDestination'. I have tried to establish the HTTP Connection for the created Destination.

The following is my code

IWDMessageManager manager = wdComponentAPI.getMessageManager();

InitialContext ctx ;

Object obj;

DestinationService dstService;

Destination destination;

HTTPDestination httpDestination ;

HttpURLConnection httpurlconnection = null;

Properties destprop = null;

String url = "";

String username = "";

String password = "";

try{

ctx = new InitialContext();

obj = ctx.lookup(DestinationService.JNDI_KEY);

dstService = (DestinationService) obj;

destination = dstService.getDestination("HTTP","MyDestination");

destprop = destination.getDestinationProperties();

httpDestination = (HTTPDestination) destination;

url = httpDestination.getUrl();

httpurlconnection = httpDestination.getURLConnection();

httpurlconnection.connect();

username = httpDestination.getName();

}

catch(Exception ce){

//manager.reportException(ce.getMessage(), false);

};

if (destprop == null){

url = "http://mycomp:50000/xyz.wsdl";

username = "username";

password = "password";

wdComponentAPI.getMessageManager().reportException("Failed",false);

}

else{

username = destprop.getProperty("USERNAME");

password = destprop.getProperty("PASSWORD");

wdComponentAPI.getMessageManager().reportSuccess("UserName: "username" ""Password: "password);

};

I end up in the following error

java.lang.NoClassDefFoundError: com/sap/security/core/server/destinations/api/Destination

at com.arteriatech.xiaddresscomp.comp.wdp.InternalXiAddressComp.<init>(InternalXiAddressComp.java:128)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:274)

I have referred to the following Link

/message/1362119#1362119 [original link is broken]

and I am not clear of where to check; if the Jar is of Older Version and what is the newer version jar so that I need to replace the jar in the Server location C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.tc.ap_2.0.0\comp\SAP-JEE\DCs\sap.com\tc\sec\destinations\interface\_comp\gen\default\public\default\lib\java\tc_sec_destinations_interface.jar

Please suggest a solution for this issue

Regards,

Mathan MP