私が作成したJAX-WS Web サービスを使用しようとしています。私はいつもnullPointerException
春の自動配線された注釈付きの Bean を取得します。ただし、serverSide over Web 内ではすべて正常に動作しますが、Bean にはJAX-WS webserviceを介してアクセスします。
を拡張してみましたSpringBeanAutowiringSupport
が、まだ運がありません。これどうやってするの。
よろしく、 Rohit
SpringBeanAutowiringSupport を拡張した経験はありませんでしたが、このアプローチをうまく使用しました。
次のように webService クラスに注釈を付けます。
@Component("yourWebService")
@WebService(endpointInterface ="your.package.YourServicePort")
webService 用の新しい spring-context xml を作成し、JAX-WS エンドポイントを定義します。
<jaxws:endpoint
id="yourServiceEndpoint"
implementor="#yourWebService"
address="${yourWebService.wsdl.url}"> //load url from properties file
</jaxws:endpoint>
春の小道具の使い方はご存知かと思いますが、念のため説明します。また、この構造を使用するには、ファイルを作成yourWebService.properties
し、Spring コンテキストで定義する必要があり${yourWebService.wsdl.url}
ます。
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>yourWebService.properties</value>
</list>
</property>
このアプローチを使用して、Spring で JAX を使用することに成功しました