01-18-2005 12:00 PM
Hi,
I have a function module (see below).
I want to make my function module work like a webservice!
Any pointers ?
MyCall: www.myserver.com?p_vkorg=4000
and then receive the resultset as xml.
Eg: <ZWEB_MAT>
<MATNR>100757</MATNR>
<MATNR>100758</MATNR>
</ZWEB_MAT>
Code:
Local interface:
*" IMPORTING
*" VALUE(P_VKORG) LIKE MVKE-VKORG
*" TABLES
*" I_MATERIAL STRUCTURE ZWEB_MAT
//Martin
01-18-2005 12:05 PM
Make it Remote enabled and if you are on WAS6.2 and above then you can expose the same as webservice.
For WSDL generation have a look at <u><b>webservicebrowser</b></u> BSP application.
For more look at Thomas Jung's Weblogs.
Regards
Raja
01-18-2005 2:32 PM
01-19-2005 10:31 AM
Hi,
How do I TEST my webservice (Z_WEB_GET_STOCK)... is there a tool for this ?
(WAS620)
IMPORTING
P_MATNR array of chars (18) Material Number
P_WERKS array of chars (4) Plant
EXPORTING
CHANGING
I_STOCK structure - Stock list
EXCEPTIONS
01-19-2005 11:00 AM
There a lot of options. At the SAP side there is first of all the SOAP client tool https://www.sdn.sap.com/sdn/downloaditem.sdn?res=/html/soapclient_download.htm
You can opt for writing your own client in ABAP. See the weblogs /people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap and /people/durairaj.athavanraja/blog/2004/09/20/consuming-web-service-from-abap
Other language like Java, Perl, PHP can be used too. An example on SOAP::Lite can be seen at the weblog /people/piers.harding/blog/2004/06/16/lather-up-with-soaplite-and-the-web-application-server
If you don't wanna code anything, you can have a look at Altova XML Spy (http://www.altova.com/features_webservices.html), which also integrates with eclipse.
01-19-2005 11:14 AM
Hi,
OK. I really do not want to use SOAP in this case I have here....
I just wanna be able to call my WS like this:
www.mycompan.com/rfc/z_web_get_stock?p_matnr=123&p_werks=3100
and then receive it in xml.
The browser (For testing) should be able to do this ?!
//MA
01-19-2005 11:20 AM
Pointing to the URL with a browser will do indeed if you only want to see what XML your WS produces. The webservice browser Durairaj Athavan Raja mentioned will do also.
01-31-2005 2:40 PM
Pls don't forget to give reward points if you're pleased with the answers given.