cancel
Showing results for 
Search instead for 
Did you mean: 

Consume web service using EJB

Former Member
0 Kudos

I am trying to consume a web service by following the tutorial listed here:

http://help.sap.com/saphelp_nw2004s/helpdata/en/2d/b9766df88f4a24967dae38cb672fe1/frameset.htm

I've created and deployed a proxy to the server.

I am now creating an EJB to call the proxy and am having trouble with the following lines of code listed in the tutorial:

InitialContext ctx = new InitialContext();

CreditLimitCheck obj = (CreditLimitCheck)

ctx.lookup("java:comp/env/CreditLimitCheckProxy");

CreditLimitCheckViDocument port = (CreditLimitCheckViDocument)

obj.getLogicalPort("DEFAULTPort_Document",

CreditLimitCheckViDocument.class);

this.port = port;

I'm not sure which objects the CreditLimitCheck and CreditLimitCheckViDocument are referring to?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Michael,

CreditLimitCheck and CreditLimitCheckViDocument are the two Service Endpoint Interfaces (SEI) that get created in the Proxy project in the tutorial that you have mentioned.

The procedure to call the proxy is

1. To create the Proxy object by referring to its JNDI name.

2. Create the Logical Port Object using the Proxy Object.

3. Using the Logical Port object, call the relevant Web service operations.

Hope it helps.

Regards,

Alka.

Former Member
0 Kudos

Hi Alka,

What I'm trying to do is call an existing web service (not the credit check webservice) by using a deployable proxy and EJB. I created the proxy and EJB by following the example.

I guess what my question is: if I did not create the webservice, how do I create the logical port?

Thanks,

Michael

Former Member
0 Kudos

Hi Michael

how do I create the logical port?

for this

Creating a Logical Port

http://help.sap.com/saphelp_nw04/helpdata/en/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm

also

you can create the logical port from transaction LPCONFIG

Regards

Abhishek

Former Member
0 Kudos

Abhishek,

The links you provided were how to create a logical port in ABAP.

I am calling the web service from an EJB. Do you have any links on how to create the logical port using an EJB from an existing web service?

Thanks,

Michael

Former Member
0 Kudos

Michael,

The Deployable Proxy Project that you have created for your Web Service will have 2 Interfaces created under the Proxy. The Proxy Project also has the Logical Port that is needed for the Web Service.

You can see these once you expand the Proxy under the Project. The Logical Port is under a yellowish cion, while the interfaces are represented by the SEI node in the proxy.

One of those interfaces, is the Proxy Interface, which has the method to define and initialize the Logical Port. Once the Logical Port Object is created, it can be used to call the methods of the Web Service proxy.

Regards,

Alka.

Former Member
0 Kudos

Hi Michael check at the point no 6 at this link , may be that helps

http://help.sap.com/saphelp_nw04/helpdata/en/45/029840cf43495195da923f32262911/frameset.htm

Regds

Abhishek

Former Member
0 Kudos

Thanks Alka!

Answers (1)

Answers (1)

Former Member
0 Kudos

This message was moderated.