{"action":"created","issue":{"url":"https://api.github.com/repos/Utdanningsdirektoratet/PAS2-Public/issues/47","labels_url":"https://api.github.com/repos/Utdanningsdirektoratet/PAS2-Public/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/Utdanningsdirektoratet/PAS2-Public/issues/47/comments","events_url":"https://api.github.com/repos/Utdanningsdirektoratet/PAS2-Public/issues/47/events","html_url":"https://github.com/Utdanningsdirektoratet/PAS2-Public/issues/47","id":124962962,"number":47,"title":"Problemer med validering av PameldteKandidater xml","user":{"login":"thoraj","id":1554235,"avatar_url":"https://avatars.githubusercontent.com/u/1554235?v=3","gravatar_id":"","url":"https://api.github.com/users/thoraj","html_url":"https://github.com/thoraj","followers_url":"https://api.github.com/users/thoraj/followers","following_url":"https://api.github.com/users/thoraj/following{/other_user}","gists_url":"https://api.github.com/users/thoraj/gists{/gist_id}","starred_url":"https://api.github.com/users/thoraj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoraj/subscriptions","organizations_url":"https://api.github.com/users/thoraj/orgs","repos_url":"https://api.github.com/users/thoraj/repos","events_url":"https://api.github.com/users/thoraj/events{/privacy}","received_events_url":"https://api.github.com/users/thoraj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Utdanningsdirektoratet/PAS2-Public/labels/SAS","name":"SAS","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-05T13:04:23Z","updated_at":"2016-01-07T18:39:51Z","closed_at":null,"body":"Jeg sliter med å få deserialisert xml fra \"/api/ekstern/kandidat\"\r\n\r\nHar studert xsd'er, genererte klasser og rå xml, og ser ikke noen åpenbare feil.\r\n\r\nFor å sjekke mer har jeg forsøkt å validere xml mot xsd'ene, og testen under feiler med valideringsfeil:\r\n\r\n```\r\nAn exception of type 'System.Xml.Schema.XmlSchemaValidationException' occurred in System.Xml.dll but was not handled in user code\r\n\r\nAdditional information: Elementet http://pas.udir.no/Pamelding:PameldteKandidater er ikke deklarert.\r\n```\r\n\r\nEr veldig usikker på om jeg gjør noe dumt/rart, eller hva som skjer. Men burde ikke testen under fungere?\r\n\r\n```csharp\r\n   [Test]\r\n        public void CanValidatePameldteKandidater()\r\n        {\r\n            // Arrange\r\n\r\n            // Set up the namsespaces\r\n            XmlReaderSettings settings = new XmlReaderSettings();\r\n            settings.Schemas.Add(\"http://pas.udir.no/CommonTypes\", \"..\\\\..\\\\..\\\\Pas2Client\\\\Schema\\\\CommonTypes.xsd\");\r\n            settings.Schemas.Add(\"http://pas.udir.no/Karakteroversikt\", \"..\\\\..\\\\..\\\\Pas2Client\\\\Schema\\\\Karakteroversikt.xsd\");\r\n            settings.Schemas.Add(\"http://pas.udir.no/Pamelding\", \"..\\\\..\\\\..\\\\Pas2Client\\\\Schema\\\\Pamelding.xsd\");\r\n            settings.Schemas.Add(\"http://pas.udir.no/Eksamensplan\", \"..\\\\..\\\\..\\\\Pas2Client\\\\Schema\\\\Eksamensplan.xsd\");\r\n            settings.ValidationType = ValidationType.Schema;\r\n\r\n\r\n            // Create an XmlReader using the defined namespaces\r\n            XmlReader reader = XmlReader.Create(new XmlTextReader(\"..\\\\..\\\\..\\\\Test\\\\PameldteKandidater.xml\"), settings);\r\n            XmlDocument document = new XmlDocument();\r\n\r\n            // Act & assert\r\n            Assert.DoesNotThrow(() => document.Load(reader));\r\n        }\r\n```\r\n\r\nXml returnert fra \"/api/ekstern/kandidat\" (lagt inn i filen PameldteKandidater.xml)\r\n\r\n```xml\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<pa:PameldteKandidater xmlns:ct=\"http://pas.udir.no/CommonTypes\" xmlns:ko=\"http://pas.udir.no/Karakteroversikt\" xmlns:ep=\"http://pas.udir.no/Eksamensplan\" xmlns:pa=\"http://pas.udir.no/Pamelding\">\r\n  <pa:Eksamensperiodekode>V-2016</pa:Eksamensperiodekode>\r\n  <pa:Eksamenspameldinger>\r\n    <pa:Eksamenspamelding>\r\n      <pa:Fagkode>MAT0010</pa:Fagkode>\r\n      <pa:Variant />\r\n      <pa:Kandidatgrupper>\r\n        <pa:Kandidatgruppe>\r\n          <pa:Navn>Klasse 6A</pa:Navn>\r\n          <pa:Kandidatgruppeansvarlige>\r\n            <ct:Kandidatgruppeansvarlig>\r\n              <ct:Fodselsnr>12116833563</ct:Fodselsnr>\r\n              <ct:Fornavn>Thor Arne</ct:Fornavn>\r\n              <ct:Etternavn>Johansen</ct:Etternavn>\r\n              <ct:Malform>Bokmal</ct:Malform>\r\n              <ct:Epostadresse>thjoha @oppad.no</ct:Epostadresse>\r\n              <ct:Mobilnr>90915134</ct:Mobilnr>\r\n            </ct:Kandidatgruppeansvarlig>\r\n          </pa:Kandidatgruppeansvarlige>\r\n          <pa:Kandidater>\r\n            <pa:Kandidat>\r\n              <pa:Fodselsnr>17011099955</pa:Fodselsnr>\r\n              <pa:Fornavn>Kristoffer Berg</pa:Fornavn>\r\n              <pa:Etternavn>Johansen</pa:Etternavn>\r\n              <pa:Malform>Bokmal</pa:Malform>\r\n              <pa:Kandidattype>Elev</pa:Kandidattype>\r\n              <pa:Kandidatnummer>564HBS-V</pa:Kandidatnummer>\r\n            </pa:Kandidat>\r\n            <pa:Kandidat>\r\n              <pa:Fodselsnr>13060099930</pa:Fodselsnr>\r\n              <pa:Fornavn>Kevin</pa:Fornavn>\r\n              <pa:Etternavn>Rønhovde</pa:Etternavn>\r\n              <pa:Malform>Bokmal</pa:Malform>\r\n              <pa:Kandidattype>Elev</pa:Kandidattype>\r\n              <pa:Kandidatnummer>639CRS-V</pa:Kandidatnummer>\r\n            </pa:Kandidat>\r\n          </pa:Kandidater>\r\n        </pa:Kandidatgruppe>\r\n      </pa:Kandidatgrupper>\r\n    </pa:Eksamenspamelding>\r\n  </pa:Eksamenspameldinger>\r\n</pa:PameldteKandidater>\r\n```"},"comment":{"url":"https://api.github.com/repos/Utdanningsdirektoratet/PAS2-Public/issues/comments/169767937","html_url":"https://github.com/Utdanningsdirektoratet/PAS2-Public/issues/47#issuecomment-169767937","issue_url":"https://api.github.com/repos/Utdanningsdirektoratet/PAS2-Public/issues/47","id":169767937,"user":{"login":"thoraj","id":1554235,"avatar_url":"https://avatars.githubusercontent.com/u/1554235?v=3","gravatar_id":"","url":"https://api.github.com/users/thoraj","html_url":"https://github.com/thoraj","followers_url":"https://api.github.com/users/thoraj/followers","following_url":"https://api.github.com/users/thoraj/following{/other_user}","gists_url":"https://api.github.com/users/thoraj/gists{/gist_id}","starred_url":"https://api.github.com/users/thoraj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoraj/subscriptions","organizations_url":"https://api.github.com/users/thoraj/orgs","repos_url":"https://api.github.com/users/thoraj/repos","events_url":"https://api.github.com/users/thoraj/events{/privacy}","received_events_url":"https://api.github.com/users/thoraj/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T18:39:51Z","updated_at":"2016-01-07T18:39:51Z","body":"Her ble jeg litt forvirret en stund. \r\n\r\nLastes ned xsd fra linken dere har oppgitt i toppen av Wiki:\r\n\r\n```\r\nOppdaterte XSD kan alltid lastes ned fra https://eksamen.udir.no/api/ekstern/skjema\r\n```\r\n\r\nDenne inneholder ikke endringen.\r\n\r\nMen linken du anga over:  \r\n\r\n```\r\nNye xsd'er er tilgjengelig i https://eksamen-sas.udir.no\r\n```\r\n\r\nEr korrekt.\r\n\r\nUansett funker både validering og deserialsering nå :-)\r\n\r\n--\r\nThor Arne\r\n"}}