1

Axis2 から Glassfish / Metro に移行しようとしている従来の Web サービスがあり、問題に遭遇しました。

SOAP11 用と SOAP12 用のwsdl:service2 つの要素への参照を含む1 つの要素を持つ 1 つの WSDL ファイルがあります。wsdl:port

特に、WSDL のその部分は次のようになります。

<wsdl:service name="WebServiceInterface">
    <wsdl:port name="WebServiceSOAP11port"
        binding="ns:WebServiceSOAP11Binding">
        <soap:address
            location="http://localhost:8081/axis2/services/WebService" />
    </wsdl:port>
    <wsdl:port name="WebServiceSOAP12port"
        binding="ns:WebServiceSOAP12Binding">
        <soap12:address
            location="http://localhost:8081/axis2/services/WebService" />
    </wsdl:port>
</wsdl:service>

エンドポイントとして機能するクラスを設定しようとすると、次のようになります。

@WebService(name = "WebServicePortType", targetNamespace = "http://abc/", portName="WebServiceSOAP11port", endpointInterface = "abc.WebServicePortType", serviceName = "WebServiceInterface", wsdlLocation = "WebService.wsdl")
@BindingType(SOAPBinding.SOAP11HTTP_BINDING)
public class WebServiceSoap11Impl extends WebServiceBase implements WebServicePortType {
    // Superclass handles actual method calls - this is just here for binding to Soap 1.1.
}
@WebService(name = "WebServicePortType", targetNamespace = "http://abc/", portName="WebServiceSOAP12port", endpointInterface = "abc.WebServicePortType", serviceName = "WebServiceInterface", wsdlLocation = "WebService.wsdl")
@BindingType(SOAPBinding.SOAP12HTTP_BINDING)
public class WebServiceSoap12Impl extends WebServiceBase implements WebServicePortType  {
    // Superclass handles actual method calls - this is just here for binding to Soap 1.2.
}

これで、SOAP11 バインディングでは問題なく動作しますが、soapUI を介して SOAP12 バインディングを使用しようとすると、次のエラーが発生します。

[#|2013-02-25T22:31:25.299+1300|SEVERE|glassfish3.1.2|com.sun.xml.ws.transport.http.HttpAdapter|_ThreadID=227;_ThreadName=http-thread-pool-8782(5);|Unsupported Content-Type: application/soap+xml;charset=UTF-8;action="urn:heartBeat" Supported ones are: [text/xml]
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: application/soap+xml;charset=UTF-8;action="urn:heartBeat" Supported ones are: [text/xml]
    at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:315)
    at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:149)
    at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:361)
    at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:343)
    at com.sun.xml.ws.transport.http.HttpAdapter.access$400(HttpAdapter.java:99)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:623)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:263)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:163)
    at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)

明らかに、Content-TypeSOAP12 については正しいのですが、何らかの理由で、Metro は同じエンドポイントに 2 つのクラスがあることを認識していません。1 つは SOAP11 にバインドされ、もう 1 つは SOAP12 にバインドされています。Axis2 はそのユースケースを処理できるようです。Metro はこれをサポートしていますか? または、SOAP11 と 12 に別々のエンドポイントを提供する必要がありますか? それとも、そのうちの 1 つのサポートを中止する必要がありますか?

Java 1.7.0_4を搭載したUbuntu 10.04でGlassfish 3.1.2.2を実行しています

4

0 に答える 0