on 2007 Feb 23 7:03 AM
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
Request clarification before answering.
thankU
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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.....
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!
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
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
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!
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.......
PLZ also help me with the deployment descri[ptors realted to the Webservices.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.