Sample program source code:
1 | import java.io.BufferedOutputStream; |
The following data are obtained from the arguments at runtime:
Argument | Variable | Use |
---|---|---|
1 | hostName | CEP Server host name |
2 | engineName | CEP engine name |
3 | dataType | Event data format |
4 | charSet | Character set |
5 | eventTypeId | Event type ID |
6 | data | Event data |
7 | lWait | Data transmission wait time |
8 | loop | Data transmission count |
An example of sample execution is shown below.
In this example, debug information is output to the engine log by using DebugLogListener.
Command execution result
# java -cp ./ SoapClient localhost CepEngine CSV UTF-8 CSVEvent SOAP,CSV,%COUNTER% 1 3 <ENTER>
<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/env
elope/"><S:Body><ns2:notifyResponse xmlns:ns2="http://adapter.front.cep.cspf.fujitsu.com/"><re
turn>Code=0 Message=Sending message completed normally.</return></ns2:notifyResponse></S:Body>
</S:Envelope>
<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/env
elope/"><S:Body><ns2:notifyResponse xmlns:ns2="http://adapter.front.cep.cspf.fujitsu.com/"><re
turn>Code=0 Message=Sending message completed normally.</return></ns2:notifyResponse></S:Body>
</S:Envelope>
<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/env
elope/"><S:Body><ns2:notifyResponse xmlns:ns2="http://adapter.front.cep.cspf.fujitsu.com/"><re
turn>Code=0 Message=Sending message completed normally.</return></ns2:notifyResponse></S:Body>
</S:Envelope>
Please note that we added newlines in the example above (lines 2 to 4, 6 to 8, and 10 to 12) for readability only - the actual output does not have a newline.
Engine log output result
2012-07-29 13:01:20,693 [DEBUG] abc:length=1
abc[0]
operation :CSV: String
count :0: String
ID :SOAP: String
2012-07-29 13:01:20,730 [DEBUG] abc:length=1
abc[0]
operation :CSV: String
count :1: String
ID :SOAP: String
2012-07-29 13:01:20,768 [DEBUG] abc:length=1
abc[0]
operation :CSV: String
count :2: String
ID :SOAP: String
An example of sample execution is shown below.
In this example, debug information is output to the engine log by using DebugLogListener.
Note
In case XML data is sent through SOAP adapter, enclose the data with CDATA as described in the command execution result below.
Command execution result
# java -cp ./ SoapClient localhost CepEngine XML UTF-8 XMLEvent '<![CDATA[<?xml version="1.0"\
encoding="UTF-8"?><XMLEvent><ID>SOAP</ID> <operation>XML</operation>\ <count>%COUNTER%</count></XMLEvent>]]>' 1 3 <ENTER>
<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/env
elope/"><S:Body><ns2:notifyResponse xmlns:ns2="http://adapter.front.cep.cspf.fujitsu.com/"><re
turn>Code=0 Message=Sending message completed normally.</return></ns2:notifyResponse></S:Body>
</S:Envelope>
<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/env
elope/"><S:Body><ns2:notifyResponse xmlns:ns2="http://adapter.front.cep.cspf.fujitsu.com/"><re
turn>Code=0 Message=Sending message completed normally.</return></ns2:notifyResponse></S:Body>
</S:Envelope>
<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/env
elope/"><S:Body><ns2:notifyResponse xmlns:ns2="http://adapter.front.cep.cspf.fujitsu.com/"><re
turn>Code=0 Message=Sending message completed normally.</return></ns2:notifyResponse></S:Body>
</S:Envelope>
Please note that we added backslash ("\") and newline characters in the command line example above for readability only - the actual command line does not have a backslash and newline.
Please note that we added newlines in the output example above (lines 4 to 6, 8 to 10, and 12 to 14) for readability only - the actual output does not have a newline.
Engine log output result
2012-07-29 13:02:21,860 [DEBUG] abc--0:length=1
abc--0[0]
operation :XML: String
count :0: String
ID :SOAP: String
2012-07-29 13:02:21,900 [DEBUG] abc--0:length=1
abc--0[0]
operation :XML: String
count :1: String
ID :SOAP: String
2012-07-29 13:02:21,935 [DEBUG] abc--0:length=1
abc--0[0]
operation :XML: String
count :2: String
ID :SOAP: String