cancel
Showing results for 
Search instead for 
Did you mean: 

Web Services :HTTP Destination not getting resloved.

Former Member
0 Kudos

Hello,

I have transported my webdynpro application from my development server to production server.I have created HTTP destinations on my production server and these destinations are specified in the Webdynpro application in component controller section before the execute() method as explained in SAP Help :

http://help.sap.com/saphelp_nw04/helpdata/en/59/e8e95d1eba48dfa86ae91ad8816f5d/content.htm

I am using parameter Style=Document

but even after that, My Production application is still pointing to my development server. It is probably not overiding wsdl. Why is it so??

Can anyone help me in resolving this issue!!

Thanks and Regards,

Yashodhan Mujumdar

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I faced the same error in my EJB project which is exposed as webservice.

Adding  security.class and tc/sec/destinations/interface resolved my error.

Thanks

Srujana.

Former Member
0 Kudos

Maybe this would be helpul for someone.

I've solved the use of RFC Destinations in a J2EE EJB Module DC, adding these used DCs:

tc/sec/destinations/interface

security.class

com.sap.exception

Former Member
0 Kudos

Thanks a lot for your comment.

Adding all of the three DCs (in my case security.class was missing) helped to get rid of the compiler error.

Regards,

Daniel

Former Member
0 Kudos

Hi,

While creating HTTP Destination please give value like:

http://<servername>:<portnumber>/<Webservicename>/Config1?style=document

Then you can get from HTTP Destination.

Please see the following thread:

Kind Regards,

S.Saravanan.

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi,

Follow the steps:

create the HTTP Destination:

1. Log on to the J2EE Engine as an administrator using the Visual Administrator.

2. Expand <SID> -> Server ->Services.

3. Select the Destinations service.

4. Under Destinations, select HTTP and choose New.

HTTP Destination name: <Application Server>

URL:http://localhost:50000

Go to component controller implementation initially it will be like this:

public void wdDoInit()

{

//@@begin wdDoInit()

//$$begin Service Controller(831926490)

wdContext.nodeRequestAdd().bind(new Request_SampleServiceViDocument_add());

//$$end

//@@end

}

Following code samples:

import java.net.HttpURLConnection;

import java.util.Properties;

import javax.naming.InitialContext;

import com.sap.security.core.server.destinations.api.Destination;

import com.sap.security.core.server.destinations.api.DestinationService;

import com.sap.security.core.server.destinations.api.HTTPDestination;

public void wdDoInit()

{

//@@begin wdDoInit()

InitialContext ctx ;

Object obj;

DestinationService dstService;

Destination destination;

HTTPDestination httpDestination ;

HttpURLConnection httpurlconnection = null;

Properties destprop = null;

String serverName = "";

//Give your web service name

String serviceURL = "/SampleService/Config1?style=document";

String prefixURL = "http://";

try

{

ctx = new InitialContext();

obj = ctx.lookup(DestinationService.JNDI_KEY);

dstService = (DestinationService) obj;

//ApplicationServer is HTTP destination name which i added through visual Admin

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

destprop = destination.getDestinationProperties();

httpDestination = (HTTPDestination) destination;

serverName = httpDestination.getUrl();

prefixURL = prefixURL + serverName;

}

catch(Exception ex)

{

manager.reportException(ex.getMessage(), false);

}

serviceURL = prefixURL + serviceURL;

//$$begin Service Controller(831926490)

Request_SampleServiceViDocument_add addRequest= new Request_SampleServiceViDocument_add();

addRequest._setEndPoint(serviceURL );

wdContext.nodeRequestAdd().bind(addRequest);

}

Do this step also:

(1) In the Package explorer, select your project, right click, cick on "Set Additional Libraries.."

(2) Select security.class and tc/sec/destinations/interface

(3) Click on menu Project > Properties, goto Webdynpro refereces node in the tree and add the following

(a) Interface References: tcsecdestinations~interface

(b) Service References: tcsecdestinations~service

Regards

Suresh KB

Former Member
0 Kudos

Hi

Create the alias name in the server for the WSLD file that should be point outin the server location .Create the alias in Visual Admin -> Destinations->Http

try this to call the webservice by generic

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","WEBSERVICE NAME");

final HTTPDestination httpDestination = (HTTPDestination) destination;

HttpURLConnection httpConnection = httpDestination.getURLConnection();

