For each message this adapter receives, it posts the message in XML format to an HTTP server
Property Name (screen) |
Property Name (Attach Adapter) |
Type |
Description |
---|---|---|---|
URL |
URL |
String |
The URL to which the message should be posted. |
XSL Template |
XSLTemplate |
String |
XSL Template for converting XML message. This property is optional. See the description below. |
The XSL template can be used for converting the raw XML message to some other format.
To convert the raw XML to a SOAP call, you can use an XSL template similar to the one below. This example is based on raw data from Sybase CEP that consists of two fields per message, Symbol and Price):
<?xml version="1.0" ?> <xsl:stylesheet xmlns:c8=http://www.sybase.com/cpx/2004/03/ xmlns:xsl=http://www.w3.org/1999/XSL/Transform version="1.0"> <!-- Specify lookup key --> <xsl:key name="FieldName" match="c8:Tuple/c8:Field" use="@Name" /> <xsl:template match="/"> <soap:Envelope xmlns:soap=http://www.w3.org/2001/12/soap-envelope soap:encodingStyle=http://www.w3.org/2001/12/soap-encoding> <soap:Body xmlns:m=http://www.example.org/stock> <m:SetStockAlert> <m:StockName> <xsl:value-of select="key('FieldName','Symbol')"/> </m:StockName> <m:StockPrice> <xsl:value-of select="key('FieldName','Price')"/> </m:StockPrice> </m:SetStockAlert> </soap:Body> </soap:Envelope> </xsl:template> </xsl:stylesheet>
If more customization is needed (for example, for custom HTTP headers), you can copy and modify the adapter code in the file .../sybasec8/server/sdk/c/examples/c8_write_xml_over_http.cpp
To create a customized version of this adapter, perform the following:
Copy and modify the files c8_rss_reader.cpp and c8_rss_reader.adl.
Compile the .cpp file into a shared object library (.so) or dynamic link library (.dll).
Copy the compiled file into the server's bin directory. Copy the .adl file into the server and Studio plugins directories.
This is an in-process adapter. This code can be modified and compiled into an in-process adapter. For more information about how to compile in-process adapters written in C, see Sybase CEP C/C++ SDK.