コード例 #1
0
    void executeRequest(WSRequest request)
    {
        // Check credentials
        int LoginId = CheckLogin(request.Username, request.Password);
        // Write the data in Excel parsable form to a text file
        WriteToFile(request.UpdateRequestData.WriteToString());

        if (LoginId > 0)
            SaveToDB(LoginId, request.UpdateRequestData);
        else
            throw new ApplicationException("Unknown username or incorrect password.");
    }
コード例 #2
0
    protected void createTestRequest()
    {
        WSRequest request = new WSRequest();
        request.Version = "1.0";
        request.Username = "******";
        request.Password = "******";

        WSAccountRequestData ard = new WSAccountRequestData();

        ard.IncludeOPALData = 1;
        ard.AccountNumber = "EGVL999999";
        ard.FirstDeposit = 123456.34f;
        ard.ModelPortfolio = "J";
        ard.MoneyAccount = "P12345678";
        ard.MoneyAccountHolder = "Kribbe";
        ard.PeriodicWithdrawal = true;
        ard.PeriodWithdrawal = "year";
        ard.PeriodicWithdrawalAmount = 50f;
        ard.Remisier = "Finix";

        WSPerson person = new WSPerson();
        person.BirthDate = new DateTime(1970, 6, 24);
        person.LastName = "Kribbe";
        person.Initials = "S";
        person.Sex = "M";
        person.Title = "ing";
        person.SOFINumber = "179218773";

        WSIdentification id = new WSIdentification();
        id.Number = "999888777";
        id.Type = "Paspoort";
        id.ValidityPeriod = new DateTime(2010, 10, 10);

        person.Identification = id;

        WSAddress postaddress = new WSAddress("Herengracht", "199", "b", "1017EL", "Amsterdam", "Netherlands");

        WSContactDetails contactdetails = new WSContactDetails();
        contactdetails.PhoneMobile = "+31628785883";
        contactdetails.PostAddress = postaddress;

        person.ContactDetails = contactdetails;

        ard.Applicant = person;

        WSPerson person2 = new WSPerson();
        person2.BirthDate = new DateTime(1968, 9, 24);
        person2.LastName = "Partner";
        person2.Initials = "B";
        person2.Sex = "M";
        person2.Title = "ir";
        person2.SOFINumber = "782387678";

        WSIdentification id2 = new WSIdentification();
        id2.Number = "111222333";
        id2.Type = "Rijbewijs";
        id2.ValidityPeriod = new DateTime(2010, 10, 10);

        person2.Identification = id2;

        WSAddress postaddress2 = new WSAddress("Keizersgracht", "222", "", "1017AB", "Amsterdam", "Netherlands");

        WSContactDetails contactdetails2 = new WSContactDetails();
        contactdetails2.PhoneMobile = "+3162347802";
        contactdetails2.PostAddress = postaddress2;

        person2.ContactDetails = contactdetails2;

        ard.SecondApplicant = person2;

        request.UpdateRequestData = ard;

        WSOPALData opaldata = new WSOPALData();
        WSOPALInput opalinput = new WSOPALInput();
        Results results  = new Results();

        results.SchemaName = "steven.xsd";
        //results.Version = "1.0";

        opalinput.outputresults = results;

        opaldata.OpalInput = opalinput;

        WSOPALOutput opaloutput = new WSOPALOutput();
        Project project = new Project();
        project.ProjectName = "project1";

        opaloutput.OutputProject = project;

        opaldata.OpalOutput = opaloutput;

        request.UpdateRequestData.OPALData = opaldata;

        // Serialize the request
        XmlSerializer s = new XmlSerializer(typeof(WSRequest));
        FileStream w = new FileStream("c:\\temp\\wsrequest.xml", FileMode.Create);
        s.Serialize(w, request);
        w.Close();
    }