Skip to content

Instantly share code, notes, and snippets.

@ggdio
Last active December 23, 2015 09:09
Show Gist options
  • Save ggdio/6612890 to your computer and use it in GitHub Desktop.
Save ggdio/6612890 to your computer and use it in GitHub Desktop.
A client class to MyServiceWs.java
package br.com.ggdio.gists.ws.service.client;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceClient;
import br.com.ggdio.ws.service.structure.MyService;
/**
* This class establish a connection to the webservice
* and based on the wsdl, perform methods calls.
* @author Guilherme Dio
*
*/
@WebServiceClient(name = "MyService", targetNamespace = "http://example.ggdio.com.br/ws", wsdlLocation = "")
public class MyServiceClient extends Service {
public MyServiceClient(String url) throws MalformedURLException {
super(new URL(url), new QName("http://example.ggdio.com.br/ws",
"MyService"));
}
public MyServiceClient(URL wsdlDocumentLocation, QName serviceName) {
super(wsdlDocumentLocation, serviceName);
}
public MyService getPort() {
return (MyService) super.getPort(MyService.class);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment