Service service = ServiceFactory.newInstance().createService(
new URL("file:samples/addr/AddressBook.wsdl"),
new QName("urn:AddressFetcher2", "AddressBookService"));
QName portName = new QName("urn:AddressFetcher2", "AddressBook");
Remote stub = service.getPort(portName, AddressBook.class);
assertTrue("Stub should be an instance of AddressBookSOAPBindingStub; instead, it is " + stub.getClass().getName(), stub instanceof AddressBookSOAPBindingStub);