cancel
Showing results for 
Search instead for 
Did you mean: 

coarse-grained Web Service

Former Member
0 Kudos

Hi all,

I noticed, that services in the ES Workplace has small and clear interface. But if i want to develop a complex UI, let's say object hierarchy contains many levels. How will it be implemented as Web Service? One big Web Service?

If i have fine-grained Web Service, than i must always save data on DB, as Web Service may requere ID. But it is not the way for UI.

This restriction is based on the fact, the Web Services must be stateless.

Regards

Paul

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

imho there are several strategies which can co-exist. E.g.

- one service which indeed fetches the whole structure (since you can't define an arbitrarily deep structure or recursive structure by means of WSDL you kind of have to flatten that structure by returning a table containing parent/child relations for each object; this would be a little difficult to traverse on the client side)

- more fine-grained services like e.g.

-- GetObject

-- GetChildrenOfObject

which the client then could call in succession.

Latter strategy might especially make sense in UIs when you want to load additional substructures only when required (i.e. only when the user drills down you load an additional level with AJAX or something like that) .

In my opinion you don't need to store anything to a database in those cases and do not have troubles with the fact of statelesness of services.

regards, anton

Former Member
0 Kudos

- more fine-grained services like e.g.

-- GetObject

-- GetChildrenOfObject

which the client then could call in succession.

Latter strategy might especially make sense in UIs when you want to load additional substructures only when required (i.e. only when the user drills down you load an additional level with AJAX or something like that) .

In my opinion you don't need to store anything to a database in those cases and do not have troubles with the fact of statelesness of services.

regards, anton

Hi Anton,

Problem is change, not reading.

If i have SetObject and SetChildrenOfObject and in SetChildrenOfObject i want to get the new data from SetObject in order to execute the check correctly.

How SAP is handling these situations?

Regards

Paul

Former Member
0 Kudos

Hi Paul,

I can't tell you how 'SAP is handling these situations', I just can discuss with you how I would design that.

Unfortunately I do not fully understand your problem.

My guess:

- You have an existing object (of which you get the details through a GET-service).

- You want to create a new object with a CREATE-service and associate it with the object retrieved before in a isChildOf-association (this would usually return some success message containing some structural info - new object ID, etc)

- You want to retrieve the combined object

Is this correct?

anton

Former Member
0 Kudos

Hi Anton,

In UI it must be possible to create main-object and sub-object in one step (maybe many main-objects).

I assume, that i get ID of main object only if it is saved on database.

Therefore, i think only coarse-grained services are usefull here. And relations between objects can be set via temporary IDs if service communicate with flat structures. If XML is used, relations are set via structure of XML.

Another problem - in BAPIs it was possible to execute it in testrun. But in enterprise services in the ES Workplace i have not seen this parameter. I think SAP-BAPIs provide better support for building UI than SAP enterprise services.

Regards

Paul

Former Member
0 Kudos

well,

probably things are just a matter of taste.

I am from time to time building dynamic UIs in a completely SAP agnostic environment by combining calls to several SAP (custom made ones) and non SAP services.

Personally I did not like BAPIs at all. To call a commit explicitly seemed very anachronistic to me.

Also I did never ever feel a need to testrun an operation. To my knowledge no enduser wants to <b>test</b> if e.g. a purchase order could be created or not. To me the usual way is to have actual data (availability, pricing, etc...) checked already (which is not determined by a testrun but via Get services) and then try to create that order...with two outcomes, either the order being created sucesfully and a receipt returned or or the order not being created sucesfully and a meaningful error condition returned hinting me on how to overcome that condition.

To me the possibility to automatically create service consumers (clients) in almost every language (programming environment), get the data type mappings and the transport layer stuff done automatically and having an interface and service description (WSDL) which is (at least in theory) understandable by the SAP agnostic puts web services so far ahead of BAPIs, that IMHO they are not comparable at all.

regards, anton

Former Member
0 Kudos

thanks Anton.

let's say you have two services - create partner basis data and assign role to the partner.

Customer wants to create the partner with role in one step. With BAPi he can do it - there is only one FM, but if he has two services it can occur that basis data is created and role not.

Regards

Paul