3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
24 # Check that all the modules we need are installed, or bail out
27 require Test::DBIx::Class;
30 plan skip_all => "Test::DBIx::Class is not available";
38 plan skip_all => "SOAP::Lite is not available";
43 require Crypt::GCrypt;
46 plan skip_all => "Crypt::GCrypt is not available";
51 require Convert::BaseN;
54 plan skip_all => "Convert::BaseN is not available";
58 use Test::DBIx::Class {
59 schema_class => 'Koha::Schema',
60 connect_info => ['dbi:SQLite:dbname=:memory:','',''],
61 connect_opts => { name_sep => '.', quote_char => '`', },
62 fixture_class => '::Populate',
63 }, 'Borrower', 'BorrowerSync';
65 # Make the code in the module use our mocked Koha::Schema/Koha::Database
66 my $db = Test::MockModule->new('Koha::Database');
68 # Schema() gives us the DB connection set up by Test::DBIx::Class
69 _new_schema => sub { return Schema(); }
74 [qw/firstname surname borrowernumber address city/],
75 ['Test', 'Borrower', 1, 'Test road', 'Test city'],
76 ['Test', 'Borrower', 2, 'Test road', 'Test city'],
77 ['Test', 'Borrower', 3, 'Test road', 'Test city'],
78 ['Test', 'Borrower', 4, 'Test road', 'Test city'],
81 [qw/borrowernumber sync syncstatus lastsync hashed_pin synctype/],
82 [1, 1, 'new', '2014-03-31T12:35:14', 'abc', 'norwegianpatrondb' ],
83 [2, 1, 'edited', '2014-03-31T12:35:14', 'abc', 'norwegianpatrondb' ],
84 [3, 1, 'new', '2014-03-31T12:35:14', 'abc', 'norwegianpatrondb' ],
85 [4, 1, 'new', '2014-03-31T12:35:14', 'abc', 'norwegianpatrondb' ],
87 ], 'installed some fixtures';
89 =head1 LOADING THE MODULE
93 BEGIN { use_ok( 'Koha::NorwegianPatronDB', ':all' ) }
96 =head1 UTILITY SUBROUTINES
98 =head2 NLCheckSysprefs
104 =item * NorwegianPatronDBEnable
106 =item * NorwegianPatronDBEndpoint
108 =item * NorwegianPatronDBUsername
110 =item * NorwegianPatronDBPassword
116 t::lib::Mocks::mock_preference('NorwegianPatronDBEnable', 0);
117 t::lib::Mocks::mock_preference('NorwegianPatronDBEndpoint', '');
118 t::lib::Mocks::mock_preference('NorwegianPatronDBUsername', '');
119 t::lib::Mocks::mock_preference('NorwegianPatronDBPassword', '');
120 ok( my $result = NLCheckSysprefs(), 'call NLCheckSysprefs() ok' );
121 is( $result->{ 'error' }, 1, 'error detected' );
122 is( $result->{ 'nlenabled' }, 0, 'NL is not enabled' );
123 is( $result->{ 'endpoint' }, 0, 'an endpoint is not specified' );
124 is( $result->{ 'userpass' }, 0, 'username and/or password is missing' );
126 t::lib::Mocks::mock_preference('NorwegianPatronDBEnable', 1);
127 ok( $result = NLCheckSysprefs(), 'call NLCheckSysprefs() ok' );
128 is( $result->{ 'error' }, 1, 'error detected' );
129 is( $result->{ 'nlenabled' }, 1, 'NL is enabled' );
130 is( $result->{ 'endpoint' }, 0, 'an endpoint is not specified' );
131 is( $result->{ 'userpass' }, 0, 'username and/or password is missing' );
133 t::lib::Mocks::mock_preference('NorwegianPatronDBEnable', 0);
134 t::lib::Mocks::mock_preference('NorwegianPatronDBUsername', 'user');
135 t::lib::Mocks::mock_preference('NorwegianPatronDBPassword', 'pass');
136 ok( $result = NLCheckSysprefs(), 'call NLCheckSysprefs() ok' );
137 is( $result->{ 'error' }, 1, 'error detected' );
138 is( $result->{ 'nlenabled' }, 0, 'NL is not enabled' );
139 is( $result->{ 'endpoint' }, 0, 'an endpoint is not specified' );
140 is( $result->{ 'userpass' }, 1, 'username and/or password is present' );
142 t::lib::Mocks::mock_preference('NorwegianPatronDBEnable', 1);
143 t::lib::Mocks::mock_preference('NorwegianPatronDBEndpoint', 'http://example.com/');
144 ok( $result = NLCheckSysprefs(), 'call NLCheckSysprefs() ok' );
145 is( $result->{ 'error' }, 0, 'no error detected' );
146 is( $result->{ 'nlenabled' }, 1, 'NL is enabled' );
147 is( $result->{ 'endpoint' }, 1, 'an endpoint is specified' );
148 is( $result->{ 'userpass' }, 1, 'username and/or password is present' );
150 =head2 NLGetFirstname and NLGetSurname
154 my $firstname = 'Firstname';
155 my $surname = 'Surname';
156 my $fullname = "$surname, $firstname";
157 my $wrongname = "$surname $firstname";
159 is( NLGetFirstname( $fullname ), $firstname, 'can get firstname from name' );
160 is( NLGetSurname( $fullname ), $surname, 'can get surname from name' );
161 is( NLGetFirstname( $wrongname ), $wrongname, 'returns full string when name misses comma' );
162 is( NLGetSurname( $wrongname ), $wrongname, 'returns full string when name misses comma' );
164 =head2 NLDecodePin and NLEncryptPIN
169 my $hash = NLEncryptPIN( $pin );
171 is( NLEncryptPIN( $pin ), $hash, 'NLEncryptPIN works' );
172 is( NLDecodePin( $hash ), $pin, 'NLDecodePin works' );
174 =head2 NLUpdateHashedPIN
178 is ( BorrowerSync->find({ 'borrowernumber' => 1 })->get_column('hashed_pin'), 'abc', 'hashed_pin is "abc"' );
181 ok( NLUpdateHashedPIN( 1, $new_pin ), 'NLUpdateHashedPIN runs ok' );
182 # Hash the new pin and compare it to the one stored in the database
183 my $hashed_pin = Koha::NorwegianPatronDB::_encrypt_pin( $new_pin );
184 is ( BorrowerSync->find({ 'borrowernumber' => 1 })->get_column('hashed_pin'), $hashed_pin, 'hashed_pin was updated' );
186 =head2 NLMarkForDeletion
190 is ( BorrowerSync->find({ 'borrowernumber' => 3 })->get_column('syncstatus'), 'new', 'syncstatus is "new"' );
191 ok( NLMarkForDeletion( 3 ), 'NLMarkForDeletion runs ok' );
192 # Check that the syncstatus was updated. Note: We will use this status later, to check syncing of deleted borrowers
193 is ( BorrowerSync->find({ 'borrowernumber' => 3 })->get_column('syncstatus'), 'delete', 'syncstatus is "delete"' );
195 =head2 NLGetSyncDataFromBorrowernumber
199 ok( my $sync_data = NLGetSyncDataFromBorrowernumber( 1 ), 'NLGetSyncDataFromBorrowernumber runs ok' );
200 isa_ok( $sync_data, 'Koha::Schema::Result::BorrowerSync' );
201 is( $sync_data->sync, 1, 'the sync is on' );
202 is( $sync_data->syncstatus, 'new', 'syncstatus is "new"' );
203 is( $sync_data->lastsync, '2014-03-31T12:35:14', 'lastsync is ok' );
204 is( $sync_data->hashed_pin, $hashed_pin, 'hashed_pin is ok' );
206 =head1 SUBROUTINES THAT TALK TO SOAP
212 my $lite = Test::MockModule->new('SOAP::Lite');
214 # Mock a successfull call to the "hent" method
216 hent => sub { return SOAP::Deserializer->deserialize( hent_success() )->result; }
218 ok( my $res = NLSearch( '12345678910' ), 'successfull call to NLSearch' );
219 is( $res->{'antall_poster_returnert'}, 1, 'got 1 record' );
220 isa_ok( $res, "Resultat" );
221 isa_ok( $res->{'respons_poster'}, "LaanerListe" );
222 isa_ok( $res->{'respons_poster'}[0], "Laaner" );
224 # Mock an unsuccessfull call to the "hent" method
226 hent => sub { return SOAP::Deserializer->deserialize( hent_failure() )->result; }
228 ok( $res = NLSearch( '12345678910' ), 'call to NLSearch with an illegal argument' );
229 is( $res->{'antall_poster_returnert'}, 0, 'got 0 records' );
230 isa_ok( $res, "Resultat" );
231 like( $res->{'melding'}, qr/Ulovlig argument: hverken LNR eller FNR_HASH/, "got expected error message for an illegal identifier" );
239 my $borrower = Borrower->find({ 'borrowernumber' => 1 });
241 nyPost => sub { return SOAP::Deserializer->deserialize( nyPost_success() )->result; }
243 is ( BorrowerSync->find({ 'borrowernumber' => 1 })->get_column('syncstatus'), 'new', 'patron is new' );
244 ok ( $result = NLSync({ 'patron' => $borrower }), 'successfull call to NLSync via patron ("nyPost")' );
245 is ( BorrowerSync->find({ 'borrowernumber' => 1 })->get_column('syncstatus'), 'synced', 'patron is synced' );
247 # Now do the same test, but pass in a borrowernumber, not a Koha::Schema::Result::Borrower
248 is ( BorrowerSync->find({ 'borrowernumber' => 4 })->get_column('syncstatus'), 'new', 'patron is new' );
249 ok ( $result = NLSync({ 'borrowernumber' => 4 }), 'successfull call to NLSync via borrowernumber ("nyPost")' );
250 is ( BorrowerSync->find({ 'borrowernumber' => 4 })->get_column('syncstatus'), 'synced', 'patron is synced' );
256 ok ( $borrower = Borrower->find({ 'borrowernumber' => 2 }), 'find our "edited" mock patron' );
258 endre => sub { return SOAP::Deserializer->deserialize( endre_success() )->result; }
260 is ( BorrowerSync->find({ 'borrowernumber' => 2 })->get_column('syncstatus'), 'edited', 'patron is edited' );
261 ok ( $result = NLSync({ 'patron' => $borrower }), 'successfull call to NLSync ("endre")' );
262 is ( BorrowerSync->find({ 'borrowernumber' => 2 })->get_column('syncstatus'), 'synced', 'patron is synced' );
264 =head3 Deleted patron
268 ok ( $borrower = Borrower->find({ 'borrowernumber' => 3 }), 'find our "deleted" mock patron' );
270 slett => sub { return SOAP::Deserializer->deserialize( endre_success() )->result; }
272 is ( BorrowerSync->find({ 'borrowernumber' => 3 })->get_column('syncstatus'), 'delete', 'patron is marked for deletion' );
273 ok ( $result = NLSync({ 'patron' => $borrower }), 'successfull call to NLSync ("slett")' );
274 is ( BorrowerSync->find({ 'borrowernumber' => 3 })->get_column('sync'), 0, 'sync is now disabled' );
280 # Mock a successfull call to the "soekEndret" method
282 soekEndret => sub { return SOAP::Deserializer->deserialize( soekEndret_success() ); }
284 ok( $res = NLGetChanged(), 'successfull call to NLGetChanged - 2 results' );
285 is( $res->{'melding'}, 'OK', 'got "OK"' );
286 is( $res->{'antall_poster_returnert'}, 2, 'got 2 records' );
287 isa_ok( $res, "Resultat" );
288 isa_ok( $res->{'respons_poster'}, "LaanerListe" );
289 isa_ok( $res->{'respons_poster'}[0], "Laaner" );
292 # Mock a successfull call to the "soekEndret" method, but with zero new records
294 soekEndret => sub { return SOAP::Deserializer->deserialize( soekEndret_zero_new() ); }
296 ok( $res = NLGetChanged(), 'successfull call to NLGetChanged - 0 results' );
297 is( $res->{'melding'}, 'ingen treff', 'got "ingen treff"' );
298 is( $res->{'antall_poster_returnert'}, 0, 'got 0 records' );
299 is( $res->{'antall_treff'}, 0, 'got 0 records' );
303 =head1 SAMPLE SOAP XML RESPONSES
305 These responses can be gathered by setting "outputxml()" to true on the SOAP
308 my $client = SOAP::Lite
309 ->on_action( sub { return '""';})
310 ->uri('http://lanekortet.no')
311 ->proxy('https://fl.lanekortet.no/laanekort/fl_test.php')
313 my $response = $client->slett( $x );
316 Pretty formatting can be achieved by piping the output from a test script
319 perl my_test_script.pl > xmllint --format -
325 return <<'ENDRESPONSE';
326 <?xml version="1.0" encoding="UTF-8"?>
327 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://lanekortet.no" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
330 <return xsi:type="ns1:Svar">
331 <status xsi:type="xsd:boolean">true</status>
332 <melding xsi:type="xsd:string">Test Testersen (1973-08-11) er slettet fra registeret</melding>
333 <lnr xsi:type="xsd:string">N000106188</lnr>
334 <server_tid xsi:type="xsd:string">2014-06-02T16:51:58</server_tid>
345 return <<'ENDRESPONSE';
346 <?xml version="1.0" encoding="UTF-8"?>
347 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://lanekortet.no" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
350 <return xsi:type="ns1:Svar">
351 <status xsi:type="xsd:boolean">true</status>
352 <melding xsi:type="xsd:string">Oppdaterte felt: navn, p_adresse1, p_postnr, p_sted, p_land, fdato, fnr_hash, kjonn, pin, sist_endret, sist_endret_av</melding>
353 <lnr xsi:type="xsd:string">N000106188</lnr>
354 <server_tid xsi:type="xsd:string">2014-06-02T16:42:32</server_tid>
365 return <<'ENDRESPONSE';
366 <?xml version="1.0" encoding="UTF-8"?>
367 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://lanekortet.no" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
370 <return xsi:type="ns1:Svar">
371 <status xsi:type="xsd:boolean">true</status>
372 <melding xsi:type="xsd:string">Ny post er opprettet</melding>
373 <lnr xsi:type="xsd:string">N000106188</lnr>
374 <server_tid xsi:type="xsd:string">2014-06-02T14:10:09</server_tid>
376 </ns1:nyPostResponse>
383 sub soekEndret_success {
385 return <<'ENDRESPONSE';
386 <?xml version="1.0" encoding="UTF-8"?>
388 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
389 xmlns:ns1="http://lanekortet.no"
390 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
391 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
392 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
393 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
395 <ns1:soekEndretResponse>
396 <return xsi:type="ns1:Resultat">
397 <status xsi:type="xsd:boolean">true</status>
398 <melding xsi:type="xsd:string">OK</melding>
399 <antall_treff xsi:type="xsd:int">2</antall_treff>
400 <antall_poster_returnert xsi:type="xsd:int">2</antall_poster_returnert>
401 <neste_indeks xsi:type="xsd:int">0</neste_indeks>
402 <respons_poster SOAP-ENC:arrayType="ns1:Laaner[2]" xsi:type="ns1:LaanerListe">
403 <item xsi:type="ns1:Laaner">
404 <lnr xsi:type="xsd:string">N000106186</lnr>
405 <navn xsi:type="xsd:string">Hansen, Hanne</navn>
406 <p_adresse1 xsi:type="xsd:string"/>
407 <p_adresse2 xsi:type="xsd:string"/>
408 <p_postnr xsi:type="xsd:string"/>
409 <p_sted xsi:type="xsd:string">BØDØ</p_sted>
410 <p_land xsi:type="xsd:string">no</p_land>
411 <p_sjekk xsi:type="xsd:string">0</p_sjekk>
412 <m_adresse1 xsi:type="xsd:string"/>
413 <m_adresse2 xsi:type="xsd:string"/>
414 <m_postnr xsi:type="xsd:string"/>
415 <m_sted xsi:type="xsd:string"/>
416 <m_land xsi:type="xsd:string"/>
417 <m_sjekk xsi:type="xsd:string">0</m_sjekk>
418 <m_gyldig_til xsi:type="xsd:string">0000-00-00</m_gyldig_til>
419 <tlf_hjemme xsi:type="xsd:string"/>
420 <tlf_jobb xsi:type="xsd:string"/>
421 <tlf_mobil xsi:type="xsd:string"/>
422 <epost xsi:type="xsd:string"/>
423 <epost_sjekk xsi:type="xsd:string"/>
424 <prim_kontakt xsi:type="xsd:string"/>
425 <hjemmebibliotek xsi:type="xsd:string">5180401</hjemmebibliotek>
426 <fdato xsi:type="xsd:string">1994-04-08</fdato>
427 <fnr_hash xsi:type="xsd:string">11087395628</fnr_hash>
428 <kjonn xsi:type="xsd:string">F</kjonn>
429 <pin xsi:type="xsd:string">89308dfc85ee7a5826ae14e2d8efad1e</pin>
430 <passord xsi:type="xsd:string"/>
431 <feide xsi:type="xsd:string">0</feide>
432 <opprettet xsi:type="xsd:string">2014-04-28T15:20:38</opprettet>
433 <opprettet_av xsi:type="xsd:string">5180401</opprettet_av>
434 <sist_endret xsi:type="xsd:string">2014-04-28T15:20:38</sist_endret>
435 <sist_endret_av xsi:type="xsd:string">5180401</sist_endret_av>
436 <folkeregsjekk_dato xsi:type="xsd:string">0000-00-00</folkeregsjekk_dato>
438 <item xsi:type="ns1:Laaner">
439 <lnr xsi:type="xsd:string">N000106184</lnr>
440 <navn xsi:type="xsd:string">Enger, Magnus</navn>
441 <p_adresse1 xsi:type="xsd:string">Svarthammarveien 633333</p_adresse1>
442 <p_adresse2 xsi:type="xsd:string"/>
443 <p_postnr xsi:type="xsd:string">8015</p_postnr>
444 <p_sted xsi:type="xsd:string">Bodø</p_sted>
445 <p_land xsi:type="xsd:string">no</p_land>
446 <p_sjekk xsi:type="xsd:string">0</p_sjekk>
447 <m_adresse1 xsi:type="xsd:string"/>
448 <m_adresse2 xsi:type="xsd:string"/>
449 <m_postnr xsi:type="xsd:string"/>
450 <m_sted xsi:type="xsd:string"/>
451 <m_land xsi:type="xsd:string">no</m_land>
452 <m_sjekk xsi:type="xsd:string">0</m_sjekk>
453 <m_gyldig_til xsi:type="xsd:string">0000-00-00</m_gyldig_til>
454 <tlf_hjemme xsi:type="xsd:string">95158548</tlf_hjemme>
455 <tlf_jobb xsi:type="xsd:string"/>
456 <tlf_mobil xsi:type="xsd:string"/>
457 <epost xsi:type="xsd:string">magnus@enger.priv.no</epost>
458 <epost_sjekk xsi:type="xsd:string"/>
459 <prim_kontakt xsi:type="xsd:string"/>
460 <hjemmebibliotek xsi:type="xsd:string">5180401</hjemmebibliotek>
461 <fdato xsi:type="xsd:string">1973-08-11</fdato>
462 <fnr_hash xsi:type="xsd:string">11087345795</fnr_hash>
463 <kjonn xsi:type="xsd:string">M</kjonn>
464 <pin xsi:type="xsd:string">a632c504b8c4fba3149115cb07e0796c</pin>
465 <passord xsi:type="xsd:string"/>
466 <feide xsi:type="xsd:string">0</feide>
467 <opprettet xsi:type="xsd:string">2014-04-28T14:52:02</opprettet>
468 <opprettet_av xsi:type="xsd:string">5180401</opprettet_av>
469 <sist_endret xsi:type="xsd:string">2014-05-13T11:01:33</sist_endret>
470 <sist_endret_av xsi:type="xsd:string">5180401</sist_endret_av>
471 <folkeregsjekk_dato xsi:type="xsd:string">0000-00-00</folkeregsjekk_dato>
474 <server_tid xsi:type="xsd:string">2014-05-16T14:44:44</server_tid>
476 </ns1:soekEndretResponse>
482 sub soekEndret_zero_new {
483 return <<'ENDRESPONSE';
484 <?xml version="1.0" encoding="UTF-8"?>
485 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://lanekortet.no" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
487 <ns1:soekEndretResponse>
488 <return xsi:type="ns1:Resultat">
489 <status xsi:type="xsd:boolean">false</status>
490 <melding xsi:type="xsd:string">ingen treff</melding>
491 <antall_treff xsi:type="xsd:int">0</antall_treff>
492 <antall_poster_returnert xsi:type="xsd:int">0</antall_poster_returnert>
493 <neste_indeks xsi:type="xsd:int">0</neste_indeks>
494 <respons_poster SOAP-ENC:arrayType="ns1:Laaner[0]" xsi:type="ns1:LaanerListe"/>
495 <server_tid xsi:type="xsd:string">2014-05-20T13:02:02</server_tid>
497 </ns1:soekEndretResponse>
504 return <<'ENDRESPONSE';
505 <?xml version="1.0" encoding="UTF-8"?>
507 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
508 xmlns:ns1="http://lanekortet.no"
509 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
510 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
511 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
512 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
515 <return xsi:type="ns1:Resultat">
516 <status xsi:type="xsd:boolean">false</status>
517 <melding xsi:type="xsd:string">hent: Ulovlig argument: hverken LNR eller FNR_HASH</melding>
518 <antall_treff xsi:type="xsd:int">0</antall_treff>
519 <antall_poster_returnert xsi:type="xsd:int">0</antall_poster_returnert>
520 <neste_indeks xsi:type="xsd:int">0</neste_indeks>
521 <respons_poster SOAP-ENC:arrayType="ns1:Laaner[0]" xsi:type="ns1:LaanerListe"/>
522 <server_tid xsi:type="xsd:string">2014-05-15T10:56:24</server_tid>
533 return <<'ENDRESPONSE';
534 <?xml version="1.0" encoding="UTF-8"?>
536 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
537 xmlns:ns1="http://lanekortet.no"
538 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
539 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
540 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
541 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
544 <return xsi:type="ns1:Resultat">
545 <status xsi:type="xsd:boolean">true</status>
546 <melding xsi:type="xsd:string">OK</melding>
547 <antall_treff xsi:type="xsd:int">1</antall_treff>
548 <antall_poster_returnert xsi:type="xsd:int">1</antall_poster_returnert>
549 <neste_indeks xsi:type="xsd:int">0</neste_indeks>
550 <respons_poster SOAP-ENC:arrayType="ns1:Laaner[1]" xsi:type="ns1:LaanerListe">
551 <item xsi:type="ns1:Laaner">
552 <lnr xsi:type="xsd:string">N000123456</lnr>
553 <navn xsi:type="xsd:string">Test, Testersen</navn>
554 <p_adresse1 xsi:type="xsd:string">Bibliotekveien 6</p_adresse1>
555 <p_adresse2 xsi:type="xsd:string"/>
556 <p_postnr xsi:type="xsd:string">1234</p_postnr>
557 <p_sted xsi:type="xsd:string">Lillevik</p_sted>
558 <p_land xsi:type="xsd:string">no</p_land>
559 <p_sjekk xsi:type="xsd:string">0</p_sjekk>
560 <m_adresse1 xsi:type="xsd:string"/>
561 <m_adresse2 xsi:type="xsd:string"/>
562 <m_postnr xsi:type="xsd:string"/>
563 <m_sted xsi:type="xsd:string"/>
564 <m_land xsi:type="xsd:string">no</m_land>
565 <m_sjekk xsi:type="xsd:string">0</m_sjekk>
566 <m_gyldig_til xsi:type="xsd:string">0000-00-00</m_gyldig_til>
567 <tlf_hjemme xsi:type="xsd:string"/>
568 <tlf_jobb xsi:type="xsd:string"/>
569 <tlf_mobil xsi:type="xsd:string">12345678</tlf_mobil>
570 <epost xsi:type="xsd:string">test@example.com</epost>
571 <epost_sjekk xsi:type="xsd:string">0</epost_sjekk>
572 <prim_kontakt xsi:type="xsd:string"/>
573 <hjemmebibliotek xsi:type="xsd:string">2060000</hjemmebibliotek>
574 <fdato xsi:type="xsd:string">1964-05-22</fdato>
575 <fnr_hash xsi:type="xsd:string">22056412345</fnr_hash>
576 <kjonn xsi:type="xsd:string">F</kjonn>
577 <pin xsi:type="xsd:string">g345abc123dab567abc78900abc123ab</pin>
578 <passord xsi:type="xsd:string"/>
579 <feide xsi:type="xsd:string"/>
580 <opprettet xsi:type="xsd:string">2005-10-20</opprettet>
581 <opprettet_av xsi:type="xsd:string">2060000</opprettet_av>
582 <sist_endret xsi:type="xsd:string">2013-05-13T13:51:24</sist_endret>
583 <sist_endret_av xsi:type="xsd:string">2060000</sist_endret_av>
584 <gyldig_til xsi:type="xsd:string"/>
585 <folkeregsjekk_dato xsi:type="xsd:string">0000-00-00</folkeregsjekk_dato>
588 <server_tid xsi:type="xsd:string">2014-01-07T14:43:18</server_tid>