2009 Sep 16 1:53 PM
Hi,
I would like to know your professional point of view about this thing:
I want to create a web service, which is based on FM. The FM should get an 'object' as import parameter. As a remote enable function, the FM can get parameters only by value.
What is the most common 'object' which I can use as a parameter.
(I thought about a table, which each line is a structure...)
Any suggestions?
Thanks,
Sivan
2009 Sep 16 11:52 PM
Hi Sivan,
when I build web services based upon function modules I do a couple of things. These ideas are driven by the way the ABAP Web Service proxy generator builds the interface from the function module signature.
Firstly, I drop my usual ABAP naming conventions for the interface parameters so they read better in the web service interface. For example, instead of calling an exporting parameter EV_KUNNR I would call it CUSTOMER_NUMBER. The default name mapping would then product a name of PurchaseOrder CustomerNumber for the web service interface. This makes the WSDL easier to read and the interface more intuitive.
Secondly I only use IMPORTING and EXPORTING parameters. This is because CHANGING and TABLES parameters get defined on both the inbound and outbound sides of the web service interface. Again this makes the interface more complicated than it needs to be and any tools that introspect the WSDL will in turn generate much more complicated interfaces than necessary.
Cheers
Graham Robbo
Edited by: Julius Bussche on Sep 17, 2009 9:38 AM
Typo corrected.
Hi,
I would like to know your professional point of view about this thing:
I want to create a web service, which is based on FM. The FM should get an 'object' as import parameter. As a remote enable function, the FM can get parameters only by value.
What is the most common 'object' which I can use as a parameter.
(I thought about a table, which each line is a structure...)
Any suggestions?
Thanks,
Sivan
2009 Sep 16 2:02 PM
2009 Sep 16 11:52 PM
Hi Sivan,
when I build web services based upon function modules I do a couple of things. These ideas are driven by the way the ABAP Web Service proxy generator builds the interface from the function module signature.
Firstly, I drop my usual ABAP naming conventions for the interface parameters so they read better in the web service interface. For example, instead of calling an exporting parameter EV_KUNNR I would call it CUSTOMER_NUMBER. The default name mapping would then product a name of PurchaseOrder CustomerNumber for the web service interface. This makes the WSDL easier to read and the interface more intuitive.
Secondly I only use IMPORTING and EXPORTING parameters. This is because CHANGING and TABLES parameters get defined on both the inbound and outbound sides of the web service interface. Again this makes the interface more complicated than it needs to be and any tools that introspect the WSDL will in turn generate much more complicated interfaces than necessary.
Cheers
Graham Robbo
Edited by: Julius Bussche on Sep 17, 2009 9:38 AM
Typo corrected.
2009 Sep 17 7:20 AM
Hi,
Thanks for the good advice!
Do you think that working with tables as import\export parameter is a conventional way? Because I need to import\export a complex structure...
Thanks,
Sivan
2009 Sep 17 8:29 AM
Absolutely. Deep structures are also okay.
Cheers
Graham Robbo
p.s. Just reread what I wrote above. I meant to write "instead of calling an exporting parameter EV_KUNNR I would call it CUSTOMER_NUMBER. The default name mapping would then product a name of CustomerNumber for the web service interface."