Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. Exception in thread "main" javax.xml.ws.WebServiceException: Undefined port type: {http://intTest.store.com/}TestInterface
  2. at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:329)
  3. at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:335)
  4. at javax.xml.ws.Service.getPort(Service.java:161)
  5. at com.client.Client.main(Client.java:21)
  6.  
  7. /**
  8. *
  9. */
  10. package com.store.intTest;
  11.  
  12. import java.sql.SQLException;
  13.  
  14. import javax.jws.WebMethod;
  15. import javax.jws.WebService;
  16. import javax.jws.soap.SOAPBinding;
  17. import javax.jws.soap.SOAPBinding.Style;
  18.  
  19. @WebService
  20. @SOAPBinding(style = Style.DOCUMENT)
  21. public interface TestInterface {
  22. @WebMethod
  23. public void Display() throws SQLException;
  24. }
  25.  
  26. package com.store.home;
  27.  
  28. import helper.HomeDisplay;
  29.  
  30. import java.util.LinkedList;
  31.  
  32. import javax.jws.WebMethod;
  33. import javax.jws.WebService;
  34.  
  35. import com.jdbc.HomeDao;
  36. import com.store.intTest.TestInterface;
  37. //(name = "endpointInterface", targetNamespace= "com.store.home.HomeImpl", serviceName = "HomeImplService")
  38.  
  39.  
  40. @WebService
  41. public class HomeImpl implements TestInterface{
  42. LinkedList<HomeDisplay> list = new LinkedList<HomeDisplay>();
  43. //public public HomeImpl() {
  44. // super();
  45. // // TODO Auto-generated constructor stub
  46. //}
  47. @Override
  48. @WebMethod
  49. public void Display() {
  50. // TODO Auto-generated method stub
  51. HomeDao obj= new HomeDao();
  52. list = obj.FinderDisplay();
  53.  
  54. }
  55.  
  56. }
  57.  
  58. package com.endpoint.publisher;
  59.  
  60. import javax.xml.ws.Endpoint;
  61.  
  62. import com.store.home.HomeImpl;
  63.  
  64. public class Publisher {
  65.  
  66. public static void main(String[] args) {
  67. // TODO Auto-generated method stub
  68. Endpoint.publish("http://localhost:9997/ws/Home", new HomeImpl());
  69. System.out.println("Succesfully deployed webservices");
  70. }
  71. }
  72.  
  73. package com.client;
  74.  
  75. import java.net.MalformedURLException;
  76. import java.net.URL;
  77. import java.sql.SQLException;
  78.  
  79. import javax.xml.namespace.QName;
  80. import javax.xml.ws.Service;
  81.  
  82. import com.store.intTest.TestInterface;
  83.  
  84.  
  85. public class Client {
  86. public static void main(String[] args) {
  87. // TODO Auto-generated method stub
  88. try {
  89. URL url = new URL("http://localhost:9997/ws/Home?wsdl");
  90.  
  91. QName qname = new QName("http://home.store.com/", "HomeImplService");
  92. Service service = Service.create(url, qname);
  93. TestInterface h = service.getPort(TestInterface.class);
  94. try {
  95. h.Display();
  96. } catch (SQLException e) {
  97. //TODO Auto-generated catch block
  98. e.printStackTrace();
  99. }
  100.  
  101. } catch (MalformedURLException e) {
  102. // TODO Auto-generated catch block
  103. e.printStackTrace();
  104. }
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement