2016-05-30 8 views
0

WSO2 ESB 4.9.0を使用すると、外部(バックエンド)サービスがMTOM添付ファイルを返すクライアントWS-Securityを有効にしてエンドポイントのポリシーを設定できますか?MTO2を使用したWSO2 ESB WS-

要件:外部バックエンドサービスでは、要求に署名が必要で、署名されていない(平文)MTOM応答が返されます(オプション)。

はできるだけ早くランパートモジュールが締結され、着信ポリシーが有効である、応答は以下の例外を除いて、簡単なプロキシを介して取得していません。しかし

Caused by: org.apache.ws.security.WSSecurityException: Error in converting SOAP Envelope to Document; nested exception is: 
     org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: Expected xop:Include as the sole child of an element information item (see section 3.2 of http://www.w3.org/TR/xop10/) 
     at org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:149) 
     at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:268) 
     ... 11 more 
Caused by: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: Expected xop:Include as the sole child of an element information item (see section 3.2 of http://www.w3.org/TR/xop10/) 
     at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296) 
     at org.apache.axiom.om.impl.llom.OMSerializableImpl.build(OMSerializableImpl.java:78) 
     at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:722) 
     at org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.java:84) 
     ... 12 more 
Caused by: javax.xml.stream.XMLStreamException: Expected xop:Include as the sole child of an element information item (see section 3.2 of http://www.w3.org/TR/xop10/) 
     at org.apache.axiom.util.stax.xop.XOPDecodingStreamReader.next(XOPDecodingStreamReader.java:187) 
     at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681) 
     at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214) 
     ... 15 more 

- include要素があります:

Caused by: org.apache.axiom.om.OMException: Part content ID cannot be blank for non root MIME parts 
     at org.apache.axiom.attachments.Attachments.getNextPartDataHandler(Attachments.java:648) 
     at org.apache.axiom.attachments.Attachments.getDataHandler(Attachments.java:350) 
<inc:Include href="cid:[email protected]" xmlns:inc="http://www.w3.org/2004/08/xop/include"/> 

は、私は例外を持っている(外部サービスに似たモックアップサービスを作成する)ローカルサービスをテストしようとすると、

私はこれが問題https://wso2.org/jira/browse/ESBJAVA-3585に関係していると想定しています。それは関連しているのですか、間違ったモックアップサービスがありますか? MTOMはセキュリティポリシーを有効にして動作しますか?

Caused by: javax.xml.stream.XMLStreamException: Expected xop:Include as the sole child of an element information item (see section 3.2 of http://www.w3.org/TR/xop10/) 

これは、バックエンドサービスの「プリティプリント」機能によって引き起こされる:

答えて

0

が関与する2つの問題があるようです。 xop:Include要素は唯一の子でなければならないので、Axis 2は厳密に仕様を強制します。したがって、空白は許可されません。

org.apache.axiom.om.OMException: Part content ID cannot be blank for non root MIME parts 

これはまだ現時点では解決されていないバグです。 https://wso2.org/jira/browse/ESBJAVA-3585

回避策はメッセージタイプをtext/xml(効果的にbase64ペイロードをXMLエレメントに挿入)に変更することができます。小さくても妥当な添付ファイルサイズに適しています。

添付ファイルが大きい場合や負荷が高い場合は、添付ファイルをファイルとして保存し、ファイル名のみを戻すことが考えられます。

関連する問題