String xyz = String.valueOf(httpConnection.getURL());

Request_AdvLocationVer1ViDocument_getLocation obj=wdContext.currentRequest_AdvLocationVer1ViDocument_getLocationElement().modelObject();

obj._setHTTPDestinationName("WEBSERVICE NAME");

obj._setEndPoint(xyz);

obj.execute();

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh,

Thanks for the prompt reply.

1)Can you please ellaborate on what do you mean by Calling the webService by generic

2)The class "DestinationService" is not available in my NWDS, do I need to include any library?

3) Does creating the alias means creating a HTTPDestination using visual admin

4) obj._setHTTPDestinationName("WEBSERVICE NAME"); - is the "WEBSERVICE NAME" same as the HTTP Destination Name

Thank again.

Regards,

Yashodhan

Former Member
0 Kudos

Hi,

1.It is a look-up name for calling a Webservice

2.You have need to include the Jar files in the build path of the application,

tc_sec_destinations_interface.jar

tc_sec_destinations_service.jar

Make necessary entries in the Web Dynpro References by selecting Properties of the Project as under:

tcsecdestinations~interface (in the Interface Tab)

tcsecdestinations~service (in the Service Tab)

3.Yes

4.Yes

Kind Regards.

Mukesh.

Former Member
0 Kudos

Hi Mukesh,

I implement you code and the steps that you mentioned.

I am not able to find tc_sec_destinations_service.jar, which is the only pending step.

While building the application I am getting the following error

[

C:\Documents and Settings\netweaver\.dtc\3\t\18726BCEAB26C6711206D30DBF9F4317\gwd\packages\com\apl\hssp\hsspsearch\HSSPSearch.java:201: cannot access com.sap.security.core.server.util0.IDException

file com\sap\security\core\server\util0\IDException.class not found

Destination destination = dstService.getDestination("HTTP","WEBSERVICE");

^

]

What could be the problem.

Regards,

Yashodhan

Former Member
0 Kudos

Hi

In my system the file is in the path

C:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\services\tcsecdestinations~service

you send me the mail id .I will attach the jar file

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh

Thanks for the help. you can send the file to yashodhan@gmail.com

Regards,

Yashodhan

Former Member
0 Kudos

Hi

I have sent you the jar files. And let me know that if it is helpful to you.

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

I have received the jar files.

But when I am looking into the path mentioned by you it is already there.

How do I add the jar file into my project?

When I try to add it as a the used DC, it is not present in the active components list.

Even in case of Set Additional Libraries the particular jar is not available.

We are using SAP J2EE 640 SP16 and are using JDI Scenario 2+ enviornment.

Regards,

Yashodhan

Former Member
0 Kudos

Hi

You can Create a Library project using this jar file and deployee it to the J2EE Engine and add the project as library references.

Kind Regards,

Mukesh.

Former Member
0 Kudos

Hi Mukesh,

Even after Create a Library project and using the jar file, it is still giving the followig error while building the application.

[

C:\Documents and Settings\netweaver\.dtc\3\t\18726BCEAB26C6711206D30DBF9F4317\gwd\packages\com\apl\hssp\hsspsearch\HSSPSearch.java:201: cannot access com.sap.security.core.server.util0.IDException

file com\sap\security\core\server\util0\IDException.class not found

Destination destination = dstService.getDestination("HTTP","WEBSERVICE");

^

]

Regards,

Yashodhan

Former Member
0 Kudos

hi,

Check in the import parameter.

import com.sap.security.core.server.destinations.api.Destination;

and give the complete error message

Kind Regards

Mukesh

Former Member
0 Kudos

hi,

The import statement if properly mentioned.

The exact error is:

[

[echo] Starting Java compiler

[javac] Compiling 212 source files to C:\Documents and Settings\netweaver\.dtc\3\t\18726BCEAB26C6711206D30DBF9F4317\classes

C:\Documents and Settings\netweaver\.dtc\3\t\18726BCEAB26C6711206D30DBF9F4317\gwd\packages\com\apl\hssp\hsspsearch\HSSPSearch.java:201: cannot access com.sap.security.core.server.util0.IDException

file com\sap\security\core\server\util0\IDException.class not found

Destination destination = dstService.getDestination("HTTP","HSSPPeProcessorService_hssp");

^

1 error

Ant runtime 36.828 seconds

Ant build finished with ERRORS

Compile failed; see the compiler error output for details.

Error: Build stopped due to an error: Compile failed; see the compiler error output for details.

]

