2016-04-24 14 views

答えて

2

あなたの質問にあるプロパティを持つ設定クラスのいずれかでBeanを宣言するだけで済みます。 それは次のようになります。

@Bean(name = "helloClient") // this is the id 
public HelloWorld helloWorld() { 
    String address = "http://localhost:9002/HelloWorld"; 
    JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean(); 
    factoryBean.setServiceClass(HelloWorld.class); 
    factoryBean.setAddress(address); 

    return (HelloWorld) factoryBean.create(); 
} 

あなたの方法は、サービスクラスのオブジェクトを返します。 JaxプロキシファクトリBeanが必要です。プロパティを設定してからクライアントを作成し(サービスクラスにキャストして)、それを返します。

関連する問題