cancel
Showing results for 
Search instead for 
Did you mean: 

Creating WebService for a EJB???----URGENT plz

Former Member
0 Kudos
90

hellow....

i'm a begginer in EJBs and also web-services......

i know how to program an EJB but donno abt how to test it in NWDS....

i wrote some business logic methods.....but i donno how to create web-services for

the created EJB and test the functionality.....

thers only one business method returning a string..in my Stateless session bean.

but i cudnt create a webservice for this...and the use of it.....

can some one present me the CONCEPT oriented explanation of web-service...

how to create it....

what is Vertual interface...??

what is Web-service definition??

what is web-service configuration??

why shud we create them??

and finally how to call my business method... after deploying the EJB??

some useful links may also help.....

i'll highly appreciate if explained clearly in the forum itself........

thanx in advance.....

regards,

Sudheer

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

thankU

Former Member
0 Kudos

Hi Sudheer!

I think the page https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28b1ed0e-0d01-0010-c887-a8fde... [original link is broken] [original link is broken].

Best Regards,

Robin

Former Member
0 Kudos

thanx Robin......

the links u provided r of help to me .....

however it wud be of great help if i can get some WHY?? kind of info. rather than

HOW?? kind........

thankyou....

regards,

Sudheer.

Former Member
0 Kudos

Hi Sudheer!

So you would like to know <b>why </b>one would develop applications using Java EE 5?

Regards,

Robin

Former Member
0 Kudos

hmmmm........Robin....

the use of web services......in NWDS.......

why and how to use them.....is my confusion....??

like....vertual interface....web service definition.....configuration......

what exactly is the contribution of these elements in the project ......

regards,

sudheer

Former Member
0 Kudos

Hi Sudheer!

The use of webservices depends on the scope of your project. <a href="http://en.wikipedia.org/wiki/Webservice">Webservices</a> are mainly used to expose business logic or documents to other applications written in Java or any other webservice-capable language. They can be seen as one of the main technical concepts of <a href="http://en.wikipedia.org/wiki/Service-oriented_architecture">Service-oriented Architectures</a>.

To keep it simple you can see the "why" like this: If you want to expose your application logic (EJBs) to other (non Java EE 5) applications you use webservices. If your application's scope is in a plain Java EE 5 environment you don't need webservices in most of the cases.

Best Regards,

Robin

Former Member
0 Kudos

thanx Robin.....

ok i understood with the documents.......abt web-services.....

now....my requirement......

i've written a EJB with a single business logic method....which takes a String arg.

and returns a String.

now....i have with me--EJB class, Home and remote interfaces.....

now i've built the EJB archive in NWDS.

i created an EAR project and built an ear file by adding the EJB archive(project) to it..

now i deploy it in the WAS which is in a different system in the network.

deployment is sucessfull.......

now how can i call my business logic method.....

can u gimme some code sample for calling my business method....

thanx in advance....

regards,

sudheer

Former Member
0 Kudos

and.....is ther anything to be configured in the <b>ejb-jar.xml</b> and

<b>ejb-j2ee-engine.xml</b> so that the business method is made accessible for the client program.....how can i write a client.....

what are the .jar files required for the client program.....

Former Member
0 Kudos

Hi Sudheer!

This should be the right document for you:

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d29f641d-0e01-0010-10a7-a414b0fe53ac">Developing your first Java EE 5 application</a>

Best Regards,

Robin

Former Member
0 Kudos

hi Robin.....

thanx very much....for this doc....

i achived some success with the help of this pdf....

but not completely sucessfull......

the doc assumes us to use the EJB Local interface....for the lookup of the object to call the business method.......

but my server WAS is not the localhost....its in a network......