The error which it is giving is related to the file "com\sap\security\core\server\util0\IDException.class"

which is not present within the api's.

Regards,

Ameya

Former Member
0 Kudos

Does anybody have any alternate solutions for this?

Thanks in advance.

Regards,

Ameya

Former Member
0 Kudos

Hi

Try this in the Coding part

try{

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","HSSPPeProcessorService_hssp");

final HTTPDestination httpDestination = (HTTPDestination) destination;

HttpURLConnection httpConnection = httpDestination.getURLConnection();

String xyz = String.valueOf(httpConnection.getURL());

Request_WEBTESTRLCViDocument_getClient obj=wdContext.currentRequest_WEBTESTRLCViDocument_getClientElement().modelObject();

obj._setHTTPDestinationName("HSSPPeProcessorService_hssp");

obj._setEndPoint(xyz);

obj.execute();

} catch(Exception ce) {

wdComponentAPI.getMessageManager().reportSuccess("Error"+ce.getMessage());

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

}

Kind Regards

Mukesh

Former Member
0 Kudos

Hi,

Please see the following thread:

I think this is regarding wrong jar file adding.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi All,

Mukesh the code which you have given is the same that you had mentioned yesterday, except for the try/catch block which I have already used in my code.

Saravanan the thread you mentioned talks about using a server library component to deploy the external jars, which we have already tried that but still the same error is get shown during build.

Ragards,

Yashoshan

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi,

did u created HTTP detsination name?

create the HTTP Destination:

1. Log on to the J2EE Engine as an administrator using the Visual Administrator.

2. Expand <SID> -> Server ->Services.

3. Select the Destinations service.

4. Under Destinations, select HTTP and choose New.

HTTP Destination name: HSSPPeProcessorService_hssp

Regards

Suresh KB

Former Member
0 Kudos

Hi Suresh,

Ya I have created the HTTP destination. Infact that was the first thing that I did.

Regards,

Yashodhan

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Yashodhan,

i hope u added both jars to Used Dcs

1. security.class

2. tc/sec/destinations/interface(this u already added)

Regards

Suresh

Former Member
0 Kudos

Hi,

Please check the follwoing steps in your Dynpro project.

1.Project>Properties>Web Dynpro References-->Interface references --> Add the follwoing:

Name=tcsecdesninations~interface

2.Project>Properties>Web Dynpro References>Service reference> Add the following:

Name=webservices

Name=tcsecdesninations~service

I hope this step might be solve your problem.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi,

I re-iterated the entire thing from scratch and now it has started working in devlopment server, but after transporting it to production it is still giving the same class not found error as it was giving in development.

I attempted to checkout the application in some other NWDS.

There I observed that the setting which we have done in Web Dynpro References did not show up. The reference list was empty.

Does the changes done in Web Dynpro References do get activated or its only editor specific.

Regards,

Yashodhan

Former Member
0 Kudos

Hi,

Try to set web Dynpro References explicitly.

Kind Regards,

S.Saravanan

Former Member
0 Kudos

Dear Saravan,

Can you please elaborate on how to set web Dynpro References explicitly. The general procedure that I follow is right clicking on the dc -> properties where the references are mentioned.

I checked for the references in the development server using the web dynpro content administrator. The reference were existing.

But, in production web dynpro content administrator the referenceszmentioned are not existing.

Regards,

Yashodhan

Former Member
0 Kudos

Hi,

I have the same problem, but now solved using the following steps. Just do the following steps in WebDynpro project property.

Please check the follwoing steps in your Dynpro project.

1.Project>Properties>Web Dynpro References-->Interface references --> Add the follwoing:

Name=tcsecdesninations~interface

2.Project>Properties>Web Dynpro References>Service reference> Add the following:

Name=webservices

Name=tcsecdesninations~service

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi Saravan,

Its working for me too, but only in development servers.

But after moving to production it is giving me Class not found error as mentioned in the about messages.

The references setting are not getting transported to production.

Regards,

Yashodhan

Former Member
0 Kudos

Hi,

How did you add releated jars file into your project?. If you add through Library project, you should deploy the library project into production server also.Try like that.

Kind Regards,

S.Saravanan.