コントラクト ファースト Web サービスをデプロイする必要があります。サービス自体は非常にシンプルで、システムが使用可能かどうかを確認するための ping 操作だけです。
Ping.wsdl:
<?xml version="1.0" encoding="utf-8"?>
<definitions targetNamespace="urn:hl7-org:v3" name="Ping" xmlns:hl7="urn:hl7-org:v3" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema targetNamespace="urn:hl7-org:v3" elementFormDefault="qualified" xmlns:hl7="urn:hl7-org:v3" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="../schemas_codeGen/COMT_IN118118.xsd" />
<xsd:include schemaLocation="../schemas_codeGen/COMT_IN229229.xsd" />
</xsd:schema>
</types>
<message name="COMT_IN118118"><part name="body" element="hl7:COMT_IN118118" /></message>
<message name="COMT_IN229229"><part name="body" element="hl7:COMT_IN229229" /></message>
<portType name="Ping_PortType">
<operation name="Ping_PingPong">
<input message="hl7:COMT_IN118118" />
<output message="hl7:COMT_IN229229" />
</operation>
</portType>
<binding type="hl7:Ping_PortType" name="Ping_Binding">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="Ping_PingPong">
<soap:operation soapAction="urn:hl7-org:v3/Ping_PingPong" />
<input><soap:body use="literal" /></input>
<output><soap:body use="literal" /></output>
</operation>
</binding>
<service name="Ping_Service">
<port binding="hl7:Ping_Binding" name="Ping_Port"><soap:address location="http:/www.xis.nl/Ping" /></port>
</service>
</definitions>
このサービスを提供するだけでなく、リモートでこの Web サービスを呼び出して、リモートが自分のマシンでサービスを呼び出すことができるようにする必要があります。wsimport を使用して WSDL から Java コードを生成した結果、COMT_IN118118 および COMT_IN229229 メッセージ用の Java クラスと、展開に必要な注釈を備えたインターフェイス PingPortType が作成されました。
@WebService(name = "Ping_PortType", targetNamespace = "urn:hl7-org:v3")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@XmlSeeAlso({
ObjectFactory.class
})
public interface PingPortType {
@WebMethod(operationName = "Ping_PingPong", action = "urn:hl7-org:v3/Ping_PingPong")
@WebResult(name = "COMT_IN229229", targetNamespace = "urn:hl7-org:v3", partName = "body")
public COMTIN229229MCCIMT000300Message pingPingPong(
@WebParam(name = "COMT_IN118118", targetNamespace = "urn:hl7-org:v3", partName = "body")
COMTIN118118MCCIMT000100Message body);
}
春までにサービスをデプロイし、applicationContext に追加したいと思います。
<jaxws:endpoint id="pingEndpoint" address="/Ping"
implementor="com.application.services.impl.PingServiceImpl"
wsdlLocation="wsdl/Ping.wsdl" serviceName="hl7:Ping_Service"
endpointName="hl7:Ping_Port">
</jaxws:endpoint>
ここでの「hl7」は「urn:hl7-org:v3」名前空間の略で、PingServiceImpl は PingPortType を実装するクラスです。
起動時に、CXF は次のログを記録します。
Operation {urn:hl7-org:v3}Ping_PingPong cannot be unwrapped, input message must reference global element declaration with same localname as operation
PingPortType の @SoapBinding は、デフォルトの WRAPPED ではなく、parameterStyle を BARE にする必要があると述べているため、これは奇妙です。何かが @SoapBinding を無視/オーバーライドしていますが、何が原因かわかりません。
また、CXF がこれを DEBUG メッセージとしてログに記録するのはなぜですか? 私の意見では、ERROR の方がはるかに適切です (そして評価されます...)。