cancel
Showing results for 
Search instead for 
Did you mean: 

Consume Web Service in EJB Application

Former Member
0 Kudos

Hi Experts,

I have EJB Application with some Java Classes.My Requirement is to Consume Web Service in EJB Application.

I am new to EJB Application.Please share if have any ideas regarding the same.

Thanks & Regards,

SatheshKumar R

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Pls go through the below links:

http://help.sap.com/saphelp_nw04/helpdata/en/58/d4b7010fc31645995d39e39bbcd112/frameset.htm

This guide will help you create Session beans in NWDS

http://help.sap.com/saphelp_nw04/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/frameset.htm

This guide will explain you all about Web services in NWDS; in particular it will help you wrap a session bean with Web service.

If you need more help do tell me.

/thread/920487 [original link is broken]

Call external webservices from Portal Applications by exposing the webservice as a "Portal Service".

Regards,

Vijay.

Former Member
0 Kudos

Hi Vijay,

Thanks for the Reply.

I have some class in EJB Application.Now i need to Consume the Web Service from that class inside the EJB Applications.

Please Let me know if you have any idea regarding this.

Thanks & Regards,

SatheshKumar R

vijay_kumar49
Active Contributor
0 Kudos

Hi,

These are the pointer for webservices for JAVA check if it helps.

[Consuming EJBs in Web Dynpro Java for CE 7.1|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b030e7fb-2662-2b10-0dab-c4aa52c3550b]

[Using EJB Functionality in Web Dynpro Java with the Web Service Model|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/502f70a8-33a4-2b10-3dbe-bdcb5e25c6da]

Hope this is help full for you !!!!

Regards

Vijay K

Edited by: VijaySAPEP on Sep 8, 2011 11:12 PM

Former Member
0 Kudos

Hi Vijay,

Thanks for the Reply.

Iam Trying to Consume the Web Service in J2EE Applications.

Once i had Consume the WSDL File it creates the Java File as Request, Response, Remote and Object Factory.

After that i have Create the Main Java Class and the Client Java Class.

Once i run the Application it shows the Error like this.

Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/engine/interfaces/sca/logtrace/CallEntry$TraceLevel

at com.sap.engine.services.webservices.espbase.client.bindings.ConfigurationUtil.getTransportBinding(ConfigurationUtil.java:249)

at com.sap.engine.services.webservices.espbase.client.bindings.ConfigurationUtil.createClientConfiguration(ConfigurationUtil.java:109)

at com.sap.engine.services.webservices.espbase.client.jaxws.metadata.InterfaceMetadata.createClientConfigurationContext(InterfaceMetadata.java:178)

at com.sap.engine.services.webservices.espbase.client.jaxws.metadata.InterfaceMetadata.getProxy(InterfaceMetadata.java:70)

at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.getPort(SAPServiceDelegate.java:258)

at javax.xml.ws.Service.getPort(Service.java:92)

at com.sap.tutorial.testwebser1ejb.TestAddService.getTestAddPort(TestAddService.java:38)

at com.sap.tutorial.testwebser1ejb.TestAddClient.testAdd(TestAddClient.java:12)

at com.sap.tutorial.testwebser1ejb.MainClass.main(MainClass.java:12)

Caused by: java.lang.ClassNotFoundException: com.sap.engine.interfaces.sca.logtrace.CallEntry$TraceLevel

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

... 9 more

If you have any idea for this problem please reply..

Thanks & Regards,

SatheshKumar R

vijay_kumar49
Active Contributor
0 Kudos

Please check it jar file is available under lib folder. I think . Please Provide Proper Error.

Put this jar file into your lib directory, it will solve your problem.

Right click on your Web Dynpro project -> Navigate to Properties -> Select Java Build Path -> Add external jars -> Browse to your jar file in the lib folder -> Click on OK

Rebuild your project and deploy and run your application

Hope this helps!!

Thanks & Regards

Vijay K

Former Member
0 Kudos

Hi Vijay,

Thanks for the Reply.

Please provide the JAR Files i need to add.

I had tried to consume the web service by using the java class in Java Project ie EJB.

After creating the Project i will import the WSDL file in that Project and create the Client Application.

The Request and Response java class is created by importing the WSDL file.

The Client Java Class is created to access the Request and Response objects.

After this Main class is created and I have run the application to execute the Client Java Class. During this time its shows some error.

The Error Message are:

Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/engine/interfaces/sca/logtrace/CallEntry$TraceLevel

at com.sap.engine.services.webservices.espbase.client.bindings.ConfigurationUtil.getTransportBinding(ConfigurationUtil.java:249)

at com.sap.engine.services.webservices.espbase.client.bindings.ConfigurationUtil.createClientConfiguration(ConfigurationUtil.java:109)

at com.sap.engine.services.webservices.espbase.client.jaxws.metadata.InterfaceMetadata.createClientConfigurationContext(InterfaceMetadata.java:178)

at com.sap.engine.services.webservices.espbase.client.jaxws.metadata.InterfaceMetadata.getProxy(InterfaceMetadata.java:70)

at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.getPort(SAPServiceDelegate.java:258)

at javax.xml.ws.Service.getPort(Service.java:92)

at com.sap.tutorial.testwebser1ejb.TestAddService.getTestAddPort(TestAddService.java:38)

at com.sap.tutorial.testwebser1ejb.TestAddClient.testAdd(TestAddClient.java:12)

at com.sap.tutorial.testwebser1ejb.MainClass.main(MainClass.java:12)

Caused by: java.lang.ClassNotFoundException: com.sap.engine.interfaces.sca.logtrace.CallEntry$TraceLevel

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

... 9 more

Thanks & Regards,

SatheshKumar R

junwu
Active Contributor
0 Kudos

it has nothing to do with sap, you can google, there are tons of answer