0

Grails と CXF を使用して、次のような小さな Web サービスを公開しました。

class TestService {

    static expose=['cxf']

    int pushData(int id, DataHandler data) {

        //receives data for a specific ID,
        return 1
    }
}

問題は、DataHandler データの転送のために MTOM を有効にしたいということです。通常、Groovy と CXF (または JAX-WS) を使用しTestServiceて、Endpoint

Endpoint ep = Endpoint.publish("http://localhost:9000/test", new TestService())
SOAPBinding binding = (SOAPBinding)ep.getBinding();
binding.setMTOMEnabled(true);

そして、すべてが完了しました。

Grails を使用してパブリッシュを行うようになったので、Endpoint. これをどのように達成できるか知っている人はいますか?

4

1 に答える 1

2

サービスインターフェースが次のようになっていると仮定しましょう

@MTOM
@WebService(targetNamespace="http://soap.services.website.com/", 
        endpointInterface="com.armorize.web.services.ServiceInterface")
public interface ServiceInterface

  int uploadData(@XmlMimeType("application/octet-stream") DataHandler code) ;

エンドポイントの属性はcxf-servlet.xmlで指定できます。ServiceImpl という実装サービスでは、次の仕様を追加する必要があります。

  <jaxws:endpoint id="endpointID"
        implementor="com.website.web.services.ServiceImpl" address="/test">

        <jaxws:properties>
            <entry key="mtom-enabled" value="true" />
            <entry key="mtom-threshold" value="0" />
        </jaxws:properties>
于 2010-08-02T08:35:31.473 に答える