2011-07-05 15 views

回答

0

我認爲這是一個「定位」或創建一個類'工廠',可用於製作服務的客戶端(代理)實例。例如(其中「」是服務名稱):

ExampleService locator = new ExampleService(); 
locator.addPort(ExampleService.Example, SOAPBinding.SOAP11HTTP_BINDING 
    , "http://myserver:8080/myapp/services/example"); 
// now get the instance 
Example example = locator.getExample(); 

雖然與CXF可以使用實用程序,如JaxWsProxyFactoryBean並忽略<Service Name>Service類。例如:

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); 
factory.setServiceClass(Example.class); 
factory.setAddress("http://myserver:8080/myapp/services/example"); 
factory.setUsername("user"); 
factory.setPassword("password"); 
Example example = (Example) factory.create(); 
+1

剛剛看到這個問題在很多個月前被問過啊,希望它能幫助別人。 – kevinjansz

+0

感謝您的回答。 – tamilnad