WEB开发网
开发学院软件开发Java Java Web 服务: Axis2 中的 JAXB 和 JAX-WS 阅读

Java Web 服务: Axis2 中的 JAXB 和 JAX-WS

 2009-11-05 00:00:00 来源:WEB开发网   
核心提示: 清单 5. JAX-WS 生成的服务接口@WebService(name="Library",targetNamespace="http://ws.sosnoski.com/library/wsdl")@XmlSeeAlso({ObjectFactory.


清单 5. JAX-WS 生成的服务接口
@WebService(name = "Library", targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
@XmlSeeAlso({ 
  ObjectFactory.class 
}) 
public interface Library 
{ 
  /** 
   * 
   * @param isbn 
   * @return 
   *   returns com.sosnoski.ws.library.jaxws.BookInformation 
   */ 
  @WebMethod(action = "urn:getBook") 
  @WebResult(name = "getBookReturn", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
  @RequestWrapper(localName = "getBook", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl", 
    className = "com.sosnoski.ws.library.jaxws.GetBook") 
  @ResponseWrapper(localName = "getBookResponse", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl", 
    className = "com.sosnoski.ws.library.jaxws.GetBookResponse") 
  public BookInformation getBook( 
    @WebParam(name = "isbn", targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
    String isbn); 
 
  @WebMethod(action = "urn:getBooksByType") 
  @WebResult(name = "getBooksByTypeReturn", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
  @RequestWrapper(localName = "getBooksByType", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl", 
    className = "com.sosnoski.ws.library.jaxws.GetBooksByType") 
  @ResponseWrapper(localName = "getBooksByTypeResponse", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl", 
    className = "com.sosnoski.ws.library.jaxws.GetBooksByTypeResponse") 
  public List<BookInformation> getBooksByType( 
    @WebParam(name = "type", targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
    String type); 
 
  @WebMethod(action = "urn:getTypes") 
  @WebResult(name = "getTypesReturn", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
  @RequestWrapper(localName = "getTypes", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl", 
    className = "com.sosnoski.ws.library.jaxws.GetTypes") 
  @ResponseWrapper(localName = "getTypesResponse", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl", 
    className = "com.sosnoski.ws.library.jaxws.GetTypesResponse") 
  public List<TypeInformation> getTypes(); 
 
  @WebMethod(action = "urn:addBook") 
  @WebResult(name = "addBookReturn", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
  @RequestWrapper(localName = "addBook", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl", 
    className = "com.sosnoski.ws.library.jaxws.AddBook") 
  @ResponseWrapper(localName = "addBookResponse", 
    targetNamespace = "http://ws.sosnoski.com/library/wsdl", 
    className = "com.sosnoski.ws.library.jaxws.AddBookResponse") 
  public boolean addBook( 
    @WebParam(name = "type", targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
    String type, 
    @WebParam(name = "isbn", targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
    String isbn, 
    @WebParam(name = "author", 
      targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
    List<String> author, 
    @WebParam(name = "title", targetNamespace = "http://ws.sosnoski.com/library/wsdl") 
    String title) 
    throws AddDuplicateFault 
  ; 
}

上一页  4 5 6 7 8 9 10  下一页

Tags:Java Web 服务

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接