Skip to content

Instantly share code, notes, and snippets.

@tongtie
Created May 10, 2015 07:43
Show Gist options
  • Save tongtie/d7834c80b783ea993803 to your computer and use it in GitHub Desktop.
Save tongtie/d7834c80b783ea993803 to your computer and use it in GitHub Desktop.
client
package service;
/**
* Created by mrt on 2015/5/10.
*/
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.URL;
class Client {
public static void main(String args[ ]) throws Exception {
URL url = new URL("http://localhost:9000/PersonList?wsdl");
QName qname = new QName("http://service/", "PersonListService");
// Create, in effect, a factory for the service.
Service service = Service.create(url, qname);
// Extract the endpoint interface, the service "port".
Persons eif = service.getPort(Persons.class);
System.out.println(eif.getPersonList().size());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment