import java.net.MalformedURLException;
import java.util.Collection;
import java.util.HashMap;
import javax.xml.namespace.QName;
import org.codehaus.xfire.XFireRuntimeException;
import org.codehaus.xfire.aegis.AegisBindingProvider;
import org.codehaus.xfire.annotations.AnnotationServiceFactory;
import org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.jaxb2.JaxbTypeRegistry;
import org.codehaus.xfire.service.Endpoint;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.soap.AbstractSoapBinding;
import org.codehaus.xfire.transport.TransportManager;public class SetMealClient {    private static XFireProxyFactory proxyFactory = new XFireProxyFactory();
    private HashMap endpoints = new HashMap();
    private Service service0;    public SetMealClient() {
        create0();
        Endpoint SetMealHttpPortEP = service0 .addEndpoint(new QName("http://setmeal.webservice.jointjoy.net", "SetMealHttpPort"), new QName("http://setmeal.webservice.jointjoy.net", "SetMealHttpBinding"), "http://202.103.134.172:9092/member/services/setmealWs");
        endpoints.put(new QName("http://setmeal.webservice.jointjoy.net", "SetMealHttpPort"), SetMealHttpPortEP);
        Endpoint SetMealPortTypeLocalEndpointEP = service0 .addEndpoint(new QName("http://setmeal.webservice.jointjoy.net", "SetMealPortTypeLocalEndpoint"), new QName("http://setmeal.webservice.jointjoy.net", "SetMealPortTypeLocalBinding"), "xfire.local://SetMeal");
        endpoints.put(new QName("http://setmeal.webservice.jointjoy.net", "SetMealPortTypeLocalEndpoint"), SetMealPortTypeLocalEndpointEP);
    }    public Object getEndpoint(Endpoint endpoint) {
        try {
            return proxyFactory.create((endpoint).getBinding(), (endpoint).getUrl());
        } catch (MalformedURLException e) {
            throw new XFireRuntimeException("Invalid URL", e);
        }
    }    public Object getEndpoint(QName name) {
        Endpoint endpoint = ((Endpoint) endpoints.get((name)));
        if ((endpoint) == null) {
            throw new IllegalStateException("No such endpoint!");
        }
        return getEndpoint((endpoint));
    }    public Collection getEndpoints() {
        return endpoints.values();
    }    private void create0() {
        TransportManager tm = (org.codehaus.xfire.XFireFactory.newInstance().getXFire().getTransportManager());
        HashMap props = new HashMap();
        props.put("annotations.allow.interface", true);
        AnnotationServiceFactory asf = new AnnotationServiceFactory(new Jsr181WebAnnotations(), tm, new AegisBindingProvider(new JaxbTypeRegistry()));
        asf.setBindingCreationEnabled(false);
        service0 = asf.create((net.jointjoy.webservice.setmeal.SetMealPortType.class), props);
        {
            AbstractSoapBinding soapBinding = asf.createSoap11Binding(service0, new QName("http://setmeal.webservice.jointjoy.net", "SetMealHttpBinding"), "http://schemas.xmlsoap.org/soap/http");
        }
        {
            AbstractSoapBinding soapBinding = asf.createSoap11Binding(service0, new QName("http://setmeal.webservice.jointjoy.net", "SetMealPortTypeLocalBinding"), "urn:xfire:transport:local");
        }
    }    public SetMealPortType getSetMealHttpPort() {
        return ((SetMealPortType)(this).getEndpoint(new QName("http://setmeal.webservice.jointjoy.net", "SetMealHttpPort")));
    }    public SetMealPortType getSetMealHttpPort(String url) {
        SetMealPortType var = getSetMealHttpPort();
        org.codehaus.xfire.client.Client.getInstance(var).setUrl(url);
        return var;
    }    public SetMealPortType getSetMealPortTypeLocalEndpoint() {
        return ((SetMealPortType)(this).getEndpoint(new QName("http://setmeal.webservice.jointjoy.net", "SetMealPortTypeLocalEndpoint")));
    }    public SetMealPortType getSetMealPortTypeLocalEndpoint(String url) {
        SetMealPortType var = getSetMealPortTypeLocalEndpoint();
        org.codehaus.xfire.client.Client.getInstance(var).setUrl(url);
        return var;
    }    public static void main(String[] args) {
                SetMealClient client = new SetMealClient();
        
//create a default service endpoint
        SetMealPortType service = client.getSetMealHttpPort();
        System.out.println("service ------->"+service);
        
         //
         //service.yourServiceOperationHere();
        
System.out.println("test client completed");
         System.exit(0);
    }}