`

SOAP WebService 发布全过程

    博客分类:
  • SOAP
阅读更多
package com.transnal.ws.cnlif.service;

public interface UnifiedAuthService extends java.rmi.Remote {
	
	/**
	 * 认证接口
	 * 
	 * 第三方系统将这个Token置入Cookie中
	 * @param loginId 
	 * 			用户登陆帐号
	 * @param password 
	 * 			用户登陆密码
	 * @param remoteIp
	 * 			用户登陆IP
	 * @return  
	 * 			认证通过,返回加密后的Token
	 * @throws java.rmi.RemoteException
	 */
    public java.lang.String authenticate(java.lang.String loginId, java.lang.String password, java.lang.String remoteIp) throws java.rmi.RemoteException;
    
    /**
     * 验证接口
     * 
     * 用户漫游到第三方系统时,第三方系统将Cookie中的loginId和Token提交到统一认证中心进行验证,
     * 验证该token是否合法。
     * 
     * @param loginId
     * 			 Cookie获取的登陆帐号
     * @param token
     * 			 Cookie中获取的全网通行token
     * @param remoteIp
     * 			用户登陆IP
     * @return
     * @throws java.rmi.RemoteException
     */
    public java.lang.String validate(java.lang.String loginId, java.lang.String token, java.lang.String remoteIp) throws java.rmi.RemoteException;
    
    /**
     * 根据登录ID获取用户基本信息
     * @param loginId
     * @return
     * @throws java.rmi.RemoteException
     */
    public com.transnal.ws.cnlif.bean.User getUserBaseInfoByLoginId(java.lang.String loginId) throws java.rmi.RemoteException;
    
    /**
     * 注册接口
     * 
     * 仅提供简单的手机注册。注册成功,返回一个User对象,否则返回null。
     * 
     * @param msisdn
     * 			用户手机号
     * @param usertype
     * 			用户类型
     * @return
     * 			用户信息
     * @throws java.rmi.RemoteException
     */
    public com.transnal.ws.cnlif.bean.User createUserBaseInfoByMsisdn(java.lang.String msisdn, java.lang.String usertype) throws java.rmi.RemoteException;
    
    /**
     * 注册接口
     * 
     * @param msisdn
     * 			用户手机号
     * @return
     * 			用户信息
     * @throws java.rmi.RemoteException
     */
    public com.transnal.ws.cnlif.bean.User createUserBaseInfoByMsisdn(java.lang.String msisdn) throws java.rmi.RemoteException;
    
}



package com.transnal.ws.cnlif.service;

public interface UnifiedAuthServiceService extends javax.xml.rpc.Service {
    public java.lang.String getUnifiedAuthServiceAddress();

    public com.transnal.ws.cnlif.service.UnifiedAuthService getUnifiedAuthService() throws javax.xml.rpc.ServiceException;

    public com.transnal.ws.cnlif.service.UnifiedAuthService getUnifiedAuthService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
   
}



package com.transnal.ws.cnlif.service;

import java.util.ResourceBundle;

@SuppressWarnings("serial")
public class UnifiedAuthServiceServiceLocator extends
		org.apache.axis.client.Service implements
		com.transnal.ws.cnlif.service.UnifiedAuthServiceService {

	public UnifiedAuthServiceServiceLocator() {
	}

	public UnifiedAuthServiceServiceLocator(
			org.apache.axis.EngineConfiguration config) {
		super(config);
	}

	public UnifiedAuthServiceServiceLocator(java.lang.String wsdlLoc,
			javax.xml.namespace.QName sName)
			throws javax.xml.rpc.ServiceException {
		super(wsdlLoc, sName);

	}

	// Use to get a proxy class for UnifiedAuthService
	private java.lang.String UnifiedAuthService_address = ResourceBundle
			.getBundle("spring-jpa").getString("ws.unifiedAuthServiceAddress");

	public java.lang.String getUnifiedAuthServiceAddress() {
		return UnifiedAuthService_address;
	}

	// The WSDD service name defaults to the port name.
	private java.lang.String UnifiedAuthServiceWSDDServiceName = "UnifiedAuthService";

	public java.lang.String getUnifiedAuthServiceWSDDServiceName() {
		return UnifiedAuthServiceWSDDServiceName;
	}

	public void setUnifiedAuthServiceWSDDServiceName(java.lang.String name) {
		UnifiedAuthServiceWSDDServiceName = name;
	}

	public com.transnal.ws.cnlif.service.UnifiedAuthService getUnifiedAuthService()
			throws javax.xml.rpc.ServiceException {
		java.net.URL endpoint;
		try {
			endpoint = new java.net.URL(UnifiedAuthService_address);
		} catch (java.net.MalformedURLException e) {
			throw new javax.xml.rpc.ServiceException(e);
		}
		return getUnifiedAuthService(endpoint);
	}

	public com.transnal.ws.cnlif.service.UnifiedAuthService getUnifiedAuthService(
			java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
		try {
			com.transnal.ws.cnlif.service.UnifiedAuthServiceSoapBindingStub _stub = new com.transnal.ws.cnlif.service.UnifiedAuthServiceSoapBindingStub(
					portAddress, this);
			_stub.setPortName(getUnifiedAuthServiceWSDDServiceName());
			return _stub;
		} catch (org.apache.axis.AxisFault e) {
			return null;
		}
	}

	public void setUnifiedAuthServiceEndpointAddress(java.lang.String address) {
		UnifiedAuthService_address = address;
	}

	/**
	 * For the given interface, get the stub implementation. If this service has
	 * no port for the given interface, then ServiceException is thrown.
	 */
	@SuppressWarnings("unchecked")
	public java.rmi.Remote getPort(Class serviceEndpointInterface)
			throws javax.xml.rpc.ServiceException {
		try {
			if (com.transnal.ws.cnlif.service.UnifiedAuthService.class
					.isAssignableFrom(serviceEndpointInterface)) {
				com.transnal.ws.cnlif.service.UnifiedAuthServiceSoapBindingStub _stub = new com.transnal.ws.cnlif.service.UnifiedAuthServiceSoapBindingStub(
						new java.net.URL(UnifiedAuthService_address), this);
				_stub.setPortName(getUnifiedAuthServiceWSDDServiceName());
				return _stub;
			}
		} catch (java.lang.Throwable t) {
			throw new javax.xml.rpc.ServiceException(t);
		}
		throw new javax.xml.rpc.ServiceException(
				"There is no stub implementation for the interface:  "
						+ (serviceEndpointInterface == null ? "null"
								: serviceEndpointInterface.getName()));
	}

	/**
	 * For the given interface, get the stub implementation. If this service has
	 * no port for the given interface, then ServiceException is thrown.
	 */
	@SuppressWarnings("unchecked")
	public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
			Class serviceEndpointInterface)
			throws javax.xml.rpc.ServiceException {
		if (portName == null) {
			return getPort(serviceEndpointInterface);
		}
		java.lang.String inputPortName = portName.getLocalPart();
		if ("UnifiedAuthService".equals(inputPortName)) {
			return getUnifiedAuthService();
		} else {
			java.rmi.Remote _stub = getPort(serviceEndpointInterface);
			((org.apache.axis.client.Stub) _stub).setPortName(portName);
			return _stub;
		}
	}

	public javax.xml.namespace.QName getServiceName() {
		return new javax.xml.namespace.QName(UnifiedAuthService_address,
				"UnifiedAuthServiceService");
	}

	@SuppressWarnings("unchecked")
	private java.util.HashSet ports = null;

	@SuppressWarnings("unchecked")
	public java.util.Iterator getPorts() {
		if (ports == null) {
			ports = new java.util.HashSet();
			ports.add(new javax.xml.namespace.QName(UnifiedAuthService_address,
					"UnifiedAuthService"));
		}
		return ports.iterator();
	}

	/**
	 * Set the endpoint address for the specified port name.
	 */
	public void setEndpointAddress(java.lang.String portName,
			java.lang.String address) throws javax.xml.rpc.ServiceException {

		if ("UnifiedAuthService".equals(portName)) {
			setUnifiedAuthServiceEndpointAddress(address);
		} else { // Unknown Port Name
			throw new javax.xml.rpc.ServiceException(
					" Cannot set Endpoint Address for Unknown Port" + portName);
		}
	}

	/**
	 * Set the endpoint address for the specified port name.
	 */
	public void setEndpointAddress(javax.xml.namespace.QName portName,
			java.lang.String address) throws javax.xml.rpc.ServiceException {
		setEndpointAddress(portName.getLocalPart(), address);
	}

}



package com.transnal.ws.cnlif.service;

import java.util.ResourceBundle;

import com.transnal.ws.cnlif.bean.User;

@SuppressWarnings("unchecked")
public class UnifiedAuthServiceSoapBindingStub extends org.apache.axis.client.Stub implements UnifiedAuthService {
	private java.util.Vector cachedSerClasses = new java.util.Vector();
    private java.util.Vector cachedSerQNames = new java.util.Vector();
    private java.util.Vector cachedSerFactories = new java.util.Vector();
    private java.util.Vector cachedDeserFactories = new java.util.Vector();
    private java.lang.String username = ResourceBundle.getBundle("spring-jpa").getString("ws.username");
    private java.lang.String password = ResourceBundle.getBundle("spring-jpa").getString("ws.password");
   
    static org.apache.axis.description.OperationDesc [] _operations;

    static { 
    	// 此處說明 UnifeedAuthService 接口中 有 5 個方法
        _operations = new org.apache.axis.description.OperationDesc[5];
        _initOperationDesc1();
    }

    private static void _initOperationDesc1(){
    	// 設置 UnifeAuthService 中所有的接口
    	
        org.apache.axis.description.OperationDesc oper;
        org.apache.axis.description.ParameterDesc param;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("authenticate");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "loginId"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "password"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "remoteIp"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
        oper.setReturnClass(java.lang.String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "authenticateReturn"));
        oper.setStyle(org.apache.axis.constants.Style.RPC);
        oper.setUse(org.apache.axis.constants.Use.ENCODED);
        _operations[0] = oper;

        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("validate");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "loginId"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "token"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "remoteIp"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
        oper.setReturnClass(java.lang.String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "validateReturn"));
        oper.setStyle(org.apache.axis.constants.Style.RPC);
        oper.setUse(org.apache.axis.constants.Use.ENCODED);
        _operations[1] = oper;

        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("getUserBaseInfoByLoginId");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "loginId"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("urn:BeanService", "user"));
        oper.setReturnClass(User.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "getUserBaseInfoByLoginIdReturn"));
        oper.setStyle(org.apache.axis.constants.Style.RPC);
        oper.setUse(org.apache.axis.constants.Use.ENCODED);
        _operations[2] = oper;

        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("createUserBaseInfoByMsisdn");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "msisdn"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "usertype"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("urn:BeanService", "user"));
        oper.setReturnClass(User.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "createUserBaseInfoByMsisdnReturn"));
        oper.setStyle(org.apache.axis.constants.Style.RPC);
        oper.setUse(org.apache.axis.constants.Use.ENCODED);
        _operations[3] = oper;

        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("createUserBaseInfoByMsisdn");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "msisdn"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"), java.lang.String.class, false, false);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("urn:BeanService", "user"));
        oper.setReturnClass(User.class);
        oper.setReturnQName(new javax.xml.namespace.QName("", "createUserBaseInfoByMsisdnReturn"));
        oper.setStyle(org.apache.axis.constants.Style.RPC);
        oper.setUse(org.apache.axis.constants.Use.ENCODED);
        _operations[4] = oper;

    }

    public UnifiedAuthServiceSoapBindingStub() throws org.apache.axis.AxisFault {
         this(null);
    }

    public UnifiedAuthServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
         this(service);
         super.cachedEndpoint = endpointURL;
    }

    @SuppressWarnings("unused")
    public UnifiedAuthServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
        if (service == null) {
            super.service = new org.apache.axis.client.Service();
        } else {
            super.service = service;
        }
        ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
            java.lang.Class cls;
            javax.xml.namespace.QName qName;
			javax.xml.namespace.QName qName2;
            java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
            java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
            java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
            java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
            java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
            java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
            java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
            java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
            java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
            java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
            qName = new javax.xml.namespace.QName("urn:BeanService", "user");
            cachedSerQNames.add(qName);
            cls = User.class;
            cachedSerClasses.add(cls);
            cachedSerFactories.add(beansf);
            cachedDeserFactories.add(beandf);

    }

    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
        try {
            org.apache.axis.client.Call _call = super._createCall();
            if (super.maintainSessionSet) {
                _call.setMaintainSession(super.maintainSession);
            }
            if (super.cachedUsername != null) {
                _call.setUsername(super.cachedUsername);
            }
            if (super.cachedPassword != null) {
                _call.setPassword(super.cachedPassword);
            }
            if (super.cachedEndpoint != null) {
                _call.setTargetEndpointAddress(super.cachedEndpoint);
            }
            if (super.cachedTimeout != null) {
                _call.setTimeout(super.cachedTimeout);
            }
            if (super.cachedPortName != null) {
                _call.setPortName(super.cachedPortName);
            }
            java.util.Enumeration keys = super.cachedProperties.keys();
            while (keys.hasMoreElements()) {
                java.lang.String key = (java.lang.String) keys.nextElement();
                _call.setProperty(key, super.cachedProperties.get(key));
            }
            // All the type mapping information is registered
            // when the first call is made.
            // The type mapping information is actually registered in
            // the TypeMappingRegistry of the service, which
            // is the reason why registration is only needed for the first call.
            synchronized (this) {
                if (firstCall()) {
                    // must set encoding style before registering serializers
                    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
                    _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
                    for (int i = 0; i < cachedSerFactories.size(); ++i) {
                        java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
                        javax.xml.namespace.QName qName =
                                (javax.xml.namespace.QName) cachedSerQNames.get(i);
                        java.lang.Object x = cachedSerFactories.get(i);
                        if (x instanceof Class) {
                            java.lang.Class sf = (java.lang.Class)
                                 cachedSerFactories.get(i);
                            java.lang.Class df = (java.lang.Class)
                                 cachedDeserFactories.get(i);
                            _call.registerTypeMapping(cls, qName, sf, df, false);
                        }
                        else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
                            org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
                                 cachedSerFactories.get(i);
                            org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
                                 cachedDeserFactories.get(i);
                            _call.registerTypeMapping(cls, qName, sf, df, false);
                        }
                    }
                }
            }
            _call.getMessageContext().setUsername(username); 
            _call.getMessageContext().setPassword(password); 
            return _call;
        }
        catch (java.lang.Throwable _t) {
            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
        }
    }

    public java.lang.String authenticate(java.lang.String loginId, java.lang.String password, java.lang.String remoteIp) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://services.uas.cnlife.com", "authenticate"));

        setRequestHeaders(_call);
        setAttachments(_call);
        try {     
        	java.lang.Object _resp = _call.invoke(new java.lang.Object[] {loginId, password, remoteIp});
	        if (_resp instanceof java.rmi.RemoteException) {
	            throw (java.rmi.RemoteException)_resp;
	        }
	        else {
	            extractAttachments(_call);
	            try {
	                return (java.lang.String) _resp;
	            } catch (java.lang.Exception _exception) {
	                return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
	            }
	        }
        }catch (org.apache.axis.AxisFault axisFaultException) {
        	throw axisFaultException;
        }
    }

    public java.lang.String validate(java.lang.String loginId, java.lang.String token, java.lang.String remoteIp) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[1]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://services.uas.cnlife.com", "validate"));

        setRequestHeaders(_call);
        setAttachments(_call);
        try {
        	java.lang.Object _resp = _call.invoke(new java.lang.Object[] {loginId, token, remoteIp});
	        if (_resp instanceof java.rmi.RemoteException) {
	            throw (java.rmi.RemoteException)_resp;
	        }
	        else {
	            extractAttachments(_call);
	            try {
	                return (java.lang.String) _resp;
	            } catch (java.lang.Exception _exception) {
	                return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
	            }
	        }
        } catch (org.apache.axis.AxisFault axisFaultException) {
        	throw axisFaultException;
        }
    }

    public User getUserBaseInfoByLoginId(java.lang.String loginId) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[2]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://services.uas.cnlife.com", "getUserBaseInfoByLoginId"));

        setRequestHeaders(_call);
        setAttachments(_call);
        try {
        	java.lang.Object _resp = _call.invoke(new java.lang.Object[] {loginId});
	        if (_resp instanceof java.rmi.RemoteException) {
	            throw (java.rmi.RemoteException)_resp;
	        }
	        else {
	            extractAttachments(_call);
	            try {
	                return (User) _resp;
	            } catch (java.lang.Exception _exception) {
	                return (User) org.apache.axis.utils.JavaUtils.convert(_resp, User.class);
	            }
	        }
        } catch (org.apache.axis.AxisFault axisFaultException) {
        	throw axisFaultException;
        }
    }

    public User createUserBaseInfoByMsisdn(java.lang.String msisdn, java.lang.String usertype) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[3]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://services.uas.cnlife.com", "createUserBaseInfoByMsisdn"));

        setRequestHeaders(_call);
        setAttachments(_call);
        try {
        	java.lang.Object _resp = _call.invoke(new java.lang.Object[] {msisdn, usertype});
	        if (_resp instanceof java.rmi.RemoteException) {
	            throw (java.rmi.RemoteException)_resp;
	        }
	        else {
	            extractAttachments(_call);
	            try {
	                return (User) _resp;
	            } catch (java.lang.Exception _exception) {
	                return (User) org.apache.axis.utils.JavaUtils.convert(_resp, User.class);
	            }
	        }
        }catch (org.apache.axis.AxisFault axisFaultException) {
        	throw axisFaultException;
        }
    }

    public User createUserBaseInfoByMsisdn(java.lang.String msisdn) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[4]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://services.uas.cnlife.com", "createUserBaseInfoByMsisdn"));

        setRequestHeaders(_call);
        setAttachments(_call);
        try {
        	java.lang.Object _resp = _call.invoke(new java.lang.Object[] {msisdn});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (User) _resp;
            } catch (java.lang.Exception _exception) {
                return (User) org.apache.axis.utils.JavaUtils.convert(_resp, User.class);
            }
        }
        } catch (org.apache.axis.AxisFault axisFaultException) {
        	throw axisFaultException;
        }
    }

}



以上就都已经定义好,以下是使用步骤:

	public boolean userIsExist(String username) {
		[color=red]UnifiedAuthService [/color]service;
		try {
			service = new [color=red]UnifiedAuthServiceServiceLocator[/color]()
					.getUnifiedAuthService();
			User user = service.getUserBaseInfoByLoginId(username);
			if (user != null) {
				return true;
			}
		} catch (Exception e) {
		}
		return false;
	}
分享到:
评论
1 楼 杰傲江湖 2012-03-19  
 
可不可以将注释写详细些,谢谢
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    asp.net通过WebService调用Java接口全过程

    总结来说,ASP.NET通过WebService调用Java接口的过程主要包括:部署Java WebService、在.NET项目中添加Web引用、配置项目设置、在代码中实例化并调用服务方法,以及理解背后涉及的SOAP和RMI通信机制。这个过程允许...

    soap开发Webservice用到的全部的包(最全)

    在开发过程中,开发者需要了解这些库的用法,并根据具体需求进行集成,以实现完整的SOAP Web服务功能。此外,熟悉WSDL(Web Service Description Language)和UDDI(Universal Description, Discovery, and ...

    qt 5使用gsoap发布webservice服务与调用webservice服务(发布端调用端文件都有)

    总的来说,这个项目提供了一个从零开始构建Web服务的完整示例,涵盖了发布和调用Web服务的全过程。通过学习和实践这个项目,开发者可以深入理解如何在Qt 5环境中结合gSOAP来实现高效的Web服务通信。

    xfire发布webservice

    整个过程涉及项目创建、服务类编写、服务配置、以及客户端的调用,每个环节都是构建一个功能完整的WebService所必需的。对于希望深入理解WebService技术,尤其是XFire框架的开发者而言,本例提供了一个很好的实践...

    最全WebService讲解教程

    2. **JAX-WS**:Java API for XML Web Services,是Java平台上的WebService标准,它简化了创建和使用WebService的过程。 3. **WSDL工具**:如WSDL2Java和Java2WSDL,它们分别用于从WSDL生成Java代码和服务,或者从...

    WebService使用JDK发布

    3. 注册服务:使用`@WebService`注解的`endpointInterface`属性指定SEI的全限定名,并将服务实例暴露给JAX-WS运行时。 ```java @WebService(endpointInterface = "com.example.HelloWorld") public class ...

    webservice实验报告和源代码

    综上,这个压缩包提供了一个实践性的学习平台,涵盖了Web服务的基础理论和实际操作,涉及SOAP和REST两种风格,以及使用Apache CXF进行开发和测试的全过程。通过分析源代码和阅读实验报告,可以深入理解Web服务的核心...

    基于.net环境的WebService开发资料

    在.NET环境中,WebService是一种通过HTTP...综上所述,基于.NET环境的WebService开发资料涵盖了从创建、调用到管理WebService的全过程,结合源码学习,有助于开发者深入理解.NET平台下WebService的实现机制和最佳实践。

    java快速搭建webservice

    Java 搭建 WebService 的过程简单明了,适合初学者快速上手。本文将详细介绍如何使用 Java 来创建和发布一个 WebService,以及涉及的关键技术。 首先,我们需要理解 WebService 的基本概念。WebService 是一种跨...

    使用Xfire构建JAVA的webService全过程(从服务端到客户端)

    Java平台提供了多种实现Web服务的方法,其中Xfire是一个流行的框架,它简化了构建和使用Web服务的过程。本文将深入探讨如何使用Xfire来创建一个完整的JAVA Web服务,包括服务端和客户端的实现。 首先,Xfire是一个...

    一头扎进 WebService 视频教程 java1234出品

    通过实际项目案例,您将有机会亲手实践WebService的开发全过程,包括设计、实现、测试和部署,从而巩固所学知识。 8. **问题排查与优化** 学习如何解决在开发和使用WebService过程中可能遇到的问题,以及如何优化...

    Axis 下的 WebService例子

    这篇博文可能是博主分享的一个实践教程,详细介绍了如何在 Axis 中实现 WebService 的全过程。 描述中提到的 "NULL" 暂时没有具体内容,但通常情况下,这样的描述可能意味着博主在发布时没有添加额外的解释或注解,...

    webservice接口发布

    在Webservice接口发布的过程中,Web服务器的配置和测试至关重要。WebServerTest可能包含测试脚本、配置文件或工具,用于验证Webservice接口的功能和性能。 五、最佳实践 1. 使用标准:遵循WS-I(Web Services ...

    webService简单示例及开发文档

    总结,"webService简单示例及开发文档"旨在引导开发者理解并实践Java中的Web服务开发,通过实例和文档,可以掌握从创建、部署到调用Web服务的全过程。"TheService.rar"可能是包含更复杂示例或工具的压缩包,进一步...

    springboot+webservice搭建webservice服务端

    以上就是使用Spring Boot结合Web Service搭建服务端以及使用Java客户端调用的全过程。在实际开发中,可以根据项目需求选择适合的客户端调用方式,同时注意处理异常和错误,确保服务的稳定性和可靠性。

    从WebService的开发到WebServices实现ADF Business Services

    通过上述步骤,我们可以看到从WebService的开发到实现ADF Business Services的全过程。这不仅涵盖了从环境配置、编码实现到最终部署的各个环节,还介绍了如何在客户端和ADF环境中调用这些服务。WebService以其开放性...

    WebService例子.zip

    这些代码可以帮助初学者理解WebService的整个生命周期,从服务创建、部署到客户端调用的全过程。 8. **不使用XFire和CXF**: XFire和CXF都是流行的Java WebService框架,它们提供了更高级的功能,如支持WS-Security...

    基于CFX开发WebService

    【基于CFX开发WebService】是将Apache CXF框架用于创建和部署Web服务的过程。Apache CXF是一个开源的Java框架,它允许开发者构建和消费各种Web服务,包括SOAP和RESTful服务。以下是对这个主题的详细解释: 1. **...

    JAX-WS 实现WebService发布

    JAX-WS(Java API for XML Web Services)是Java平台上用于创建Web服务的标准API,它简化了Web服务的开发、部署和消费过程。JAX-WS允许开发者使用Java语言来定义和实现Web服务,并通过SOAP(Simple Object Access ...

    AXIS入门指南-webservice

    本指南旨在为初学者提供AXIS框架下开发WebService的详细步骤,涵盖了从获取开发资源、生成 stub、编写服务器端代码到客户端测试的全过程。AXIS是一个开源的Java库,它提供了创建、部署和使用Web服务的工具,是基于...

Global site tag (gtag.js) - Google Analytics