...
Download the following files from https://github.com/wso2/bam-data-publishers/tree/master/WCF/WCFMessagePublisher/bin/Release:
- WCFMessageInterceptor.dll
- WCFMessagePublisher.dll
- WSO2BamRestApi.dll
Copy the .dll files to the bin directory of WCF-Service Application.
Create the file
IISMessageInterceptor.config
in the parent directory of where you hosted the WCF-Service application. For example, if the service you host is iniis-express
, then, the config fileIISMessageInterceptor.config
needs to be created in the home directory ofiis_express
, which isC:\Program Files (x86)\IIS Express
, in Windows, by default.
This is a normal XML file containing the<RestApi>
parent element, which contains mandatory sub elements such as host (ip-address), port, username and password. For example,Code Block language html/xml <RestApi> <host>localhost</host> <port>9443</port> <username>admin</username> <password>admin</password> </RestApi>
Bind the
WCFMessagePublisher.dll
to the application using .net configuration.Add the following configuration to the Xpath location
configuration/system.serviceModel
of the .net configuration file (App.config/Web.config
) and bind the WCF Message Publisher to the application.
...
Code Block language html/xml <protocolMapping> <add scheme="http" binding="customBinding"/> </protocolMapping> <bindings> <customBinding> <binding> <BAMPublisher/> <httpTransport/> </binding> </customBinding> </bindings> <extensions> <bindingElementExtensions> <add name="BAMPublisher" type="WCFMessagePublisher.BAMPublisherElement, WCFMessagePublisher"/> </bindingElementExtensions> </extensions>
In the above configuration,
BAMPublisherElement.BAMPublisherElement
is the binding class to the applicationWCFMessagePublisher
is the assembly(.dll)
...
- name
...
- Start the WSO2
...
- BAM server.
...
- Call your service and see the data on BAM.
...