summaryrefslogtreecommitdiffstats
path: root/src/main/java/derms/client/Client.java
blob: 7069f54fcb433a94a1da78014acf5c649daada50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package derms.client;

import derms.frontend.DERMSInterface;
import derms.frontend.DERMSServerImpl;
import derms.frontend.FE;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.MalformedURLException;
import java.net.URL;

class Client {
    public static final String namespace = "frontend.derms";
    public static final QName qname = new QName("http://"+namespace+"/", DERMSServerImpl.class.getSimpleName()+"Service");

    static DERMSInterface connectToServer(String FEhost) throws MalformedURLException {
        URL url = new URL(FE.endpointURL(FEhost) + "?wsdl");
        return Service.create(url, qname).getPort(DERMSInterface.class);
    }
}