cancel
Showing results for 
Search instead for 
Did you mean: 

Web Services...

david_fryda2
Participant
0 Kudos

Hi everyone,

I've read few ways to create a web service : or with the Eclipse plugins by creating a Portal Application or by creating a model in WebDynpro.

Is there a complete tutorial explaining how to create a web service ?

Thanx!

Accepted Solutions (1)

Accepted Solutions (1)

roman_loshevsky
Active Participant
0 Kudos

I recommend to use ..._doc_lit.wsdl

it supported by all components, other some times not supported by different servers.

Regards,

Roman.

david_fryda2
Participant
0 Kudos

I created a client which compile and has been deployed.

I do not success calling a method. I get an exception.

Something strange in the method about the URL.

I created the client and the wizard added: "String aUrl = "http://localhost:8100/irj/servlet/prt/soap/MyTimeService?style=doc_lit";"

The J2EE engine is not located on my computer but on a remote machine. I don't know why it gets this URL.

The fact that all my PAR files are deployed on the remote J2EE engine server proovs that I did configured the correct URL ( of course I see the PAR files in the Portal).

Thanx a lot.

FredericOzon
Employee
Employee
0 Kudos

Hi,

This is normal, if you get this url from your par and not from the runtime.

The value localhost(default value) is dynamically change when calling the WSDL on an running portal.

If you are using a Portal WS client, you have a method on the proxy allowing you to change the url.

Best Regards,

Frederic

Answers (5)

Answers (5)

roman_loshevsky
Active Participant
0 Kudos

Hi David,

Check that this URL not come from WSDL file of server WS(look on end of file).

Regards,

Roman.

david_fryda2
Participant
0 Kudos

Hi Roman,

I did change the URL to the correct one.

I followed a simple tutorial and made everything from scratch.

In my client , I wrote :

IMyGoogleService googleService = (IMyGoogleService)

PortalRuntime.getRuntimeResources().getService("WebServiceTutorial.MyGoogleService");

I don't get an exception here.

But when I call a method, I do get an exception....I think it is an Authorization problem.

Maybe I should add a property in the portalapp.xml file.

I tried but still don't work.

Thanx

FredericOzon
Employee
Employee
0 Kudos

Hi,

Yes for the google example you need to have a valid user to use their service. Register yourself to google.

Best Regards,

Frederic

david_fryda2
Participant
0 Kudos

Thanx.

I read a tutorial showing how to create ws for session beans (EJB).

Do I have to create EJBs in order to create ws ?

Can I use WebDynpro to create ws ?

Thank you.

roman_loshevsky
Active Participant
0 Kudos

Hi David,

From now you can use your webservice (no need to publish it). Just create WS client and test your WS.

Is URL call your WS I recomended work for you?

Regards,

Roman.

david_fryda2
Participant
0 Kudos

Hi Roman,

The URL does call the ws.

Now I am creating a WS client. I have to chose a wsdl file.

I have 3 wsdl for the WS created :

..._doc_lit.wsdl

..._rpc_enc_wsdl

..._rpc_lit.wsdl

Each one of them give me the methods I need. Is there a special choice to do here

Thanx.

roman_loshevsky
Active Participant
0 Kudos

Hi David,

What is portal and J2EE (WAS) version ?

Did you define in portalapp.xml startup property 'true' ?

Regards,

Roman.

FredericOzon
Employee
Employee
0 Kudos

Hi David,

You will not see your portal Web Service thanks to the Web service navigator. You have to use the SOAP Admin, then you will see the list of available Web Services.

Best Regards,

Frederic

david_fryda2
Participant
0 Kudos

Hi,

I am using Netweaver 04.

I did get the WSDL file by writing the right URL in my Browser.

I still not see my service in the SOAP Admin. Strange...

Maybe I am using an old way for creating web services.

I create them by using the SAP Visual Studio Netweaver 04. I created a Portal Application Project and after I associated to this project a new Portal Application by selecting a "Portal Web service from portal service".

Is it the right way to do it ?

If yes, do I need a UDDI server in order to publish my services ?

Thanx for your help

FredericOzon
Employee
Employee
0 Kudos

Hi David,

You should have on the SOAP Admin window a refresh button. did you try it?

If you still have the problem could send me the PAR by mail.

Thanks,

Frederic

david_fryda2
Participant
0 Kudos

Hi Frederic,

First of all my service does appear in the SOAP Admin since my System admin made it work.....

Good news.

Now that I provided the web service (created a WSDL file), what is the next step ?

Do I have to publish my service in the UDDI server ?

Thanx Frederic.

roman_loshevsky
Active Participant
0 Kudos

Hi David,

You can call your web service

http://<server>:<port>/irj/servlet/prt/soap/<service name>?style=doc_lit

Regards,

Roman.

david_fryda2
Participant
0 Kudos

Hi Roman,

Thanx for your help.

I didn't see in the "System Administration ->Support->Portal Runtime-> SOAP Admin" the WSDL file.

How is it ?

I did deploy the WebService from the Eclipse IDE.

I've seen the PAR file in the admin tool that lists all the PAR files deployed.

My system admin told me to launch the Web Services from the Sap Web Application Server (http://<server>:<port>/index.html)->clicking on "Web Services Navigator".

Is it the good way....need help.

Thanx in advance.

roman_loshevsky
Active Participant
0 Kudos

Hi David,

The easy way is:

Create portal service in the Eclipse (+ plugins).

Write all application logic in this service.

Generate WebService from this service (this operation done by plugins) - so you deal with familiar for you area - simple java coding, and plugins do for you a job - generation of WebService

Regards,

Roman.

david_fryda2
Participant
0 Kudos

Hi Roman,

The code is written. The PAR file created and deployed.

Now, the System Admin told that I can run the service by using the following URL :

http://<IP>:<port>/wsnavigator/enterwsdl.html

Is it a second way to execute a WS ?

I don't see my WS there...The Sys Admin do not want to give the System Administration role to programmers....

Thanx Roman.