2013-02-13 61 views
1

是否可以使用camel創建和發佈WebService而不需要xml文件?如何使用Camel創建和發佈WebService?

隨着JAX-WS我可以創造像

@WebService 
@SOAPBinding(style = Style.RPC) 
public class CreatorWebService { 

public String create(String word1, String word2, String word3) { 
return Maker.make(word1, word2, word3); 
}} 

一個WS併發布它很容易與

public static void main(String args[]) { 
    CreatorWebService server = new CreatorWebService(); 
    Endpoint endpoint = Endpoint.publish("http://localhost:8080/creator", server); 
} 

怎麼可以這樣用駱駝做,如果可能的話用JAVA DSL和不使用XML(web.xml,beans ...)?

我想用這個WS作爲輸入傳入郵件例如像路線:

from(WSinputMessage).to("myProcessor").to(doSomething); 

任何幫助將是非常讚賞。

回答

1

我不太清楚你想如何解析WS請求以及如何處理它,因爲可能有幾種方法。

應儘可能才達到與駱駝使用jetty componentCXF BEAN component

一個非常類似的設置,即

from("jetty:http://localhost:9000/").to("cxfbean:serviceObj").to("handleReplySomehow"); 
    //serviceObj does not have to be a spring bean, but can be a JAX-WS annotated object in the camel registry. 
相關問題