Google Analytics

 

Wednesday, June 6, 2007

Method to check Connection of WSDL (On RAD 6.0)

1. Checking Connection by telnet command

#telnet [IP Address] [Port]

If it doesn't timeout, it connection to server is work.
2. Checking for HTTPS. If it is https, it can trust certification (It should trust certification on Server). You can config on Websphere 6.1 following by this link.
3. Test WSDL by right click at wsdl file then select "Web Services a Test with Web Services Explorer"
4. If it test pass in choice 3, then we will generate stub file for call Web Service.--> right click at wsdl file then select "Web Services a Generate Java bean" skeleton and next.
Example Code For Call Web Service
UMarket_PortType service = new UMarket_PortTypeProxy();
StandardBizRequest request = new StandardBizRequest();
StandardBizResponse response = service.activate(request);

4. If you can't call Web Service (Exception about Exception BeanDeSerializable) , you will generate stub file in Eclipse (RAD 6.0 --> axis is old).
Example Code For Call Web Service
PctVoiceFaxServiceSoapBindingStub stub = null;
VoiceFaxServiceServiceLocator locator = new VoiceFaxServiceServiceLocator();
VoiceFaxService faxservice = locator.getPctVoiceFaxService(new java.net.URL(faxURL));
stub =(PctVoiceFaxServiceSoapBindingStub)faxservice;


PS. In case, you ca find wsdl menu. it can add at
1. Window --> Preferences
2. go to Workbence --> Capabilities
3. select all in Web Service Developer

Tuesday, June 5, 2007

Config Trust Certification On Websphere 6.1

It have 2 mehod
1. Reading from IP and Port that you want to certification.
2. use .cer file for adding to server.

Method of adding certification on websphere 6.1
1. Click Menu Security --> SSL certificate and key management
2. Click Key stores and certificates
3. Select NodeDefaultTrustStore
4. Click Signer certificates
5. you can select
     5.1 Retrieve from port --> Using websphere 6.1 retreive from server that you want certification.
     5.2 Config Port --> Using .cer file that you write path (.cer file) for trust certification.
6. Restart Web Server, It will success.

PS. It should only trust certification on Server but shouldn't trust certification on Application.

Monday, June 4, 2007

Solve Problem Broken Pipe on Websphere 6.1

When I use datasource on Websphere, It will broken pipe. It will happen because database is back firewall or router (Set drop connection when connection is ideal.).
I solve by I test connection (every 10 second.) --> It work but system will performance drop.

In Websphere 6.x, Solve following
1. In Admin Console, Going to Resource --> Datasource --> Name of Datasource
2. Click WebSphere Application Server data source properties
3. Select Pretest connection properties (For Config Test Connection)

Config Encode UTF-8 On Websphere 6.1

Java Encode UTF-8 On Websphere 6.1
1. Select Application Server --> choose server that you will change encode.
2. After that select Java and Process Management (in section Server Infrastructure) --> Process Definition
3. After that select Java Virtual Machine (in section Additional Properties)
4. Add data in Generic JVM arguments, It use -Dclient.encoding.override=UTF-8
5. Save then Application Server will encode UTF-8.

Sunday, June 3, 2007

Processing Create .SFF file Format (Structured Fax Format)

It will create from pdf file --> tiff file --> sff file. Important for tiff file, it will only width = 1728 . If you are not use this width, It may not work. Use Library
1. Use iText for create PDF File --> download
2. Use JAI (Java Advance Imaging) For Convert PDF to TIFF File --> download
3. Use mms-computing (mmsc) For Convert TIFF to SFF File --> download

Step Create SFF File
1. Create PDF File.

Example
String filename = "pdfTest.pdf";
Rectangle rectangler = new Rectangle(1728,2292);
Document document = new Document(rectangler);
PdfWriter.getInstance(document, new FileOutputStream(filename));
document.open();
document.add(new Paragraph("Hello World",new Font(Font.BOLD,75)));
document.close();


2. Convert PDF to TIFF File.


Example
PdfDecoder decoder = new PdfDecoder();
decoder.openPdfArray(bai);
decoder.setSize(100, 100);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
if (decoder.isFileViewable()) {
try {
for (int i = 0; i < decoder.getPageCount(); i++) {
int pageNumber = i + 1;
BufferedImage imageTemp = decoder.getPageAsImage(pageNumber);
BufferedImage image = new Binarization(50).filter(imageTemp);
TIFFEncodeParam tiff = new TIFFEncodeParam();
OutputStream outp = (new FileOutputStream("tiffTest.tiff"));
ImageEncoder encoder = com.sun.media.jai.codec.ImageCodec.createImageEncoder("tiff", outp, tiff);
encoder.encode(image);
outp.close();
}
} finally {
if (baos != null) {
baos.flush();
baos.close();
}
}
}
decoder.closePdfFile();


3. Convert TIFF to SFF File. I use open TIFF File and save to SFF File. You can find it by see at uk.co.mmscomputing.application.imageviewer.ImageTab class --> Method save and open.