... ...
<servlet>
<servlet-name>streamFLDHandler</servlet-name>
<servlet-class>proframe.core.ippr.http.ProFrameHttpStreamIppr</servlet-class>
<init-param>
<param-name>messageType</param-name>
<param-value>FLD</param-value>
</init-param>
<load-on-startup>-1</load-on-startup>
</servlet>
... ...
<servlet-mapping>
<servlet-name>streamFLDHandler</servlet-name>
<url-pattern>/FLDSERVICES/*</url-pattern>
</servlet-mapping>
... ...
TestPrj TesterSOSO2 testEmp 1 7788
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class TestProFrameFLDStream {
public static void main(String[] args) {
TestProFrameFLDStream tester = new TestProFrameFLDStream();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
File inFile = new File("D:/FLD.txt");
try {
FileInputStream fis = new FileInputStream(inFile);
byte[] inBuffer = new byte[2048];
int readLen = 0;
do {
readLen = fis.read(inBuffer);
bout.write(inBuffer, 0, readLen);
}
while(readLen == 2048);
bout.flush();
}
catch(FileNotFoundException e) {
e.printStackTrace();
}
catch(IOException e) {
e.printStackTrace();
}
byte[] inXML = bout.toByteArray();
System.out.println("\n\n\n\n\n");
System.out.println("###################### IN #######################");
System.out.println(new String(inXML));
byte[] outXML = tester.testXMLStream(inXML);
System.out.println("\n\n\n\n\n");
System.out.println("###################### OUT #######################");
System.out.println(new String(outXML));
}
public byte[] testXMLStream(byte[] inXML) {
DataOutputStream dout = null;
DataInputStream din = null;
ByteArrayOutputStream bout = null;
HttpURLConnection con = null;
int resCodes = 0;
try
{
URL url = new URL("http://192.168.20.182:19876/proframeWeb/FLDSERVICES/");
con = (HttpURLConnection)url.openConnection();
con.setDoOutput(true);
dout = new DataOutputStream(con.getOutputStream());
dout.write(inXML);
dout.flush();
resCodes = con.getResponseCode();
if(resCodes == HttpURLConnection.HTTP_OK)
{
din = new DataInputStream(con.getInputStream());
bout = new ByteArrayOutputStream();
byte[] outBuffer = new byte[2048];
int readLen = 0;
do {
bout.write(outBuffer, 0, readLen);
readLen = din.read(outBuffer);
}
while(readLen > 0);
bout.flush();
}
else {
throw new IOException(Integer.toString(resCodes));
}
}
catch(MalformedURLException e){
e.printStackTrace();
}
catch(IOException e){
e.printStackTrace();
}
finally {
try {
if(dout != null) dout.close();
if(din != null) din.close();
if(con != null) con.disconnect();
} catch(IOException e) {
e.printStackTrace();
}
}
return bout.toByteArray();
}
}
<configField id="CLASSPATH" value="/home/proframe/proframe/lib/engine/proframe.jar:/home/proframe/proframe/lib/common/log4j-1.2.14.jar:/home/proframe/proframe/lib/common/freemarker.jar:/home/proframe/proframe/lib/common/stax-api-1.0.1.jar:/home/proframe/proframe/lib/common/wstx-asl-3.1.1.jar:/home/proframe/proframe/lib/common/wstx-lgpl-3.1.1.jar:/home/proframe/proframe/lib/common/jaxb-api.jar:/home/proframe/proframe/lib/common/jaxb-impl.jar:/home/proframe/proframe/lib/common/jaxb-libs.jar:/home/proframe/proframe/lib/common/jaxb-xjc.jar:/home/proframe/proframe/lib/common/jaxp-api.jar:/home/proframe/proframe/lib/common/jax-qname.jar:/home/proframe/proframe/lib/common/relaxngDatatype.jar:/home/proframe/proframe/lib/common/xsdlib.jar:/home/proframe/proframe/lib/devsvr/smd_fm_gen.jar:/home/proframe/proframe/lib/devsvr/jsr173_api-1.0.0.jar:/home/proframe/proframe/lib/devsvr/mapper-rt.jar:/home/proframe/proframe/lib/devsvr/pfm_jaxb_model.jar:/home/proframe/proframe/lib/devsvr/xbean-2.1.0.jar:/home/proframe/proframe/lib/devsvr/mapper-cg.jar:/home/proframe/proframe/lib/devsvr/meta-schemas.jar:/home/proframe/proframe/lib/devsvr/smd-c-codegen.jar:/home/proframe/proframe/pfm/classes/PFM_IO:/home/proframe/proframe/pfm/classes/PFM_DBIO:/home/proframe/proframe/pfm/classes/PFM_RULE:/home/proframe/proframe/pfm/classes/PFM_MODULES" type="String" xmlns=""/>
<servlet>
<servlet-name>streamXMLHandler</servlet-name>
<servlet-class>proframe.core.ippr.http.ProFrameHttpStreamIppr</servlet-class>
<init-param>
<param-name>messageType</param-name>
<param-value>XML</param-value>
</init-param>
<load-on-startup>-1</load-on-startup>
</servlet>
... ...
<servlet-mapping>
<servlet-name>streamXMLHandler</servlet-name>
<url-pattern>/XMLSERVICES/*</url-pattern>
</servlet-mapping>
... ...
<?xml version="1.0" encoding="EUC-KR"?>
<message>
<proframeHeader>
<pfmAppName>tester</pfmAppName>
<pfmSvcName>Test001So</pfmSvcName>
<pfmFnName>insertXml</pfmFnName>
<pfmFnCd/>
<pfmGlobalNo/>
<pfmChnlType/>
<pfmEnvrFlag/>
<pfmTrFlag/>
<pfmTrDate/>
<pfmTrTime/>
<pfmClntIp/>
<pfmResponseType/>
<pfmResponseCode/>
<pfmResponseLogcd/>
<pfmResponseTitle/>
<pfmResponseBasc/>
<pfmResponseDtal/>
<pfmUserId/>
<pfmFiller/>
<pfmLangCode/>
</proframeHeader>
<systemHeader>
<pfmTermnNo/>
<pfmTermnPstn/>
<pfmUserHdqt/>
<pfmUserBrch/>
<pfmUserBuspl/>
<pfmUserAgncy/>
<filler/>
</systemHeader>
< PreEmpPersistListDto>
<empno>6666</empno>
<ename></ename>
<job></job>
<mgr></mgr>
<sal></sal>
<comm></comm>
<deptno>10</deptno>
</ PreEmpPersistListDto>
</message>
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class TestProFrameXMLStream {
public static void main(String[] args) {
TestProFrameXMLStream tester = new TestProFrameXMLStream();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
File inFile = new File("D:/XML.xml");
try {
FileInputStream fis = new FileInputStream(inFile);
byte[] inBuffer = new byte[2048];
int readLen = 0;
do {
readLen = fis.read(inBuffer);
bout.write(inBuffer, 0, readLen);
}
while(readLen == 2048);
bout.flush();
}
catch(FileNotFoundException e) {
e.printStackTrace();
}
catch(IOException e) {
e.printStackTrace();
}
byte[] inXML = bout.toByteArray();
System.out.println("\n\n\n\n\n");
System.out.println("###################### IN #######################");
System.out.println(new String(inXML));
byte[] outXML = tester.testXMLStream(inXML);
System.out.println("\n\n\n\n\n");
System.out.println("###################### OUT #######################");
System.out.println(new String(outXML));
}
public byte[] testXMLStream(byte[] inXML) {
DataOutputStream dout = null;
DataInputStream din = null;
ByteArrayOutputStream bout = null;
HttpURLConnection con = null;
int resCodes = 0;
try
{
URL url = new URL("http://192.168.11.174:9876/proframeWeb/XMLSERVICES/");
con = (HttpURLConnection)url.openConnection();
con.setDoOutput(true);
dout = new DataOutputStream(con.getOutputStream());
dout.write(inXML);
dout.flush();
resCodes = con.getResponseCode();
if(resCodes == HttpURLConnection.HTTP_OK)
{
din = new DataInputStream(con.getInputStream());
bout = new ByteArrayOutputStream();
byte[] outBuffer = new byte[2048];
int readLen = 0;
do {
bout.write(outBuffer, 0, readLen);
readLen = din.read(outBuffer);
}
while(readLen > 0);
bout.flush();
}
else {
throw new IOException(Integer.toString(resCodes));
}
}
catch(MalformedURLException e){
e.printStackTrace();
}
catch(IOException e){
e.printStackTrace();
}
finally {
try {
if(dout != null) dout.close();
if(din != null) din.close();
if(con != null) con.disconnect();
} catch(IOException e) {
e.printStackTrace();
}
}
return bout.toByteArray();
}
}
... ...
<servlet>
<servlet-name>streamDELIMITERHandler</servlet-name>
<servlet-class>proframe.core.ippr.http.ProFrameHttpStreamIppr</servlet-class>
<init-param>
<param-name>messageType</param-name>
<param-value>DELIMITER</param-value>
</init-param>
<load-on-startup>-1</load-on-startup>
</servlet>
... ...
<servlet-mapping>
<servlet-name>streamDELIMITERHandler</servlet-name>
<url-pattern>/DELIMITERSERVICES/*</url-pattern>
</servlet-mapping>
... ...
TestPrj,TesterSOSO2,testEmp,,,,,,,,,,,,,,,,,|,,,,,,,,|7788,,,,,,,,
... ...
<web-frame>
<record-cache>false</record-cache>
<datasource>proframeCache</datasource>
<fldmessage-suffix>MsgFld</fldmessage-suffix>
<part-delimiter>|</part-delimiter>
<data-delimiter>,</data-delimiter>
</web-frame>
... ...
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class TestProFrameDELIMITERStream {
public static void main(String[] args) {
TestProFrameDELIMITERStream tester = new TestProFrameDELIMITERStream();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
File inFile = new File("D:/DELIMITER.txt");
try {
FileInputStream fis = new FileInputStream(inFile);
byte[] inBuffer = new byte[2048];
int readLen = 0;
do {
readLen = fis.read(inBuffer);
bout.write(inBuffer, 0, readLen);
}
while(readLen == 2048);
bout.flush();
}
catch(FileNotFoundException e) {
e.printStackTrace();
}
catch(IOException e) {
e.printStackTrace();
}
byte[] inXML = bout.toByteArray();
System.out.println("\n\n\n\n\n");
System.out.println("###################### IN #######################");
System.out.println(new String(inXML));
byte[] outXML = tester.testXMLStream(inXML);
System.out.println("\n\n\n\n\n");
System.out.println("###################### OUT #######################");
System.out.println(new String(outXML));
}
public byte[] testXMLStream(byte[] inXML) {
DataOutputStream dout = null;
DataInputStream din = null;
ByteArrayOutputStream bout = null;
HttpURLConnection con = null;
int resCodes = 0;
try
{
URL url = new URL("http://192.168.20.182:19876/proframeWeb/DELIMITERSERVICES/");
con = (HttpURLConnection)url.openConnection();
con.setDoOutput(true);
dout = new DataOutputStream(con.getOutputStream());
dout.write(inXML);
dout.flush();
resCodes = con.getResponseCode();
if(resCodes == HttpURLConnection.HTTP_OK)
{
din = new DataInputStream(con.getInputStream());
bout = new ByteArrayOutputStream();
byte[] outBuffer = new byte[2048];
int readLen = 0;
do {
bout.write(outBuffer, 0, readLen);
readLen = din.read(outBuffer);
}
while(readLen > 0);
bout.flush();
}
else {
throw new IOException(Integer.toString(resCodes));
}
}
catch(MalformedURLException e){
e.printStackTrace();
}
catch(IOException e){
e.printStackTrace();
}
finally {
try {
if(dout != null) dout.close();
if(din != null) din.close();
if(con != null) con.disconnect();
} catch(IOException e) {
e.printStackTrace();
}
}
return bout.toByteArray();
}
}
[FreeMarker] FreeMarker Manual (1) | 2010.06.21 |
---|---|
[Eclipse Project] Common Navigator Framework (0) | 2010.06.20 |
Transaction (0) | 2010.06.15 |
vi 명령어 정리 (1) | 2010.06.15 |
[GEF] 초심자를 위한 자료 목록 (0) | 2010.06.15 |