2017-11-10 103 views
5

GlassFish Server ve WS kullanarak yeni yapıyorum. Sadece bir Web uygulaması dağıttım. maven Ben Web Uygulaması tıklayın Bu web.xmlGlassFish Sunucu dağıtımı

<!DOCTYPE web-app PUBLIC 
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
"http://java.sun.com/dtd/web-app_2_3.dtd" > 

<web-app> 
    <display-name>Archetype Created Web Application</display-name> 


</web-app> 

sahip oluşturulan

ben uygulamada bu sınıf var Bağlantılar:

import javax.jws.WebMethod; 
import javax.jws.WebService; 

import javax.servlet.http.HttpSession; 

import javax.xml.ws.WebServiceContext; 

import javax.xml.ws.handler.MessageContext; 


    @WebService(serviceName="IberiaWS") 
    public class IberiaWS { 

     @Resource 
     private WebServiceContext wsContext; 

     public IberiaWS() { 
     } 

     private UserVO getSessionUserVO() { 
     MessageContext mc = wsContext.getMessageContext(); 
     HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession(); 
     return (UserVO)session.getAttribute("uservo"); 
     } 

     private void setSessionUserVO(UserVO uservo) { 
     MessageContext mc = wsContext.getMessageContext(); 
     HttpSession session = ((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession(); 
     session.setAttribute("uservo", uservo); 

     } 

     @WebMethod 
     public boolean login(String loginName, String loginPwd) throws Exception { 
     this.setSessionUserVO(new UserDAO().findUser("_"+loginName, "__"+loginPwd)); 
     return isConnected(); 
     } 

     @WebMethod 
     public boolean isConnected() { 
     return (this.getSessionUserVO()!=null); 
     } 

     @WebMethod 
     public IberiaPerson getPerson(String id) { 
     return new IberiaPerson(); 
     } 

     @WebMethod 
     public IberiaPerson findPerson(String companyNr) { 
     UserVO uservo = this.getSessionUserVO(); 
     IberiaPerson ret=null; 
     PersonVO p= new PersonDAO().findByCompanyNr(uservo.getAdminCenterId(), uservo.getUserId(), "Iberia", companyNr); 
     if (p!=null) { 
      ret = new IberiaPerson(); 
      ret.setPersonId(p.getPersonId()); 
      ret.setCompanyName(p.getVehicleOwnerName()); 
      ret.setCategoryName(p.getCategoryName()); 
      ret.setCompanyNr(p.getCompanyNr()); 
      ret.setFirstName(p.getFirstName()); 
      ret.setLastName(p.getLastName()); 
      ret.setStatusId(p.getStatusId()); 
      ret.setGroupName(p.getGroupList()); 
      ret.setKeyCode(p.getKeyString()); 
      ret.setComments(p.getLmComment()); 
     } 
     return ret; 
     } 
    } 

WS dağıtıldığı gibi görünüyor Motorları

'da gördüğümden beri spp'ye erişebiliyorum. http://localhost:8080/iberiafleet/

Ama nasıl WSLD erişmek için şimdi yok ben bu URL'yi HTTP Status 404 var

WS

konuşlanmış

http://localhost:8080/iberiafleet/IberiaWSPort?WSDL

ve ayrıca

http://localhost:8080/iberiafleet/IberiaWS?wsdl

Ancak bu eğiticiye göre bir bağlantıyı görmeliyim Endpoint View

https://blog.idrsolutions.com/2013/08/creating-and-deploying-a-java-web-service/

ama bunu görmüyorum. Ben size WSDL URL'de bir yazım hatası olduğunu düşünüyorum

[#|2017-11-13T10:50:39.993+0100|INFO|glassfish 5.0|javax.enterprise.webservices.metroglue|_ThreadID=19;_ThreadName=RunLevelControllerThread-1510566633374;_TimeMillis=1510566639993;_LevelValue=800;_MessageID=AS-WSMETROGLUE-10010;| 
    Web service endpoint deployment events listener registered successfully.|#] 

cevap

0

http://localhost:8080/iberiafleet/IberiaWS?wsdl 

çalışır:

enter image description here

ben konsolda bu mesajı görebilir?

+0

hayır, işe yaramaz :-( –