Sunday, October 30, 2011

Tip2. Web Service Performance Tool

When you test web service server in tools such as SOAP UI, XML Spy, etc, let's see what you did.
You provides WSDL and the tool retrieves SOAP message structure, EndPointURL, soapAction, etc.
Likewise, if you know EndPointURL, soapAction, and SOAP request message formation, that's it.
Through this Web Service Performance tool, you just configure these information without having specific WSDL file.
It will return response SOAP message. And also you can concurrently invoke Web Service with multi-threads and it will show you the total and average elapsed times.

Tip2_WebService_Performance_Tool_For_JCAF.doc
Tip2_WebService_Performance_Tool.zip

Ex8. Dynamic Web Service Server Examples

In this article, it will show how to invoke Dynamic Web Service Server in JCAF with two examples.
And also show you how to create WSDL files for this dynamic web service server.

Refer to the below article for Generic Web Service Server Examples.
Example8_RealTime_WebServiceServerRR_For_JCAF.doc
Example8_RealTime(WebServiceServerRR).zip

Thursday, October 27, 2011

Ex7. Dynamic Web Service Client Examples

Batch RealTimeTransaction Type with Generic/Dynamic Web Service Client For JCAF
In this article, I will cover three different examples regarding Generic Web Service Clients.
1. Generic Web Service Client Collaborations over HTTP with HTTP Adapter
- Example shows how to invoke Generic Web Service Server though Generic Web Service Client.
2. Java API for Generic Web Service Client over HTTP

With this API, we will create two different SOAP messages and directly invoke Generic Web Service Server.
- One has 6 records in SOAP message and the other has 50,000 records in SOAP message.
3. Batch Script Utility with Java API for Generic Web Service Client over HTTP
-In general, to handle Big SOAP message for Web Service, it recommends MTOM (Message Transmission Optimization Mechanism) standard. Repository-Based JCAPS doesn’t support this standard. If you use MTOM, the soap message will be encoded based on BASE64 and will be attached over HTTP. BASE64 encoding always increases message by a third. So if you send 116 MB SOAP message through MTOM, actual message size will be 154 MB.
-Through this example, we will test 116 MB SOAP Message through Web Service Utility script without using MTOM.

Refer to the below article for Generic Web Service Client Examples.

CMAF5. Dynamic Web Service Client

In the previous article, I covered how to make generic Web Service Server. Now let’s move on to Generic Web Service Client over HTTP/HTTPS. In this article, I will cover two different kinds of Generic Web Service Clients. 
·   With HTTP Client Adapter (e*Way)
·   Java API for Generic Web Service Client

1. Generic Web Service Clients with HTTP Adapter 
  • svcWebServiceClient : Multithread Supports
  • svcWebServiceClientSequence : Single Thread to support sequential message orders
  • svcWebServiceClientSSL : Supports HTTPS protocol
