...
Check the log of SMX and you must see something like this
Code Block |
---|
Next, open the web page of your application : http://localhost:8080/reportincidentweb/
...
17:45:18,041 | INFO | Component@c4d1a7 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-12 >>> --> setHeader(file), Pattern:InOnly, Properties:{CamelFileLockName=d:\temp\data\csv_tutorial.txt.camelLock, CamelFileLock=sun.nio.ch.FileLockImpl[0:9223372036854775807 exclusive valid]}, Headers:{CamelFileBatchSize=1, CamelFileNameOnly=csv_tutorial.txt, CamelFileBatchIndex=0, CamelFileLastModified=Thu Apr 30 16:56:48 CEST 2009, CamelFileRelativePath=d:\temp\data\csv_tutorial.txt, CamelFileAbsolutePath=d:\temp\data\csv_tutorial.txt, CamelFileLength=1106, CamelFileName=csv_tutorial.txt, CamelFilePath=d:\temp\data\csv_tutorial.txt, CamelFileParent=d:\temp\data, CamelFileAbsolute=true}, BodyType:org.apache.camel.component.file.GenericFile, Body:001,29-04-2009,Claus,Ibsen,incident camel-001,this is a report incident for camel-001,cibsen@gmail.com,+111 10 20 300
002,29-04-2009,Charles,Moulliard,incident smx-002,this is a report incident for smx-002,cmoulliard@gmail.com,+222 10 20 300
003,28-04-2009,Guillaume,Nodet,incident camel-123,this is a report incident for camel-123,gnodet@gmail.com,+333 10 20 300
004,25-04-2009,Gert,Vanthienen,incident camel-454,this is a report incident for camel-454,gvanthienen@gmail.com,+444 10 20 300
005,24-04-2009,James,Anstey,incident smx-023,this is a report incident for smx-023,janstey@gmail.com,+555 10 20 300
007,01-04-2009,Willem,Jiang,incident smx-456,this is a report incident for smx-456,wjiang@gmail.com,+666 10 20 300
008,27-04-2009,Matt,Raibble,incident appfuse-123,this is a report incident for appfuse-123,mraibble@gmail.com,+777 10 20 300
009,12-04-2009,Jean-Baptiste,Onofré,incident smx3-088,this is a report incident for smx3-088,cjbonofre@gmail.com,+888 10 20 300
010,17-04-2009,Hadrian,Zbarcea,incident camel-005,this is a report incident for camel-005,hzbarcea@gmail.com,+999 10 20 300
17:45:18,041 | INFO | Component@c4d1a7 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-12 >>> setHeader(file) --> unmarshal(), Pattern:InOnly, Properties:{CamelFileLockName=d:\temp\data\csv_tutorial.txt.camelLock, CamelFileLock=sun.nio.ch.FileLockImpl[0:9223372036854775807 exclusive valid]}, Headers:{CamelFileBatchSize=1, CamelFileNameOnly=csv_tutorial.txt, CamelFileBatchIndex=0, CamelFileLastModified=Thu Apr 30 16:56:48 CEST 2009, CamelFileRelativePath=d:\temp\data\csv_tutorial.txt, CamelFileAbsolutePath=d:\temp\data\csv_tutorial.txt, CamelFileLength=1106, CamelFileName=csv_tutorial.txt, CamelFilePath=d:\temp\data\csv_tutorial.txt, CamelFileParent=d:\temp\data, origin=file, CamelFileAbsolute=true}, BodyType:org.apache.camel.component.file.GenericFile, Body:001,29-04-2009,Claus,Ibsen,incident camel-001,this is a report incident for camel-001,cibsen@gmail.com,+111 10 20 300
002,29-04-2009,Charles,Moulliard,incident smx-002,this is a report incident for smx-002,cmoulliard@gmail.com,+222 10 20 300
003,28-04-2009,Guillaume,Nodet,incident camel-123,this is a report incident for camel-123,gnodet@gmail.com,+333 10 20 300
004,25-04-2009,Gert,Vanthienen,incident camel-454,this is a report incident for camel-454,gvanthienen@gmail.com,+444 10 20 300
005,24-04-2009,James,Anstey,incident smx-023,this is a report incident for smx-023,janstey@gmail.com,+555 10 20 300
007,01-04-2009,Willem,Jiang,incident smx-456,this is a report incident for smx-456,wjiang@gmail.com,+666 10 20 300
008,27-04-2009,Matt,Raibble,incident appfuse-123,this is a report incident for appfuse-123,mraibble@gmail.com,+777 10 20 300
009,12-04-2009,Jean-Baptiste,Onofré,incident smx3-088,this is a report incident for smx3-088,cjbonofre@gmail.com,+888 10 20 300
010,17-04-2009,Hadrian,Zbarcea,incident camel-005,this is a report incident for camel-005,hzbarcea@gmail.com,+999 10 20 300
17:45:18,135 | INFO | Component@c4d1a7 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-12 >>> unmarshal() --> to(queuingservice:queue:in), Pattern:InOnly, Properties:{CamelFileLockName=d:\temp\data\csv_tutorial.txt.camelLock, CamelFileLock=sun.nio.ch.FileLockImpl[0:9223372036854775807 exclusive valid]}, Headers:{CamelFileBatchSize=1, CamelFileNameOnly=csv_tutorial.txt, CamelFileBatchIndex=0, CamelFileLastModified=Thu Apr 30 16:56:48 CEST 2009, CamelFileRelativePath=d:\temp\data\csv_tutorial.txt, CamelFileAbsolutePath=d:\temp\data\csv_tutorial.txt, CamelFileLength=1106, CamelFileName=csv_tutorial.txt, CamelFilePath=d:\temp\data\csv_tutorial.txt, CamelFileParent=d:\temp\data, origin=file, CamelFileAbsolute=true}, BodyType:java.util.ArrayList, Body:[{org.apache.camel.example.reportincident.model.Incident=org.apache.camel.example.reportincident.model.Incident@158e458[
...
17:45:18,322 | INFO | ActiveMQ Task | FailoverTransport | sport.failover.FailoverTransport 714 | Successfully connected to tcp://localhost:61616
17:45:18,385 | INFO | nerContainer-814 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-13 >>> queuingservice:queue:in --> to(bean:incidentSaver?method=process), Pattern:InOnly, Headers:{CamelFileBatchSize=1, CamelFileNameOnly=csv_tutorial.txt, JMSCorrelationID=null, JMSMessageID=ID:dell-charles-3593-1241089972416-2:7:1:1:1, JMSExpiration=0, CamelFileRelativePath=d:\temp\data\csv_tutorial.txt, CamelFileLastModified=Thu Apr 30 16:56:48 CEST 2009, CamelFileBatchIndex=0, CamelFileAbsolutePath=d:\temp\data\csv_tutorial.txt, JMSDeliveryMode=2, origin=file, JMSPriority=4, JMSTimestamp=1241106318369, JMSReplyTo=null, JMSDestination=queue://in, JMSXGroupID=null, JMSType=null, JMSRedelivered=false, CamelFileName=csv_tutorial.txt, CamelFileLength=1106, CamelFilePath=d:\temp\data\csv_tutorial.txt, CamelFileParent=d:\temp\data, CamelFileAbsolute=true}, BodyType:java.util.ArrayList, Body:[{org.apache.camel.example.reportincident.model.Incident=org.apache.ca
...
17:45:18,322 | INFO | ActiveMQ Task | FailoverTransport | sport.failover.FailoverTransport 714 | Successfully connected to tcp://localhost:61616
17:45:18,385 | INFO | nerContainer-814 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-13 >>> queuingservice:queue:in --> to(bean:incidentSaver?method=process), Pattern:InOnly, Headers:{CamelFileBatchSize=1, CamelFileNameOnly=csv_tutorial.txt, JMSCorrelationID=null, JMSMessageID=ID:dell-charles-3593-1241089972416-2:7:1:1:1, JMSExpiration=0, CamelFileRelativePath=d:\temp\data\csv_tutorial.txt, CamelFileLastModified=Thu Apr 30 16:56:48 CEST 2009, CamelFileBatchIndex=0, CamelFileAbsolutePath=d:\temp\data\csv_tutorial.txt, JMSDeliveryMode=2, origin=file, JMSPriority=4, JMSTimestamp=1241106318369, JMSReplyTo=null, JMSDestination=queue://in, JMSXGroupID=null, JMSType=null, JMSRedelivered=false, CamelFileName=csv_tutorial.txt, CamelFileLength=1106, CamelFilePath=d:\temp\data\csv_tutorial.txt, CamelFileParent=d:\temp\data, CamelFileAbsolute=true}, BodyType:java.util.ArrayList, Body:[{org.apache.camel.example.reportincident.model.Incident=org.apache.ca
...
|
Next, open the web page of your application : http://localhost:8080/reportincidentweb/
Code Block |
---|
Report Incident HomePage
List of incidents coming from web services or file :
Id Incident Date Incident Ref First Name Last Name Summary Details Email Phone Origin Creation date
1 2009-01-29 00:04:00.0 666 Charles Moulliard This is a web service incident This is an web service report incident,This is an web service report incident. cmoulliard@gmail.com +222 10 20 30 40 webservice 2009-04-30 17:41:33.0
2 2009-01-15 00:04:00.0 703 Claus Ibsen incident camel-703 this is a report incident for camel-703 claus.ibsen@gmail.com +777 10 20 300 file 2009-04-30 17:44:27.0
3 2009-01-29 00:04:00.0 001 Claus Ibsen incident camel-001 this is a report incident for camel-001 cibsen@gmail.com +111 10 20 300 file 2009-04-30 17:45:18.0
4 2009-01-29 00:04:00.0 002 Charles Moulliard incident smx-002 this is a report incident for smx-002 cmoulliard@gmail.com +222 10 20 300 file 2009-04-30 17:45:18.0
5 2009-01-28 00:04:00.0 003 Guillaume Nodet incident camel-123 this is a report incident for camel-123 gnodet@gmail.com +333 10 20 300 file 2009-04-30 17:45:18.0
6 2009-01-25 00:04:00.0 004 Gert Vanthienen incident camel-454 this is a report incident for camel-454 gvanthienen@gmail.com +444 10 20 300 file 2009-04-30 17:45:18.0
7 2009-01-24 00:04:00.0 005 James Anstey incident smx-023 this is a report incident for smx-023 janstey@gmail.com +555 10 20 300 file 2009-04-30 17:45:18.0
8 2009-01-01 00:04:00.0 007 Willem Jiang incident smx-456 this is a report incident for smx-456 wjiang@gmail.com +666 10 20 300 file 2009-04-30 17:45:18.0
9 2009-01-27 00:04:00.0 008 Matt Raibble incident appfuse-123 this is a report incident for appfuse-123 mraibble@gmail.com +777 10 20 300 file 2009-04-30 17:45:18.0
10 2009-01-12 00:04:00.0 009 Jean-Baptiste Onofré incident smx3-088 this is a report incident for smx3-088 cjbonofre@gmail.com +888 10 20 300 file 2009-04-30 17:45:18.0
11 2009-01-17 00:04:00.0 010 Hadrian Zbarcea incident camel-005 this is a report incident for camel-005 hzbarcea@gmail.com +999 10 20 300 file 2009-04-30 17:45:18.0
|
Step 4 : Call a webservice
You can use the tool Soapui to call the web service of the application.
Use the following url from Soapui, to generate the client interface to communicate with the web service : http://localhost:8080/cxf/camel-example/incident?wsdl.
Call the web service with the request : http://localhost:8080/cxf/camel-example/incident
and the following SOAP message request by example :
Code Block | ||||
---|---|---|---|---|
| ||||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rep="http://reportincident.example.camel.apache.org">
<soapenv:Header/>
<soapenv:Body>
<rep:inputReportIncident>
<incidentId>000</incidentId>
<incidentDate>29-04-2009</incidentDate>
<givenName>Charles</givenName>
<familyName>Moulliard</familyName>
<summary>This is an web service report incident</summary>
<details>This is an web service report incident,This is an web service report incident.</details>
<email>cmoulliard@gmail.com</email>
<phone>+222 10 20 30 40</phone>
</rep:inputReportIncident>
</soapenv:Body>
</soapenv:Envelope>
|
Check the Servicemix log :
Code Block |
---|
17:41:33,463 | INFO | 14752391@qtp1-0 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-8 >>> /camel-example/incident --> setHeader(webservice), Pattern:InOut, Properties:{org.apache.camel.component.cxf.DataFormat=POJO, org.apache.cxf.service.model.BindingOperationInfo=[BindingOperationInfo: {http://reportincident.example.camel.apache.org}ReportIncident]}, Headers:{content-type=text/xml;charset=UTF-8, content.type=text/xml;charset=UTF-8, operationName=ReportIncident, Host=localhost:8080, Content-Length=701, SOAPAction="http://reportincident.example.camel.apache.org/ReportIncident", User-Agent=Jakarta Commons-HttpClient/3.1, operationNameSpace=http://reportincident.example.camel.apache.org}, BodyType:org.apache.cxf.message.MessageContentsList, Body:[org.apache.camel.example.reportincident.InputReportIncident@15099a1]
17:41:33,478 | INFO | 14752391@qtp1-0 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-8 >>> setHeader(webservice) --> convertBodyTo(), Pattern:InOut, Properties:{org.apache.camel.component.cxf.DataFormat=POJO, org.apache.cxf.service.model.BindingOperationInfo=[BindingOperationInfo: {http://reportincident.example.camel.apache.org}ReportIncident]}, Headers:{content-type=text/xml;charset=UTF-8, operationName=ReportIncident, content.type=text/xml;charset=UTF-8, Host=localhost:8080, Content-Length=701, SOAPAction="http://reportincident.example.camel.apache.org/ReportIncident", origin=webservice, User-Agent=Jakarta Commons-HttpClient/3.1, operationNameSpace=http://reportincident.example.camel.apache.org}, BodyType:org.apache.cxf.message.MessageContentsList, Body:[org.apache.camel.example.reportincident.InputReportIncident@15099a1]
17:41:33,494 | INFO | 14752391@qtp1-0 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-8 >>> convertBodyTo() --> to(bean:webservice), Pattern:InOut, Properties:{org.apache.camel.component.cxf.DataFormat=POJO, org.apache.cxf.service.model.BindingOperationInfo=[BindingOperationInfo: {http://reportincident.example.camel.apache.org}ReportIncident]}, Headers:{content-type=text/xml;charset=UTF-8, operationName=ReportIncident, content.type=text/xml;charset=UTF-8, Host=localhost:8080, Content-Length=701, SOAPAction="http://reportincident.example.camel.apache.org/ReportIncident", origin=webservice, User-Agent=Jakarta Commons-HttpClient/3.1, operationNameSpace=http://reportincident.example.camel.apache.org}, BodyType:org.apache.camel.example.reportincident.InputReportIncident, Body:org.apache.camel.example.reportincident.InputReportIncident@15099a1
17:41:33,510 | INFO | 14752391@qtp1-0 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-8 >>> to(bean:webservice) --> inOnly(queuingservice:queue:in), Pattern:InOut, Properties:{CamelBeanHolder=bean: webservice, org.apache.camel.component.cxf.DataFormat=POJO, org.apache.cxf.service.model.BindingOperationInfo=[BindingOperationInfo: {http://reportincident.example.camel.apache.org}ReportIncident]}, Headers:{origin=webservice}, BodyType:java.util.ArrayList, Body:[{org.apache.camel.example.reportincident.model.Incident=org.apache.camel.example.reportincident.model.Incident@1a6895c[
incidentId=0
incidentRef=666
incidentDate=Thu Jan 29 00:04:00 CET 2009
givenName=Charles
familyName=Moulliard
summary=This is a web service incident
details=This is an web service report incident,This is an web service report incident.
email=cmoulliard@gmail.com
phone=+222 10 20 30 40
creationUser=webservice
creationDate=Thu Apr 30 17:41:33 CEST 2009
]}]
17:41:33,619 | INFO | ActiveMQ Task | FailoverTransport | sport.failover.FailoverTransport 714 | Successfully connected to tcp://localhost:61616
17:41:33,650 | INFO | 14752391@qtp1-0 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-8 >>> inOnly(queuingservice:queue:in) --> transform(), Pattern:InOnly, Properties:{CamelBeanHolder=bean: webservice, org.apache.camel.component.cxf.DataFormat=POJO, org.apache.cxf.service.model.BindingOperationInfo=[BindingOperationInfo: {http://reportincident.example.camel.apache.org}ReportIncident]}, Headers:{origin=webservice}, BodyType:java.util.ArrayList, Body:[{org.apache.camel.example.reportincident.model.Incident=org.apache.camel.example.reportincident.model.Incident@1a6895c[
incidentId=0
incidentRef=666
incidentDate=Thu Jan 29 00:04:00 CET 2009
givenName=Charles
familyName=Moulliard
summary=This is a web service incident
details=This is an web service report incident,This is an web service report incident.
email=cmoulliard@gmail.com
phone=+222 10 20 30 40
creationUser=webservice
creationDate=Thu Apr 30 17:41:33 CEST 2009
]}]
17:41:33,681 | INFO | nerContainer-589 | TraceInterceptor | rg.apache.camel.processor.Logger 88 | ID-dell-charles-2274-1241105486478-2-9 >>> queuingservice:queue:in --> to(bean:incidentSaver?method=process), Pattern:InOnly, Headers:{JMSXGroupID=null, JMSCorrelationID=null, JMSType=null, JMSExpiration=0, JMSMessageID=ID:dell-charles-3593-1241089972416-2:5:1:1:1, JMSRedelivered=false, JMSDeliveryMode=2, origin=webservice, JMSPriority=4, JMSReplyTo=null, JMSTimestamp=1241106093635, JMSDestination=queue://in}, BodyType:java.util.ArrayList, Body:[{org.apache.camel.example.reportincident.model.Incident=org.apache.camel.example.reportincident.model.Incident@37a96[
incidentId=0
incidentRef=666
incidentDate=Thu Jan 29 00:04:00 CET 2009
givenName=Charles
familyName=Moulliard
summary=This is a web service incident
details=This is an web service report incident,This |
Step 4 : Call a webservice
You can use the tool Soapui to call the web service of the application.
Use the following url from Soapui, to generate the client interface to communicate with the web service : http://localhost:8080/cxf/camel-example/incident?wsdl.
Call the web service with the request : http://localhost:8080/cxf/camel-example/incident
and the following SOAP message request by example :
Code Block | ||
---|---|---|
xml | xml | <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rep="http://reportincident.example.camel.apache.org"> <soapenv:Header/> <soapenv:Body> <rep:inputReportIncident> <incidentId>000</incidentId> <incidentDate>29-04-2009</incidentDate> <givenName>Charles</givenName> <familyName>Moulliard</familyName> <summary>This is an web service report incident</summary>incident. email=cmoulliard@gmail.com phone=+222 10 20 30 40 <details>This iscreationUser=webservice an webcreationDate=Thu serviceApr report incident, This is an web service report incident, 30 17:41:33 CEST 2009 ]}] |
and web screen result : http://localhost:8080/reportincidentweb/
Code Block |
---|
Report Incident HomePage List of incidents coming from web services or file : Id Incident Date Incident Ref First Name Last Name Summary Details Email Phone Origin Creation date 1 2009-01-29 00:04:00.0 666 Charles Moulliard This is a web service incident This is an web service report incident, This is an web service report incident </details> <email>cmoulliard@gmail.com</email> <phone>. cmoulliard@gmail.com +222 10 20 30 40</phone> </rep:inputReportIncident> </soapenv:Body> </soapenv:Envelope> |
Check the Servicemix log :
...
and web screen result : http://localhost:8080/reportincidentweb/
40 webservice 2009-04-30 17:41:33.0
|
Conclusion
TODO
Links
- Part 1 : simple example
- Part 2a : real example, architecture, project setup, database creation
- Part 2b : transform projects in bundles
- Part 2c : add infrastructure and routing
- Part 2d : web and deployment
...