Adapter for SAP 10.1 | webMethods Adapter for SAP Documentation | webMethods Adapter for SAP Installation and User’s Guide Documentation | Adapter Services | Creating an Adapter Service that Executes an RFC | Posting an RFC-XML Document from an HTTP Client | Invoking the RFC Adapter Service from a Browser
 
Invoking the RFC Adapter Service from a Browser
*To invoke the service
1. In an interactive scenario, you can simply call it from a browser the same way you call any other service on Integration Server. The input parameters must then be URL encoded, for example: http://localhost:5555/invoke/app/rfcGetStructureDefinition?TABNAME=USER01
The response can then be rendered via an HTML template.
2. In a fully automated scenario your application would, however, send the request XML document to this service. A template for a valid request document for each function module can be generated from the Lookup menu by clicking the RFC-XML button. To invoke the RFC adapter service, you must post it in the HTTP body of request to the URL (as above). Your application must also set some keys in the HTTP Header:
POST /invoke/<your complete service name> HTTP/1.1
--> the service name to be called
Host: <xyz>
--> host of http client
Content-type: application/x-sap.rfc
--> you have to set the content type. When sending an RFC-XML
document, the content type should be application/x-sap.rfc
Cookie: ssnid=<4711>
--> This is optional. On the first connect Integration Server will generate
a session cookie. When you use this for the following
communication you will be assigned to the same Integration Server
session. If you do not use the session cookie a new Integration Server
session will be created with every HTTP request.
Content-Length: <the length of the HTTP Body>
The HTTP Body must consist of the XML document, encoded in RFC-XML. Depending on whether the call was processed successfully, you will get a response or an exception XML document. You can also force Adapter for SAP to invoke the function module with tRFC by setting a transaction ID in the Envelope of the XML document. However, you should bear in mind that only function modules without return parameters can be called with tRFC.
Tip:
To simulate a raw post, you can use the service pub.client:http.