シナリオ: 復帰または改行文字を含む入力 XML メッセージを構文解析します。あるいは XML エレメントに復帰改行文字を含む出力 XML メッセージを作成します。 しかし、出力メッセージには復帰文字の一部またはすべてがありません。
説明: XML 仕様に記述されているように、これは正しい動作であり、XML、XMLNS、または XMLNSC ドメインで起こります。
XML では、主要な行分離文字は改行文字です。 復帰文字も XML 文書に受け入れられますが、XML パーサーは復帰改行文字を単一の改行文字に正規化します。 詳しくは、最新の XML 仕様 (Extensible Markup Language (XML)) の、特に Section 2.11『End of Line Handling』を参照してください。
メッセージが WebSphere MQ メッセージの一部として着信したが、MQMD.CodedCharSetId が XML テキストのビット・ストリームを正しく表していない。
マークアップと見なされる文字を使用した。
解決策:
送信アプリケーションが有効なデータのみを送信していることを確認する。
しかし、無効文字が XML メッセージに含まれるのを回避できない場合は、それを BLOB ドメインで表し、ESQL REPLACE 関数を使って無効文字を置換または削除します。
その後、変更したビット・ストリームを必要な XML パーサーに割り当てることができます。
XML 仕様によると、CDATA セクションは、マークアップとして解釈される文字を保護するためにのみ使用できます。 これは、無効文字またはバイナリー・データを XML パーサーから保護するために使用することはできません。
入力 XML メッセージにバイナリー・データが含まれる場合には、このデータを基本エンコード・バイナリーのエンコード・データとして表すよう、送信アプリケーションに変更が加えられていることを確認する。 アプリケーションを変更できない場合、メッセージを BLOB ドメインで表し、必要な XML パーサーにビット・ストリームが割り当てられる前に、バイナリー・データを抜き出して置換します。
着信 XML メッセージが正しい MQMD.CodedCharSetId で表されていることを確認する。
XMLWorker::initializeParse file:C:¥s000¥src¥cpi¥pwf¥xml¥xmlworker.cpp
line:126 message:5409.BIPmsgs
No dictionary present have you specified Wire Format 'XML' in error? ,
UserTrace BIP5409E: XML Worker: Wire Format 'XML' specified.
Default MRM XML settings are being used because wire format
identifier 'XML' was specified and not found.
This can be due to an incorrect setting of the wire format
identifier in a message.
解決策
2: 定義した形式の ID を誤って入力した場合は、コードを訂正して再試行します。 デフォルトのアクションが実行されないようにしたい場合は、
必要な結果を作成する物理層を定義します。
CALL CopyMessageHeaders();
DECLARE outRef REFERENCE TO OutputRoot;
CREATE LASTCHILD OF outRef AS outRef NAME 'BLOB';
CREATE LASTCHILD OF outRef NAME 'BLOB' VALUE X'01';
CALL CopyMessageHeaders();
DECLARE outRef REFERENCE TO OutputRoot;
CREATE LASTCHILD OF outRef AS outRef DOMAIN 'BLOB' NAME 'BLOB';
CREATE LASTCHILD OF outRef NAME 'BLOB' VALUE X'01';
create procedure parseWAS_JMS(IN InputMessage reference,IN OutputMessage reference)
/***********************************************************************
* convert a WAS/JMS message to the correct format for the MIME parser
***********************************************************************/
begin
-- get the data as a BLOB
declare body BLOB InputMessage.BLOB.BLOB;
-- get the Content-Type value from the RFH2 header. Content-Type is the only
-- header which is critical for the MIME parser, but the same approach can be
-- used for any MIME headers which have been stored under the RFH2 header.
declare contentType char InputMessage.MQRFH2.usr.contentType;
-- add the contentType to the bit stream as part of an RFC822 header block
set body = cast(('Content-Type: '||contentType) as blob ccsid 819)||x'0d0a0d0a'||body;
-- invoke MIME parser on the modified bit stream
CREATE LASTCHILD OF OutputMessage DOMAIN('MIME') PARSE(body);
end;
create procedure writeWAS_JMS(IN OutputTree reference,IN boundary char)
/***************************************************************************
* Serialise a MIME tree as normal, but then strip off any initial headers
* and save the Content-Type value in the RFH2 header as expected by WAS/JMS.
* Note: boundary - must be supplied with the leading hyphen pair
***************************************************************************/
begin
-- convert MIME subtree to BLOB
declare body BLOB asbitstream(OutputTree.MIME);
-- locate first occurrence of boundary and discard any data before this
declare firstBoundary integer;
set firstBoundary = position (cast(boundary as blob ccsid 819) in body);
set body = substring(body from firstBoundary);
-- save the MIME Content-Type value in the RFH2 header. Any other MIME
-- headers which need to be preserved in the RFH2 header can be handled
-- in the same way
set OutputTree.MQRFH2.usr."contentType" = OutputTree.MIME."Content-Type";
-- clear the MIME tree and create a new BLOB child for the modified body
set OutputTree.MIME = null;
CREATE LASTCHILD OF OutputTree DOMAIN('BLOB')PARSE(body);
end
create procedure getBoundary(IN ct reference,OUT boundary char)
/*****************************************************************
* return value of the boundary parameter from a Content-Type value
******************************************************************/
begin
declare boundaryStart integer;
declare boundaryEnd integer;
set boundaryStart = position('boundary=' in ct) + 9;
set boundaryEnd = position(';' in ct from boundaryStart);
if (boundaryStart <> 0) then
if (boundaryEnd <> 0) then
set boundary = substring(ct from boundaryStart for boundaryEnd-boundaryStart);
else
set boundary = substring(ct from boundaryStart);
end if;
end if;
end;
Exception in thread "Thread-15" java/lang/StackOverflowError: operating system stack overflow
at com/ibm/broker/plugin/MbOutputTerminal._propagate (Native Method)
at com/ibm/broker/plugin/MbOutputTerminal.propagate (MbOutputTerminal.java:103)
at com/ibm/xsl/mqsi/XMLTransformNode.evaluate (XMLTransformNode.java:1002)
at com/ibm/broker/plugin/MbNode.evaluate (MbNode.java:1434)
at com/ibm/broker/plugin/MbOutputTerminal._propagate (Native Method)
at com/ibm/broker/plugin/MbOutputTerminal.propagate (MbOutputTerminal.java:103)
at com/ibm/xsl/mqsi/XMLTransformNode.evaluate (XMLTransformNode.java:1002)
at com/ibm/broker/plugin/MbNode.evaluate (MbNode.java:1434)
at com/ibm/broker/plugin/MbOutputTerminal._propagate (Native Method)
at com/ibm/broker/plugin/MbOutputTerminal.propagate (MbOutputTerminal.java:103)
at com/ibm/xsl/mqsi/XMLTransformNode.evaluate (XMLTransformNode.java:1002)
at com/ibm/broker/plugin/MbNode.evaluate (MbNode.java:1434)
-Xmca32K RAM class segment increment
-Xmco128K ROM class segment increment
-Xmns0K initial new space size
-Xmnx0K maximum new space size
-Xms125000K initial memory size
-Xmos125000K initial old space size
-Xmox250000K maximum old space size
-Xmx250000K memory maximum
-Xmr16K remembered set size
-Xlp0K large page size
available large page sizes: 4K 16M
-Xmso256K OS thread stack size
-Xiss2K java thread stack initial size
-Xssi16K java thread stack increment
-Xss256K java thread stack maximum size
-Xscmx16M shared class cache size
Note: The stack size defaults to 256K.