2

単純なCXFJax-WsサーバーをServiceMixにデプロイしたいと思います。これは、サービスインターフェイスとimplクラスの両方を備えた1つのOSGIバンドルです。別のServiceMixサーバー(バージョン4.4.1)にデプロイする必要があるため、サーバーごとにURLアドレスを変更する必要があります。サーバー固有の構成をKaraf.cfgファイルで行い、残りをブループリントで行いたい。これはラクダを必要としません。ブループリントで何をすべきですか?特定のドキュメントが見つかりません。

4

3 に答える 3

2

Apache Karaf に CXF とブループリントに関するチュートリアルがあります。これで完全な例が得られるはずです。

于 2013-05-10T13:23:48.473 に答える
1

含まれているのは、CXF と Blueprint を Karaf で使用して「オールインワン」JAX-WS Web サービスを構成するために使用した設計図構成です。

サーバー固有のプロパティも含めました (OSGi Config Admin で定義されています)。Karaf のetcディレクトリにある .cfg ファイルに名前が付けられcom.example.myservice.cfg、ブループリント ファイルで次の${}表記法でアクセスされます。という名前のプロパティを 1 つ定義しましschema-validation-enabledた (本番環境ではこの値を切り替えます)。

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xmlns:cxf="http://cxf.apache.org/blueprint/core"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"

xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
                    http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
                    http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
                    http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd">

<cm:property-placeholder persistent-id="com.example.myservice">
    <cm:default-properties>
        <cm:property name="schema-validation-enabled" value="true"/>
    </cm:default-properties>
</cm:property-placeholder>

<!-- A normal CXF endpoint -->
<jaxws:endpoint id="sampleService" implementor="com.example.myservice.impl.MyServiceImpl"
    endpointName="s:MyServicePort" serviceName="s:MyService" address="/MyService"
    wsdlLocation="/wsdl/MyService.wsdl"
    xmlns:s="http://www.example.com/MyService/SVC/v1">
    <jaxws:properties>
        <entry key="schema-validation-enabled" value="${schema-validation-enabled}" />
    </jaxws:properties>
</jaxws:endpoint>

于 2012-10-30T15:26:28.797 に答える
0

私も同じ問題を抱えていました。これは、Service が属するバンドルの OSGi 設計図に Bean 定義が含まれていなかったためです。サービスを使用するバンドルの OSGi ブループリントに Bean ref 定義が存在していても、独自のバンドル ブループリントで定義することが必須であることに気付きました。

于 2013-02-27T06:10:57.060 に答える