2. Java API for Generic Web Service Client over HTTP - com.wwlee.jcaps.cs.webservice.WebServiceClient
- WebServiceClient API is Java API to invoke any kind of Web Service Server.
- This API also supports SAAJ (SOAP with Attachments API for Java) in order to download and upload file(s) through Web Service.
- Example
private void invokeDirectWebService( com.stc.connectors.jms.Message input, com.wwlee.jcaps.otd.common.eaicommonheader.ServiceInterface otdEAICommonHeaderIn, com.wwlee.jcaps.soap.envelope.Envelope_ otdSOAPEnvelope ) throws Exception{
 com.wwlee.jcaps.otd.common.eaisoapcommonbody.SOAPCommonBody otdSOAPCommonBody = new com.wwlee.jcaps.otd.common.eaisoapcommonbody.SOAPCommonBody();
 WebServiceClient webService = new WebServiceClient();
 String soapAction = otdEAICommonHeaderIn.getWebService().getWebServiceOutbound().getSOAPAction();
 webService.setRequestSOAPMessage( otdSOAPEnvelope, soapAction );
 String endpointURL = otdEAICommonHeaderIn.getWebService().getWebServiceOutbound().getEndPointLocation();
 String timeOutSeconds = StringUtil.setDefaultStringValue( otdEAICommonHeaderIn.getWebService().getWebServiceOutbound().getEndPointTimeoutSeconds(), "10" );
 webService.invoke( endpointURL, Integer.parseInt( timeOutSeconds ) );
 byte[] soapEnvelopeMessageBytes = webService.getResponseBytesSOAPMessage();
 otdSOAPEnvelope = (Envelope_) webService.getResponseOTDSOAPMessage();
 webService.getElapsedInvokingTime();
 /* Set Invoking Time */
otdEAICommonHeaderIn.getTimeTrackingsHeader().getComponentTimeTracking( countComponentTimeTracking ).setStartInvokingTime( webService.getStartInvokingTime() ); otdEAICommonHeaderIn.getTimeTrackingsHeader().getComponentTimeTracking( countComponentTimeTracking ).setEndInvokingTime( webService.getEndInvokingTime() ); otdEAICommonHeaderIn.getTimeTrackingsHeader().getComponentTimeTracking( countComponentTimeTracking ).setElapsedInvokingTime( webService.getElapsedInvokingTime() );
 if (webService.hasFault()) {
     logger.error( "+++++ Received Fault Message from WebService : " + otdSOAPEnvelope.getBody().getX__AnyText__( 0 ) + " +++++" );
     setEAPReprocess( input, otdEAICommonHeaderIn, "Fault Response Message", "Refer to Fault Message in CMSF" );
     logger.warn( "+++++ It will be sent to Common EAIReprocess Project in CMSF +++++" );
 } else {
     otdSOAPCommonBody.unmarshalFromString( otdSOAPEnvelope.getBody().getX__AnyText__( 0 ) );
     String status = otdSOAPCommonBody.getStatus();
     if (status.equalsIgnoreCase( "ERROR" )) {
         setEAPReprocess( input, otdEAICommonHeaderIn, "ERROR Response", otdSOAPCommonBody.getExceptionInfo().getExceptionMessage() );
         logger.warn( "+++++ It will be sent to Common EAIReprocess Project in CMSF +++++" );
     }
 }
}
Refer to the below article for Generic Web Service Client
CMAF5_Generic_Web_Service_Client_For_JCAF.doc

Sunday, October 23, 2011

Ex6. True Dynamic Routing with Generic Web Service Server Req

In Common Routing, you saw how message can be dynamically routed between JMS and Collaboration Services. In this article, we will see several different dynamic routing mechanisms by using Web Service Server Req Examples. You can apply this routing in any place within JCAPS.
  • Interface Key Based Routing
  • Common Header Based Routing
  • Content Based Routing
This articles has serveral examples for this dynamic routing.
For the detail things, refer to the below document.
Example5_6_RealTimeBatch(WebServiceServerReq).zip

Ex5. Generic Web Service Server Req in JCAPS

In this article, it will continuously cover a couple of things for Generic Web Service Server Req.
  • How to create WSDL for Web Service Server Req
  • Sample Example with PurchaseOrderReq Interface Key
 For the detail things, refer to the below document. Example5_6_RealTimeBatch(WebServiceServerReq).zip

CMAF4. Generic Web Service Server

I had another interesting thinking that 'Can I make generic web service server and client' so that our developer can only focus on its interface mapping? Initially it looked like dream. But this and the following articles will cover how 'Generic Web Service Server' can be exposed and 'Generic Web Service Client' can invoke to other Server, particularly over HTTP/HTTPS. With this approach, you don’t need to expose any addition web service.
This article will briefly cover the high level and peripheral OTDs for Web Service Server mode.
The next couple of articles will cover the examples for Web Services.

Refer to the below article for Generic Web Service Server
CMAF4_Generic_Web_Service_Server_For_JCAF.doc

Friday, October 21, 2011

CMAF3. JCAPS Common Routing

When I started the JCAF (JCAPS Common Architecture Framework) design, I deeply considered two factors.
    . What is the true reusable component?
    . How can the developer focus on interface transformation logic with this reusable component architecture?

This picture is the high level architecture diagram for CMAF (Common Architecture Framework).
The below example is from Batch Connectivity Map as part of examples for JCAF. There are two different things for JMS subscription and publication in Collaboration.  
· JMS Subscription
- In this example, there are 5 Collaborations subscribed to the same JMS queue, called queBatchTransform. How this scenario is possible? The answer is JMS message selector. Based on the transaction type, each Collaboration can share JMS queue or topic. To subscribe specific message to queBatchTransform, you can use JMS message selector.
- For Example, svcFileMappingExample uses JMS Message Selector Name with TARGET and its value with FileMappingExample.
- Most of Collaborations in JCAF are using JMS Message Selector Name with Target.
· JMS Publication
- In every Connectivity Map, Collaboration service seems to publish messages to the same JMS Queue, called queDummy. But this JMS Queue queDummy is actually dummy Queue.
- In the ustilities jar, it has static JMSOTD.sendTo() method in order to dynamically route message to a specific JMS Queue.

    public static void sendTo(JMS jms, String destinationName, String messageSelectorName, String messageSelectorValue, String correlationID, String message) throws JMSException
    public static void sendTo(JMS jms, String destinationName, String messageSelectorName, String messageSelectorValue, String correlationID, String message, String priority) throws
