cancel
Showing results for 
Search instead for 
Did you mean: 

CALL WEB SERVICE FROM WD JAVA

former_member186145
Participant
0 Kudos

Hi to all

I want do it the following task:

  • Make a FM in Abap (Transaction code SE37)

  • Make a local Web Services

  • I want do it a Web dynpro for Java, and call this Web services

I already make the FM, and the WS,...

But, How Can I do it, by call rhe WS from my WD ??

Thank you by their aid

regards

Dario

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Hernan,

You can use the webservice model to use either any local or third-party webservices. Since the the only interfaces of any webservice for our programs are the REQUEST and RESPONSE parameters so the imported webservice model will have various request and response variables. ( Same as we have input & output incase of RFCs)

Steps :

1. Get the wsdl file for the webservice. Store it on local drive.

2. Create a WD application that uses a webservice model.

3. Create a webservice model and import the WSDL file fro previous steps.

3. The model proxy classes are automatically created. You can see the request

& response parameters.

4. Identify the request and response parameters of your interest.

5.. Create a component controller context structure as per the identified

parameters from the model.

6. Do model binding. i.e map the model parameters to that of the controller's

context variables.

7. Create an event source and an event handler.

8. Call the webservice execute function in the event handler( same as adaptive rfc).

One more important step. You can test the wsdl file from the original source itself.

1. Go to Enterprise Portal perspective of NWDS.

2. Goto Window -> Show view -> SAP Enterprise POrtal Webservice Checker.

3. In the pane that appears, enter the url for the wsdl file of webservice.

4. You can see the SOAP request and Response parameters here.

5. You can enter dummy values for the request parameters and see the response

( output) on running it.

Hope this helps you.

Regards,

Prasanna.

P.S : Award points for helpful reply

Former Member
0 Kudos

Hi, Dario

If your J2EE version is NW04 SP17 or more(NW04s SP6 or more), it is

recommended to use Adaptive Web Service Model of WD Java.

Web Dynpro Java FAQ - Models - Adaptive Web Service

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2bweb%2bse...

And for the unit test after you created Web Service, i recommend

you to test first with Web Services Navigator!

http://help.sap.com/saphelp_nw04s/helpdata/en/b7/d7baaf1481a349ab723e3acd7334b3/content.htm

Best Regards.

Sejoon

abhijeet_mukkawar
Active Contributor
0 Kudos
former_member182374
Active Contributor
0 Kudos
RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can create a model within Web Dynpro, I believe one of the options(other than Adaptive RFC) is web service. Simply choose this option. I would assume that it would ask you for the WSDL file and then generate the model based on that. Then you can simply execute the model from your WDJ application.

Regards,

RIch Heilman