Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exception in thread "main" javax.xml.ws.WebServiceException: Undefined port type: {http://intTest.store.com/}TestInterface
- at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:329)
- at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:335)
- at javax.xml.ws.Service.getPort(Service.java:161)
- at com.client.Client.main(Client.java:21)
- /**
- *
- */
- package com.store.intTest;
- import java.sql.SQLException;
- import javax.jws.WebMethod;
- import javax.jws.WebService;
- import javax.jws.soap.SOAPBinding;
- import javax.jws.soap.SOAPBinding.Style;
- @WebService
- @SOAPBinding(style = Style.DOCUMENT)
- public interface TestInterface {
- @WebMethod
- public void Display() throws SQLException;
- }
- package com.store.home;
- import helper.HomeDisplay;
- import java.util.LinkedList;
- import javax.jws.WebMethod;
- import javax.jws.WebService;
- import com.jdbc.HomeDao;
- import com.store.intTest.TestInterface;
- //(name = "endpointInterface", targetNamespace= "com.store.home.HomeImpl", serviceName = "HomeImplService")
- @WebService
- public class HomeImpl implements TestInterface{
- LinkedList<HomeDisplay> list = new LinkedList<HomeDisplay>();
- //public public HomeImpl() {
- // super();
- // // TODO Auto-generated constructor stub
- //}
- @Override
- @WebMethod
- public void Display() {
- // TODO Auto-generated method stub
- HomeDao obj= new HomeDao();
- list = obj.FinderDisplay();
- }
- }
- package com.endpoint.publisher;
- import javax.xml.ws.Endpoint;
- import com.store.home.HomeImpl;
- public class Publisher {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Endpoint.publish("http://localhost:9997/ws/Home", new HomeImpl());
- System.out.println("Succesfully deployed webservices");
- }
- }
- package com.client;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.sql.SQLException;
- import javax.xml.namespace.QName;
- import javax.xml.ws.Service;
- import com.store.intTest.TestInterface;
- public class Client {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- try {
- URL url = new URL("http://localhost:9997/ws/Home?wsdl");
- QName qname = new QName("http://home.store.com/", "HomeImplService");
- Service service = Service.create(url, qname);
- TestInterface h = service.getPort(TestInterface.class);
- try {
- h.Display();
- } catch (SQLException e) {
- //TODO Auto-generated catch block
- e.printStackTrace();
- }
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement