I/F 구현시 소스 시스템에서 생성한 데이터에 대해서 XML으로 매핑 전송 처리시 invalid XML character 또는 not well-formed 등의 에러 발생시 의심해볼만한 내용임
XML 표준에서는 아래와 같이 Character Range가 존재함 (xml version 1.0 기준 : http://www.w3.org/TR/2004/REC-xml-20040204/#NT-Char)
Character Range [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */  | 
관련 범위외 문자를 제거는 webMethods의 경우 아래와 같이 서비스를 만들어서 처리 가능함
String IN_STR = IDataUtil.getString(pipeline.getCursor(), "IN_STR");
String OUT_STR = null;
String rtnMsg = null;
try{
	if(IN_STR != null && IN_STR.length() > 0){
		StringBuffer filteredString = new StringBuffer();
		char current;
		for (int i = 0; i < IN_STR.length(); i++) {
			current = IN_STR.charAt(i);
			if ((current == 0x9) || //
			    (current == 0xA) || //
			    (current == 0xD) || //
			    ((current >= 0x20) && (current <= 0xD7FF)) || // 
			    ((current >= 0xE000) && (current <= 0xFFFD)) || //
			    ((current >= 0x10000) && (current <= 0x10FFFF))) 
			{
			    filteredString.append(current);
			}
		}
		OUT_STR = filteredString.toString();
	}
}catch(Exception e){
	rtnMsg = e.toString();
}
IDataUtil.put(pipeline.getCursor(),"OUT_STR", OUT_STR);
IDataUtil.put(pipeline.getCursor(),"rtnMsg", rtnMsg);
'Etc.' 카테고리의 다른 글
| [Etc] telnet 자동 로그인 Shell Script (0) | 2013.08.20 | 
|---|---|
| [Etc] 오라클 10g이상에서 CLOB INSERT 방법 (0) | 2013.08.12 | 
| [MS-SQL 2008] An error occurred while performing the operation: '.1005' 근처의 구문이 잘못되었습니다. (0) | 2013.08.07 | 
| [Etc] FTP Code 요약 (0) | 2013.08.05 | 
| [Etc] Oracle Stored Procedure 호출 및 개발시 유의할 사례 (0) | 2013.08.05 | 
