package com.shulead.datasync.portalprice;

import javax.xml.rpc.ServiceException;
import javax.xml.rpc.Stub;
import java.rmi.RemoteException;

/**
 * @Classname PortalPriceWSProxy
 * @Description TODO
 * @Version 1.0.0
 * @Date 2024/4/28 18:35
 * @Created by liuxiangshun
 */
public class PortalPriceWSProxy implements PortalPriceWS {
    private String _endpoint = null;
    private PortalPriceWS portalPriceWS = null;

    public PortalPriceWSProxy() {
        this._initPortalPriceWSProxy();
    }

    public PortalPriceWSProxy(String endpoint) {
        this._endpoint = endpoint;
        this._initPortalPriceWSProxy();
    }

    private void _initPortalPriceWSProxy() {
        try {
            this.portalPriceWS = (new PortalPriceLocator()).getPortalPriceWSImplPort();
            if (this.portalPriceWS != null) {
                if (this._endpoint != null) {
                    ((Stub)this.portalPriceWS)._setProperty("javax.xml.rpc.service.endpoint.address", this._endpoint);
                } else {
                    this._endpoint = (String)((Stub)this.portalPriceWS)._getProperty("javax.xml.rpc.service.endpoint.address");
                }
            }
        } catch (ServiceException var2) {
        }

    }

    public String getEndpoint() {
        return this._endpoint;
    }

    public void setEndpoint(String endpoint) {
        this._endpoint = endpoint;
        if (this.portalPriceWS != null) {
            ((Stub)this.portalPriceWS)._setProperty("javax.xml.rpc.service.endpoint.address", this._endpoint);
        }

    }

    public PortalPriceWS getPortalPriceWS() {
        if (this.portalPriceWS == null) {
            this._initPortalPriceWSProxy();
        }

        return this.portalPriceWS;
    }

    public Result createPortalPrice(PortalPriceParams[] params) throws RemoteException {
        if (this.portalPriceWS == null) {
            this._initPortalPriceWSProxy();
        }

        return this.portalPriceWS.createPortalPrice(params);
    }
}