so i reckon we shud use the Remote interface for this task(correct me if i'm wrong).

so i cudnt lookup the remote object...

thankyou.....

Vlado
Advisor
Advisor
0 Kudos

Well, haven't you already asked this question? ->

Former Member
0 Kudos

hi Vladimir,,,

yepp....i did try da way...u directed me...

but, i got some kinda Exception....

com.sap.engine.services.jndi.InitialContextFactoryImpl...cannot be instantiated.....

root exception....class not found exception.......

plz gimme some way out of it......

thankU

regards,

Sudheer.

Former Member
0 Kudos

i think i dont have the .jar file required for this class......

can anyone mail this .jar file or provide the link so dat i can d/l it ........

my mailID <b>sudheer.ace@gmail.com</b>

thankU

Vlado
Advisor
Advisor
0 Kudos

Hi Sudheer,

You would need the following three jars:

- sap.comtcjeclientlibimpl.jar

- sap.comtcexception~impl.jar

- sap.comtcloggingjavaimpl.jar

(see section Running the Client in https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/605ff5f2-e589-2910-3ead-e558376e....

You can find them either on the server in C:SAPJP1JC00j2eej2eeclient, or in the DevStudio under ...eclipseplugins

- com.sap.engine.clientapislib

- com.sap.exceptionlib

- com.tssap.sap.libs.logginglib

Cheers!

Former Member
0 Kudos

hi vladimir,

thankU for da reply...

however the problm is i dont have access to the server system and i dont find the jar files in the \eclipse\plugins\ directory.....

do we have any other resource for the jar files........

regards,

Sudheer

Vlado
Advisor
Advisor
0 Kudos

Guess you are not working with the Java EE 5 Edition Developer Studio then?!

OK, probably the easiest way would be to install the system on your local box - I assure you that it will not take much of your system resources Check the system requirements inside the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn?rid=/library/uuid/da699d27-0b01-0010-99b0-f11458f31ef2">installation package</a>.

-Vladimir

Former Member
0 Kudos

500 Internal Server Error

SAP J2EE Engine/7.00

Application error occurred during the request procession.

Details: com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException:

Error compiling [/index.jsp] of alias [DemoWEB] of J2EE application [sap.com/DemoEAR].

Exception id: [0014C20C7066008B000001CD00001404000422A7255FF070]

-


this is the exception or error dat i get after i did all ..........

i've got all the jar files in the classpath.......

still i cant lookup the instance.................

here goes my code...........in da jsp page..........

-


<%@ page import="javax.naming.*"%>

<%@ page import="com.su.ejb.*"%>

<%

try {

public EJBDemoLocalHome myBean = null;

InitialContext ic = new InitialContext();

myBean = (EJBDemoLocalHome) ic.lookup("sap.com/DemoEAR/EJBDemoHome");

EJBDemoLocal loc = myBean.create();

String h = loc.callMe();

} catch (java.lang.Exception e) {

}

%>

<html>

<head>

<title>

Title

</title>

</head>

<body>

<h1>

Generated JSP by SUDHEER

<br><%=h%>

</h1>

</body>

</html>

-


if i remove the try catch block and the expression tag.......then the simple heading

tag works fine.......

<h1>

Generated JSP by SUDHEER

</h1>

this is displayed on the IE......

so, the problm is in the try catch block........

can someone debug it.....

thanx in advance.....

regards,

Sudheer

Vlado
Advisor
Advisor
0 Kudos

Now I see you are not working with the Java EE 5 server either (then the next question would be why the post in this thread?)

Anyway, sure somebody can debug it for you, but why not show that you have tried to solve the problem yourself first? Have a look in the server logs for the exception id shown above - this, I'm pretty sure, will give you some helpful hints about what's wrong with your app.

And btw, any chance that you have missed to go through the <a href="https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement">Rules of Engagement</a> that can be found on the top of every forum here on SDN?

Cheers!

Former Member
0 Kudos

thankU vladimir .....

for the reply......

really i never did see the rules of engagement....before.......

thnaks once again.....

anyhow the problm was with the p4 port in the PROVIDER_URL .....

it was supposed to be...50004 ....but i got it frm my admin as 50104....

now i see everything works fine.....with the new port......

Thanx everyone.......

Former Member
0 Kudos

PLZ also help me with the deployment descri[ptors realted to the Webservices.....