/// <summary> /// Call the gsis web service and returns info about a legal entity. /// </summary> public RgWsPublicBasicRtUser GetLegalEntityInfo(string userName, string password, string vatNumberIssuer, string searchForVatNumber) { try { RgWsPublicClient gsisService = GetNewConfiguredServiceClient(userName, password, vatNumberIssuer, searchForVatNumber); var rgWsPublicInputRt_in = new RgWsPublicInputRtUser { afmCalledBy = vatNumberIssuer, afmCalledFor = searchForVatNumber }; var RgWsPublicBasicRt_out = new RgWsPublicBasicRtUser(); var arrayOfRgWsPublicFirmActRt_out = new RgWsPublicFirmActRtUserArray(); var pCallSeqId_out = 0m; var pErrorRec_out = new GenWsErrorRtUser(); gsisService.rgWsPublicAfmMethod(rgWsPublicInputRt_in, ref RgWsPublicBasicRt_out, ref arrayOfRgWsPublicFirmActRt_out, ref pCallSeqId_out, ref pErrorRec_out); if (pErrorRec_out != null && !string.IsNullOrEmpty(pErrorRec_out.errorCode)) { throw new ApplicationException($"Error code: {pErrorRec_out.errorCode}, Error Description: {pErrorRec_out.errorDescr}"); } return(RgWsPublicBasicRt_out); } catch (Exception) { throw; } }
/// <summary> /// Call the gsis web service and returns info about a legal entity (ver2 call) /// </summary> /// <param name="afm">string : a valid vat number for a legal entity</param> /// <returns>RgWsBasStoixEpitRtUser : record with the entity info</returns> public static RgWsBasStoixEpitRtUser InvokeggpsService2(string afm) { decimal transid = 0; RgWsBasStoixNClient client = new RgWsBasStoixNClient(); RgWsBasStoixEpitRtUser res = new RgWsBasStoixEpitRtUser(); GenWsErrorRtUser reserror = new GenWsErrorRtUser(); //Invoke service client client.rgWsBasStoixEpit(afm, ref res, ref transid, ref reserror); //TODO : check error status if (reserror != null && !string.IsNullOrEmpty(reserror.errorCode)) { //handle error code //reserror.errorCode //reserror.errorDescr } return(res); }
/// <summary> /// Call the gsis web service and returns info about a legal entity (ver2 call) /// </summary> /// <param name="afm">string : a valid vat number for a legal entity</param> /// <returns>RgWsBasStoixEpitRtUser : record with the entity info</returns> public static RgWsBasStoixEpitRtUser InvokeggpsService2(string afm) { decimal transid = 0; RgWsBasStoixNClient client = new RgWsBasStoixNClient(); RgWsBasStoixEpitRtUser res = new RgWsBasStoixEpitRtUser(); GenWsErrorRtUser reserror = new GenWsErrorRtUser(); //Invoke service client client.rgWsBasStoixEpit(afm, ref res, ref transid, ref reserror); //TODO : check error status if (reserror != null && !string.IsNullOrEmpty(reserror.errorCode)) { //handle error code //reserror.errorCode //reserror.errorDescr } return res; }