/**********************************************************************************/ private bool doCreatePartyRegistration() { // if we've previously registered, the VTN should return our VEN ID and // Registration ID in the queryRegistration message // We shouldn't need to call CreatePartyRegistration at this point, but the // test set will n1_0020 will fail if we don't send the query message CreatePartyRegistration createPartyRegistration; lock (m_ven) { createPartyRegistration = m_ven.createPartyRegistration(RandomHex.instance().generateRandomHex(10), oadrProfileType.Item20b, oadrTransportType.simpleHttp, "", false, false, true); } m_callbacks.processCreatePartyRegisteration(createPartyRegistration); // exit if registration failed if (createPartyRegistration.eiResponseCode != 200) { return(false); } setPollinterval(createPartyRegistration.response); return(true); }
public void N1_0010_TH_VTN_1() { VEN2b ven = new VEN2b(new HttpWebRequestWrapper(false, System.Net.SecurityProtocolType.Tls12), TestProperties.vtnURL, TestProperties.venName, TestProperties.venID, TestProperties.venPassword); QueryRegistration queryRegistration = ven.queryRegistration(); Assert.IsTrue(queryRegistration.response != null); CreatePartyRegistration createPartyRegistration = ven.createPartyRegistration(RandomHex.instance().generateRandomHex(10), oadrProfileType.Item20b, oadrTransportType.simpleHttp, "", false, false, true); Assert.IsTrue(createPartyRegistration.response != null); }
public void N1_0020_TH_VTN_1() { VEN2b ven = new VEN2b(new HttpWebRequestWrapper(false, System.Net.SecurityProtocolType.Tls12), TestProperties.vtnURL, TestProperties.venName, TestProperties.venID, TestProperties.venPassword); // register CreatePartyRegistration createPartyRegistration = ven.createPartyRegistration(RandomHex.instance().generateRandomHex(10), oadrProfileType.Item20b, oadrTransportType.simpleHttp, "", false, false, true); Assert.IsTrue(createPartyRegistration.response != null); Console.Out.WriteLine(createPartyRegistration.responseBody); // POLL OadrPoll oadrPoll = ven.poll(); Assert.IsNotNull(oadrPoll.response); Console.Out.WriteLine(oadrPoll.responseBody); // First request is registerReport Assert.IsTrue(oadrPoll.responseTypeIs(typeof(oadrRegisterReportType))); oadrRegisterReportType registerReportType = oadrPoll.getRegisterReportResponse(); RegisteredReport registeredReport = ven.registeredReport(registerReportType.requestID, "200", "OK"); Assert.IsNotNull(registeredReport.response); Assert.AreEqual(registeredReport.response.eiResponse.responseCode, "200"); // register our own report ReportDescription reportDescription = ReportHelper.generateReportDescription(); RegisterReport registerReport = ven.registerReport(RandomHex.instance().generateRandomHex(10), reportDescription); Assert.IsNotNull(registerReport.response); Assert.AreEqual("200", registerReport.response.eiResponse.responseCode); Assert.AreEqual(registerReport.request.requestID, registerReport.response.eiResponse.requestID); }