2009-10-26 5 views
8

아무도 도와 드릴 수 있습니까?Jetty 7이 내장 된 JAX-WS 엔드 포인트 게시

임베디드 Jetty 7을 엔드 포인트로 사용하고 싶습니다.

public class MiniTestJetty { 

@WebService(targetNamespace = "http") 
public static class Calculator { 

    @Resource 
    WebServiceContext context; 

    public int add(int a, int b) { 
     return a + b; 
    } 
} 


public static void main(String[] args) throws Exception { 
    int port = 8080; 
    Server server = new Server(port); 

    Calculator calculator = new Calculator(); 
    Endpoint.publish("http://localhost:" + port + "/calc", calculator); 

    server.start(); 
    server.join(); 
} 

}

을하지만 정말 기본 일 HttpServer에 대신 부두를 사용하는지 여부를 내가 볼 수 없습니다 : 이것은 내가 뭘하려합니다.

한 블로그는

System.setProperty("com.sun.net.httpserver.HttpServerProvider", 
     "org.mortbay.jetty.j2se6.JettyHttpServerProvider"); 

을 언급하지만 부두에 도움, 악셀 7.

감사 등 HttpServerProvider있을 것 같습니다하지 않습니다.

+0

은 제티 6의 contrib 섹션에 코드가있는 것처럼 보입니다. 과 유사하지만 제티 7에는 아무것도 없습니다. – axelrose

답변

4

모든 것을 필요한 것은 부두-있는 contrib/조직/mortgay/부두/j2se6에서

System.setProperty("com.sun.net.httpserver.HttpServerProvider", "org.mortbay.jetty.j2se6.JettyHttpServerProvider"); 

현재의 contrib 코드 것으로 보인다 것은 준비가되지 않았습니다 아직 부두 7. 모든 있다고.

+0

어떻게 그걸 알아 냈습니까? –

3

Firefox에서 WSDL의 URL을 열고 Firebug로 응답 헤더를 확인할 수 있습니다.

HTTP/1.1 200 OK 
Content-Type: text/xml;charset=utf-8 
Transfer-Encoding: chunked 
Server: Jetty(7.1.2.v20100523) 
관련 문제