on 08-27-2004 12:17 PM
Hello,
when using a Web Service Model in a Web Dynpro project, you have to define the target address of a Web Service in the Logical Ports Document (which is written to e.g. lports_1.xml).
I have the following problem. If, for any reason, the URL of my Web Service changes (i.e. the hostname or the port), I have to adapt the lports document in all Web Dynpro applications that ure using this Web Service and furthermore I have to rebuild the whole project and I have to redeploy the project.
Is there a way to change this URL dynamically, i.e. means without having to rebuild and redeploy the project?
Thanks in advance,
Christian
please follow below steps.
Add jars
o security.class
o tc/sec/destinations/interface
Setting WebDynpro project property
o Project>Properties>Web Dynpro References-->Interface references
 Name=tcsecdestinations~interface
o Project>Properties>Web Dynpro References-->Service reference
 Name=webservices
 Name=tcsecdestinations~service
Setting httpDestination
o Log on to the J2EE Engine as an administrator using the Visual Administrator.
o Expand <SID> -> Server ->Services.
o Select the Destinations service.
o Under Destinations, select HTTP and choose New.
 HTTP Destination name : DestinationName
 URL : URL to web service
 Type : BASIS
 User : username
 PASS : Password
o Save
Dynamically Set httpdestination and Call web service
final InitialContext ctx = new InitialContext();
final DestinationService dstService = (DestinationService)ctx.lookup(DestinationService.JNDI_KEY);
if (dstService== null)
throw new NamingException ("Destination service not available");
final Destination destination = dstService.getDestination("HTTP"," DestinationName");
// getting user name
Properties destprop = destination.getDestinationProperties();
String username = destprop.getProperty("USERNAME");
String password = destprop.getProperty("PASSWORD");
final HTTPDestination httpDestination = (HTTPDestination) destination;
HttpURLConnection httpConnection = httpDestination.getURLConnection();
String httpURL = String.valueOf(httpConnection.getURL());
Request_AdvLocationVer1ViDocument_getLocation obj=wdContext.currentRequest_AdvLocationVer1ViDocument_getLocationElement().modelObject();
obj._setUser(username);
obj._setPassword(password);
obj._setEndPoint(httpURL);
obj.execute();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian,
May be you can try following.
You can change the Port URL using Visual Administrator -> Services -> Web Services Security and change in connection settings the URL to Custom and enter new destination value.
Let me know if that helps.
Regards,
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.