예제 #1
0
        public ResultInfoSessionInfo GetSessionId(ServiceProviderDataInfoRuName ruName)
        {
            var req = new GetSessionIDRequestType();

            req.RuName = ruName.Value;

            var rez = base.GetServiceData(Service.GetSessionID, req);

            return(new ResultInfoSessionInfo(rez));
        }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param>
 public GetSessionIDCall(ApiContext ApiContext)
 {
     ApiRequest      = new GetSessionIDRequestType();
     this.ApiContext = ApiContext;
 }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 public GetSessionIDCall()
 {
     ApiRequest = new GetSessionIDRequestType();
 }
    public string GetSessionID()
    {
        string callname = "GetSessionID";

        #region Initialise Needed Variables

        //Get the Server to use (Sandbox or Production)
        string serverUrl = ConfigurationManager.AppSettings["TradingService"];

        //SiteID = 0  (US) - UK = 3, Canada = 2, Australia = 15, ....
        //string siteID = "0";

        eBayAPIInterfaceService service = new eBayAPIInterfaceService();
        string requestURL = serverUrl + "?callname=" + callname + "&siteid=" + siteID
                            + "&appid=" + AppID + "&version=" + version + "&routing=default";
        service.Url = requestURL;

        // Set credentials
        service.RequesterCredentials = new CustomSecurityHeaderType();
        service.RequesterCredentials.Credentials = new UserIdPasswordType();
        service.RequesterCredentials.Credentials.AppId = AppID;
        service.RequesterCredentials.Credentials.DevId = DevID;
        service.RequesterCredentials.Credentials.AuthCert = CertID;
        #endregion

        GetSessionIDRequestType request = new GetSessionIDRequestType();
        request.RuName = ConfigurationManager.AppSettings["RuName"];
        request.Version = version;
        GetSessionIDResponseType response = service.GetSessionID(request);
        return response.SessionID;
    }
예제 #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ApiContext">The <see cref="ApiCall.ApiContext"/> for this API Call of type <see cref="ApiContext"/>.</param>
 public GetSessionIDCall(ApiContext ApiContext)
 {
     ApiRequest = new GetSessionIDRequestType();
     this.ApiContext = ApiContext;
 }
예제 #6
0
 /// <summary>
 /// 
 /// </summary>
 public GetSessionIDCall()
 {
     ApiRequest = new GetSessionIDRequestType();
 }
예제 #7
0
        private void GetSessionID()
        {
            string callname = "GetSessionID";

            this.BuildService(callname);

            GetSessionIDRequestType request = new GetSessionIDRequestType();

            request.Version = _version;

            request.RuName = this._RUName;

            GetSessionIDResponseType response = this.service.GetSessionID(request);

            if (response.Ack != AckCodeType.Success)
            {
                string error = "";

                foreach (ErrorType err in response.Errors) error += err.LongMessage;

                throw new Exception(error);
            }

            this._currentSessionID = response.SessionID;
        }