For the detail things, refer to the below document. There are a couple of examples in this blog. You can use the sample.
CMAF3_Common_Routing_For_JCAF.doc

Wednesday, October 19, 2011

CMAF2. MFT (Managed File Transfer)

Every business has a lot of file transferring applications. And also several commercial vendors have the dedicated file transferring products called MFT (Managed File Transfer). Even Gartner Group evaluates MFT products in Magic Quadrant. Let’s see what Gartner Group says.
According to Gartner Group:
Managed File Transfer (MFT)
suites allow businesses to manage and secure the transfer of data between two or more entities including applications and operating systems.
We use the term "managed file transfer" to reflect the growing desire of businesses to manage all aspects of a file transfer not just securing communication.
Gartner “firmly believe that 6570% of application integration, both internally and externally is being done using FTP.”
MFT Manages More Than You Think, and Governs Too.
  - Gartner ( Feb 3, 2010)
As one of architecture components in JCAF (JCAPS Common Architecture Framework), I developed MFT (Managed File Transfer). You don’t need to develop any batch applications to transfer files from/to Remote FTP/SFTP and DropZone area. Everything is configuration based. With Common Scheduler in JCAF, it will maximize your business investment and shorten your development life cycles.
Let's see what is MFT(Managed File Transfer) Framework Feature in JCAF.

  1. One of CMAF (Common Architecture Frameworks)
  2.  Based on JCAPS Batch eWays
  3.  Central Configuration Repository for MFT
  4.  Scheduling by single CMAF Common Scheduler (One of CMAF Frameworks)
  5.  Dynamic Common Routing for Down Stream Service
  6.  Supports 7 MFT Services
    - MFT DropZone
    - MFT SourcePattern (FTP / SFTP)
    - MFT Source (FTP/ SFTP)
    - MFT Destination (FTP / SFTP)
  7.  Integrated with CMSF (Common Service Framework) 
    - Alert, Log, Warn
    - MFT Message Tracking
  8.  Easy Transformation with JCAPS Collaboration
  9.  Automatic FTP/SFTP Connection Retry
  10.  Automatic File Retransferring
  11.  File Correlations Support
  12.  File Encryption / Decryption based on PGP
  13.  Runtime Change for MFT Configuration without Rebuilding or Redeploying
    - Through Reload utility, any changed information will be reflected on MFT
  14. No File Size Limitation – Depending on OS(Operating System)
    - Refer to Example3_Batch_BigFileHandling_For_JCAF.doc with 2GB file.
For the detail things, refer to the below document. There are a couple of examples in this blog. You can use the sample. If you want to know more such as File Correlations, let me know.
CMAF2_MFT(ManagedFileTransfer)_For_JCAF.doc

Monday, October 17, 2011

CMAF1. Common Scheduler

If you have 1000 interfaces which have different time schedule respectively, what's your solution in JCAPS?
·        Expose 1000 JCAPS Schedulers per each Interface
·        Use Unix Cron for Scheduling with 1000 registration
·        Use the commercial Job Scheduler
·        Other options which I don’t know.
Here is a good solution which you can use in JCAPS as a part of Collaboration Service. If you are familiar with Unix Crontab, you will quickly understand how to configure it. Whenever you add/update/delete the record in the table, you don’t need to redeploy or stop this JCAPS component.
1. Common Scheduler Characteristics
1.      Support Unix Crontab-like pattern
- * (Start wild character) support
- Multiple-Times Support with Common(,) or –(dash)
2.       With the different identifier, you can set the same interface key multiple times.
3.      In DAY_OF_MONTH column, you can include and exclude the following special day
- Company’s First Business Day of the Month
- Company’s Last Business Day of the Month
- Special Days of the Month for a Interface Key
*** In order to use it, you need to maintain FirstLastBusinessDay.properties file under $JCAPS_COMMON_ROOT/properties/CommonInterface directory.
4.      Enable and Disable the specific Interface key
- If you change ‘ENABLE’ column value to ‘N’, the interface will be disabled. Default is empty or ‘Y’
5.      Whenever you change or update the values, just run Reload Utility against svcCommonScheduler Service.
6.      Weekday : From Sun(0)  to Sat(6)
2. Example
For the more detailed information, refere to the below url document.
CMAF1_Common_Scheduler_For_JCAF.doc