!--a11y-->
IDoc Receiver as a Windows
Service 
The windows service sample takes the SAP IDOC Receiver component and deploys it as a Windows Service. You can see:
· How RFC servers and Windows Services are similar
· How to install a Windows Service that is also an SAP RFC .NET server
· Basic functions of the IDOC Receiver
· How to manage the connection parameters in the Windows Service properties
Before running this sample, you must install it using the Visual Studio utility Installutil.exe.
Using
the Visual Studio .NET command line, navigate to the folder containing
Installutil IdocReceiverService.exe (for example,
SAP .NET
Connector\Samples\IdocReceiverService\bin\Debug).
Run the command Installutil IdocReceiverService.exe. This should install the Windows Service. You can verify this by looking at the Services manager in the Administrative Tools. The Service name is .Net connector Idoc Service.

To
uninstall the Windows service run the command
Installutil -u IdocReceiverService.exe.
You set the SAP connection string in this service’s Start parametersproperty. For example if your TCP/IP destination used the program ID of myProgIDand your SAP system ran on your local machine, then the start parameters would be:
-amyProgID –glocalhost –xSAPGW00.
Messages are logged to the Windows Application Event Viewer. When received, SAP IDOCs are appended to the following file: C:\temp\idoc.txt.
To enable your system to send IDOCS you must have a TCP/IP destination (type registration), a configured partner profile (WE20) and a configured TRFC Port (WE21). The Mini SAP Web Application Server 6.20 supports the IDOC type EXCHANGE_RATE01. For convenience, you can find a sample IDOC file in the IDOC submitter sample’s SampleIdoc folder. If you have no IDOCs on your system you can submit this IDOC using the IdocSubmit sample application. Then use the IDOC test utility (WE19), change the IDOC header and submit it as an outbound IDOC to the TRFC Port representing this IdocReceiver sample.