Web services glassfish视图端点不可见
我已经编写了一个Web服务,可以从数据库中获取数据列表。但是当我部署应用程序时,我看不到视图端点。这是我的代码Web services glassfish视图端点不可见,web-services,glassfish,jax-ws,Web Services,Glassfish,Jax Ws,我已经编写了一个Web服务,可以从数据库中获取数据列表。但是当我部署应用程序时,我看不到视图端点。这是我的代码 package com.mesutemre.service; @WebService(name = "KitapListesi" , targetNamespace = "http://com.mesutemre.service/") public interface KitapListesi { @WebMethod(operationName = "listallBooks")
package com.mesutemre.service;
@WebService(name = "KitapListesi" , targetNamespace = "http://com.mesutemre.service/")
public interface KitapListesi {
@WebMethod(operationName = "listallBooks")
@WebResult(name = "books")
public List<Kitaplar> findAllKitaplar();
package com.mesutemre.service;
@WebService(name=“KitaListesi”,targetNamespace=”http://com.mesutemre.service/")
公共接口KitapListesi{
@WebMethod(operationName=“listallBooks”)
@WebResult(name=“books”)
公共列表findAllKitaplar();
}
和实现类
package com.mesutemre.service;
@WebService(portName = "kitapListesiPort", serviceName = "KitapListesiService", targetNamespace = "http://com.mesutemre.service/", endpointInterface = "com.mesutemre.service.KitapListesi")
public class KitapListesiImpl implements KitapListesi {
private MySQLBaglantisi msb;
@Override
public List<Kitaplar> findAllKitaplar() {
msb.baglan();
String sql = "SELECT * FROM kutuphane.kitaplar";
List<Kitaplar> kitapList = new ArrayList<Kitaplar>();
try {
PreparedStatement pstmt = (PreparedStatement) msb.getConnection()
.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
kitapList.add(new Kitaplar(rs.getInt(1), rs.getString(2), rs
.getString(3), rs.getString(4), rs.getString(5)));
}
} catch (Exception e) {
e.printStackTrace();
}
msb.baglantiyiKes();
return kitapList;
}
package com.mesutemre.service;
@WebService(portName=“KitaListeSiPort”,serviceName=“KitaListeSiService”,targetNamespace=”http://com.mesutemre.service/,endpointInterface=“com.mesutemre.service.KitapListesi”)
公共类KitaListeSiImpl实现KitaListeSi{
私有MySQLBaglantisi msb;
@凌驾
公共列表findAllKitaplar(){
msb.baglan();
String sql=“SELECT*FROM kutuphane.kitaplar”;
List kitapList=new ArrayList();
试一试{
PreparedStatement pstmt=(PreparedStatement)msb.getConnection()
.prepareStatement(sql);
结果集rs=pstmt.executeQuery();
while(rs.next()){
添加(新的Kitaplar(rs.getInt(1)、rs.getString(2)、rs
.getString(3)、rs.getString(4)、rs.getString(5));
}
}捕获(例外e){
e、 printStackTrace();
}
msb.baglantiyiKes();
返回kitapList;
}
}
这是关于我的代码的问题还是进一步的问题?在Glassfish
server.log
文件中,您应该看到类似以下内容的行:
[2014-12-08T00:00:00.000+0000][glassfish 4.0][INFO][AS-WSJSR109IMPL-00018[javax.enterprise.webservices][tid:_ThreadID=35 _ThreadName=admin listener(4)][timeMillis:1418029146568][levelValue:800][[Webservice端点部署KitaListensisService侦听地址为http://example:8080/example/KitapListesiService.]]