2016-07-06 6 views
0

Apache CXFを使用してSOAPハンドラでファイルを添付しようとしていますが、動作しません。CXFを使用するSOAPハンドラを使用した添付ファイル

ここに私の例があります。この例では

https://github.com/emag-notes/cxf-soaphandler-demo

、私は、ファイルを添付するSAAJのAPIを使用しています。

https://github.com/emag-notes/cxf-soaphandler-demo/blob/master/server/src/main/java/cxf/soaphandler/AttachmentHandler.java#L49-L54

しかしながら、SOAPメッセージ応答だけSOAPエンベロープではなく、マルチパート(I添付ファイルを含まない )。

何か不足していますか?このコードはApache Axis2で動作します。

MTOMを使用することが最善の選択肢であるとはいえ、私は既存のコードAMAPを使用したいと思います(私はAxis2からの移行作業中です)。

答えて

1

コードはうまく見えますが、私はあなたがMTOMを有効にする必要があると信じています。

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:soap="http://cxf.apache.org/bindings/soap" 
     xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 

    <jaxws:server id="Downloader" serviceClass="cxf.soaphandler.Downloader" address="downloader"> 
    <jaxws:serviceBean> 
     <bean class="cxf.soaphandler.Downloader"> 
     </bean> 
    </jaxws:serviceBean> 
    <jaxws:binding> 
     <soap:soapBinding mtomEnabled="true" /> 
    </jaxws:binding> 
    </jaxws:server> 

</beans> 
+0

ありがとうございます!それは私にとって魔法です... 私のaxis1クライアントは、パケットキャプチャ(コンテンツタイプはapplication/xop_xml)を見る限りmtom通信のように見えますが、サービスにアクセスできます。 – emag

関連する問題