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
28 require Test
::DBIx
::Class
;
31 $missing_lib = "Test::DBIx::Class";
38 $missing_lib = "SOAP::Lite";
42 require Crypt
::GCrypt
;
45 $missing_lib = "Crypt::GCrypt";
49 require Convert
::BaseN
;
52 $missing_lib = "Convert::BaseN";
56 plan skip_all
=> $missing_lib . " is not available.";
63 use Test
::DBIx
::Class
{
64 schema_class
=> 'Koha::Schema',
65 connect_info
=> ['dbi:SQLite:dbname=:memory:','',''],
66 connect_opts
=> { name_sep
=> '.', quote_char
=> '`', },
67 fixture_class
=> '::Populate',
68 }, 'Borrower', 'BorrowerSync';
70 # Make the code in the module use our mocked Koha::Schema/Koha::Database
71 my $db = Test
::MockModule
->new('Koha::Database');
73 # Schema() gives us the DB connection set up by Test::DBIx::Class
74 _new_schema
=> sub { return Schema
(); }
79 [qw
/firstname surname borrowernumber address city/],
80 ['Test', 'Borrower', 1, 'Test road', 'Test city'],
81 ['Test', 'Borrower', 2, 'Test road', 'Test city'],
82 ['Test', 'Borrower', 3, 'Test road', 'Test city'],
83 ['Test', 'Borrower', 4, 'Test road', 'Test city'],
86 [qw
/borrowernumber sync syncstatus lastsync hashed_pin synctype/],
87 [1, 1, 'new', '2014-03-31T12:35:14', 'abc', 'norwegianpatrondb' ],
88 [2, 1, 'edited', '2014-03-31T12:35:14', 'abc', 'norwegianpatrondb' ],
89 [3, 1, 'new', '2014-03-31T12:35:14', 'abc', 'norwegianpatrondb' ],
90 [4, 1, 'new', '2014-03-31T12:35:14', 'abc', 'norwegianpatrondb' ],
92 ], 'installed some fixtures';
94 =head1 LOADING THE MODULE
98 BEGIN { use_ok
( 'Koha::NorwegianPatronDB', ':all' ) }
101 =head1 UTILITY SUBROUTINES
103 =head2 NLCheckSysprefs
109 =item * NorwegianPatronDBEnable
111 =item * NorwegianPatronDBEndpoint
113 =item * NorwegianPatronDBUsername
115 =item * NorwegianPatronDBPassword
122 t
::lib
::Mocks
::mock_config
('nlkey', 'key');
123 t
::lib
::Mocks
::mock_config
('nlvendoruser', 'user');
124 t
::lib
::Mocks
::mock_config
('nlvendorpass', 'pass');
126 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBEnable', 0);
127 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBEndpoint', '');
128 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBUsername', '');
129 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBPassword', '');
131 ok
( my $result = NLCheckSysprefs
(), 'call NLCheckSysprefs() ok' );
132 is
( $result->{ 'error' }, 1, 'error detected' );
133 is
( $result->{ 'nlenabled' }, 0, 'NL is not enabled' );
134 is
( $result->{ 'endpoint' }, 0, 'an endpoint is not specified' );
135 is
( $result->{ 'userpass' }, 0, 'username and/or password is missing' );
137 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBEnable', 1);
138 ok
( $result = NLCheckSysprefs
(), 'call NLCheckSysprefs() ok' );
139 is
( $result->{ 'error' }, 1, 'error detected' );
140 is
( $result->{ 'nlenabled' }, 1, 'NL is enabled' );
141 is
( $result->{ 'endpoint' }, 0, 'an endpoint is not specified' );
142 is
( $result->{ 'userpass' }, 0, 'username and/or password is missing' );
144 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBEnable', 0);
145 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBUsername', 'user');
146 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBPassword', 'pass');
147 ok
( $result = NLCheckSysprefs
(), 'call NLCheckSysprefs() ok' );
148 is
( $result->{ 'error' }, 1, 'error detected' );
149 is
( $result->{ 'nlenabled' }, 0, 'NL is not enabled' );
150 is
( $result->{ 'endpoint' }, 0, 'an endpoint is not specified' );
151 is
( $result->{ 'userpass' }, 1, 'username and/or password is present' );
153 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBEnable', 1);
154 t
::lib
::Mocks
::mock_preference
('NorwegianPatronDBEndpoint', 'http://example.com/');
155 ok
( $result = NLCheckSysprefs
(), 'call NLCheckSysprefs() ok' );
156 is
( $result->{ 'error' }, 0, 'no error detected' );
157 is
( $result->{ 'nlenabled' }, 1, 'NL is enabled' );
158 is
( $result->{ 'endpoint' }, 1, 'an endpoint is specified' );
159 is
( $result->{ 'userpass' }, 1, 'username and/or password is present' );
161 =head2 NLGetFirstname and NLGetSurname
165 my $firstname = 'Firstname';
166 my $surname = 'Surname';
167 my $fullname = "$surname, $firstname";
168 my $wrongname = "$surname $firstname";
170 is
( NLGetFirstname
( $fullname ), $firstname, 'can get firstname from name' );
171 is
( NLGetSurname
( $fullname ), $surname, 'can get surname from name' );
172 is
( NLGetFirstname
( $wrongname ), $wrongname, 'returns full string when name misses comma' );
173 is
( NLGetSurname
( $wrongname ), $wrongname, 'returns full string when name misses comma' );
175 =head2 NLDecodePin and NLEncryptPIN
180 my $hash = NLEncryptPIN
( $pin );
182 is
( NLEncryptPIN
( $pin ), $hash, 'NLEncryptPIN works' );
183 is
( NLDecodePin
( $hash ), $pin, 'NLDecodePin works' );
185 =head2 NLUpdateHashedPIN
189 is
( BorrowerSync
->find({ 'borrowernumber' => 1 })->get_column('hashed_pin'), 'abc', 'hashed_pin is "abc"' );
192 ok
( NLUpdateHashedPIN
( 1, $new_pin ), 'NLUpdateHashedPIN runs ok' );
193 # Hash the new pin and compare it to the one stored in the database
194 my $hashed_pin = Koha
::NorwegianPatronDB
::_encrypt_pin
( $new_pin );
195 is
( BorrowerSync
->find({ 'borrowernumber' => 1 })->get_column('hashed_pin'), $hashed_pin, 'hashed_pin was updated' );
197 =head2 NLMarkForDeletion
201 is
( BorrowerSync
->find({ 'borrowernumber' => 3 })->get_column('syncstatus'), 'new', 'syncstatus is "new"' );
202 ok
( NLMarkForDeletion
( 3 ), 'NLMarkForDeletion runs ok' );
203 # Check that the syncstatus was updated. Note: We will use this status later, to check syncing of deleted borrowers
204 is
( BorrowerSync
->find({ 'borrowernumber' => 3 })->get_column('syncstatus'), 'delete', 'syncstatus is "delete"' );
206 =head2 NLGetSyncDataFromBorrowernumber
210 ok
( my $sync_data = NLGetSyncDataFromBorrowernumber
( 1 ), 'NLGetSyncDataFromBorrowernumber runs ok' );
211 isa_ok
( $sync_data, 'Koha::Schema::Result::BorrowerSync' );
212 is
( $sync_data->sync, 1, 'the sync is on' );
213 is
( $sync_data->syncstatus, 'new', 'syncstatus is "new"' );
214 is
( $sync_data->lastsync, '2014-03-31T12:35:14', 'lastsync is ok' );
215 is
( $sync_data->hashed_pin, $hashed_pin, 'hashed_pin is ok' );
217 =head1 SUBROUTINES THAT TALK TO SOAP
223 my $lite = Test
::MockModule
->new('SOAP::Lite');
225 # Mock a successfull call to the "hent" method
227 hent
=> sub { return SOAP
::Deserializer
->deserialize( hent_success
() )->result; }
229 ok
( my $res = NLSearch
( '12345678910' ), 'successfull call to NLSearch' );
230 is
( $res->{'antall_poster_returnert'}, 1, 'got 1 record' );
231 isa_ok
( $res, "Resultat" );
232 isa_ok
( $res->{'respons_poster'}, "LaanerListe" );
233 isa_ok
( $res->{'respons_poster'}[0], "Laaner" );
235 # Mock an unsuccessfull call to the "hent" method
237 hent
=> sub { return SOAP
::Deserializer
->deserialize( hent_failure
() )->result; }
239 ok
( $res = NLSearch
( '12345678910' ), 'call to NLSearch with an illegal argument' );
240 is
( $res->{'antall_poster_returnert'}, 0, 'got 0 records' );
241 isa_ok
( $res, "Resultat" );
242 like
( $res->{'melding'}, qr/Ulovlig argument: hverken LNR eller FNR_HASH/, "got expected error message for an illegal identifier" );
250 my $borrower = Borrower
->find({ 'borrowernumber' => 1 });
252 nyPost
=> sub { return SOAP
::Deserializer
->deserialize( nyPost_success
() )->result; }
254 is
( BorrowerSync
->find({ 'borrowernumber' => 1 })->get_column('syncstatus'), 'new', 'patron is new' );
255 ok
( $result = NLSync
({ 'patron' => $borrower }), 'successfull call to NLSync via patron ("nyPost")' );
256 is
( BorrowerSync
->find({ 'borrowernumber' => 1 })->get_column('syncstatus'), 'synced', 'patron is synced' );
258 # Now do the same test, but pass in a borrowernumber, not a Koha::Schema::Result::Borrower
259 is
( BorrowerSync
->find({ 'borrowernumber' => 4 })->get_column('syncstatus'), 'new', 'patron is new' );
260 ok
( $result = NLSync
({ 'borrowernumber' => 4 }), 'successfull call to NLSync via borrowernumber ("nyPost")' );
261 is
( BorrowerSync
->find({ 'borrowernumber' => 4 })->get_column('syncstatus'), 'synced', 'patron is synced' );
267 ok
( $borrower = Borrower
->find({ 'borrowernumber' => 2 }), 'find our "edited" mock patron' );
269 endre
=> sub { return SOAP
::Deserializer
->deserialize( endre_success
() )->result; }
271 is
( BorrowerSync
->find({ 'borrowernumber' => 2 })->get_column('syncstatus'), 'edited', 'patron is edited' );
272 ok
( $result = NLSync
({ 'patron' => $borrower }), 'successfull call to NLSync ("endre")' );
273 is
( BorrowerSync
->find({ 'borrowernumber' => 2 })->get_column('syncstatus'), 'synced', 'patron is synced' );
275 =head3 Deleted patron
279 ok
( $borrower = Borrower
->find({ 'borrowernumber' => 3 }), 'find our "deleted" mock patron' );
281 slett
=> sub { return SOAP
::Deserializer
->deserialize( endre_success
() )->result; }
283 is
( BorrowerSync
->find({ 'borrowernumber' => 3 })->get_column('syncstatus'), 'delete', 'patron is marked for deletion' );
284 ok
( $result = NLSync
({ 'patron' => $borrower }), 'successfull call to NLSync ("slett")' );
285 is
( BorrowerSync
->find({ 'borrowernumber' => 3 })->get_column('sync'), 0, 'sync is now disabled' );
291 # Mock a successfull call to the "soekEndret" method
293 soekEndret
=> sub { return SOAP
::Deserializer
->deserialize( soekEndret_success
() ); }
295 ok
( $res = NLGetChanged
(), 'successfull call to NLGetChanged - 2 results' );
296 is
( $res->{'melding'}, 'OK', 'got "OK"' );
297 is
( $res->{'antall_poster_returnert'}, 2, 'got 2 records' );
298 isa_ok
( $res, "Resultat" );
299 isa_ok
( $res->{'respons_poster'}, "LaanerListe" );
300 isa_ok
( $res->{'respons_poster'}[0], "Laaner" );
303 # Mock a successfull call to the "soekEndret" method, but with zero new records
305 soekEndret
=> sub { return SOAP
::Deserializer
->deserialize( soekEndret_zero_new
() ); }
307 ok
( $res = NLGetChanged
(), 'successfull call to NLGetChanged - 0 results' );
308 is
( $res->{'melding'}, 'ingen treff', 'got "ingen treff"' );
309 is
( $res->{'antall_poster_returnert'}, 0, 'got 0 records' );
310 is
( $res->{'antall_treff'}, 0, 'got 0 records' );
312 =head1 SAMPLE SOAP XML RESPONSES
314 These responses can be gathered by setting "outputxml()" to true on the SOAP
317 my $client = SOAP::Lite
318 ->on_action( sub { return '""';})
319 ->uri('http://lanekortet.no')
320 ->proxy('https://fl.lanekortet.no/laanekort/fl_test.php')
322 my $response = $client->slett( $x );
325 Pretty formatting can be achieved by piping the output from a test script
328 perl my_test_script.pl > xmllint --format -
334 return <<'ENDRESPONSE';
335 <?xml version="1.0" encoding="UTF-8"?>
336 <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/">
339 <return xsi:type="ns1:Svar">
340 <status xsi:type="xsd:boolean">true</status>
341 <melding xsi:type="xsd:string">Test Testersen (1973-08-11) er slettet fra registeret</melding>
342 <lnr xsi:type="xsd:string">N000106188</lnr>
343 <server_tid xsi:type="xsd:string">2014-06-02T16:51:58</server_tid>
354 return <<'ENDRESPONSE';
355 <?xml version="1.0" encoding="UTF-8"?>
356 <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/">
359 <return xsi:type="ns1:Svar">
360 <status xsi:type="xsd:boolean">true</status>
361 <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>
362 <lnr xsi:type="xsd:string">N000106188</lnr>
363 <server_tid xsi:type="xsd:string">2014-06-02T16:42:32</server_tid>
374 return <<'ENDRESPONSE';
375 <?xml version="1.0" encoding="UTF-8"?>
376 <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/">
379 <return xsi:type="ns1:Svar">
380 <status xsi:type="xsd:boolean">true</status>
381 <melding xsi:type="xsd:string">Ny post er opprettet</melding>
382 <lnr xsi:type="xsd:string">N000106188</lnr>
383 <server_tid xsi:type="xsd:string">2014-06-02T14:10:09</server_tid>
385 </ns1:nyPostResponse>
392 sub soekEndret_success
{
394 return <<'ENDRESPONSE';
395 <?xml version="1.0" encoding="UTF-8"?>
397 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
398 xmlns:ns1="http://lanekortet.no"
399 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
400 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
401 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
402 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
404 <ns1:soekEndretResponse>
405 <return xsi:type="ns1:Resultat">
406 <status xsi:type="xsd:boolean">true</status>
407 <melding xsi:type="xsd:string">OK</melding>
408 <antall_treff xsi:type="xsd:int">2</antall_treff>
409 <antall_poster_returnert xsi:type="xsd:int">2</antall_poster_returnert>
410 <neste_indeks xsi:type="xsd:int">0</neste_indeks>
411 <respons_poster SOAP-ENC:arrayType="ns1:Laaner[2]" xsi:type="ns1:LaanerListe">
412 <item xsi:type="ns1:Laaner">
413 <lnr xsi:type="xsd:string">N000106186</lnr>
414 <navn xsi:type="xsd:string">Hansen, Hanne</navn>
415 <p_adresse1 xsi:type="xsd:string"/>
416 <p_adresse2 xsi:type="xsd:string"/>
417 <p_postnr xsi:type="xsd:string"/>
418 <p_sted xsi:type="xsd:string">BØDØ</p_sted>
419 <p_land xsi:type="xsd:string">no</p_land>
420 <p_sjekk xsi:type="xsd:string">0</p_sjekk>
421 <m_adresse1 xsi:type="xsd:string"/>
422 <m_adresse2 xsi:type="xsd:string"/>
423 <m_postnr xsi:type="xsd:string"/>
424 <m_sted xsi:type="xsd:string"/>
425 <m_land xsi:type="xsd:string"/>
426 <m_sjekk xsi:type="xsd:string">0</m_sjekk>
427 <m_gyldig_til xsi:type="xsd:string">0000-00-00</m_gyldig_til>
428 <tlf_hjemme xsi:type="xsd:string"/>
429 <tlf_jobb xsi:type="xsd:string"/>
430 <tlf_mobil xsi:type="xsd:string"/>
431 <epost xsi:type="xsd:string"/>
432 <epost_sjekk xsi:type="xsd:string"/>
433 <prim_kontakt xsi:type="xsd:string"/>
434 <hjemmebibliotek xsi:type="xsd:string">5180401</hjemmebibliotek>
435 <fdato xsi:type="xsd:string">1994-04-08</fdato>
436 <fnr_hash xsi:type="xsd:string">11087395628</fnr_hash>
437 <kjonn xsi:type="xsd:string">F</kjonn>
438 <pin xsi:type="xsd:string">89308dfc85ee7a5826ae14e2d8efad1e</pin>
439 <passord xsi:type="xsd:string"/>
440 <feide xsi:type="xsd:string">0</feide>
441 <opprettet xsi:type="xsd:string">2014-04-28T15:20:38</opprettet>
442 <opprettet_av xsi:type="xsd:string">5180401</opprettet_av>
443 <sist_endret xsi:type="xsd:string">2014-04-28T15:20:38</sist_endret>
444 <sist_endret_av xsi:type="xsd:string">5180401</sist_endret_av>
445 <folkeregsjekk_dato xsi:type="xsd:string">0000-00-00</folkeregsjekk_dato>
447 <item xsi:type="ns1:Laaner">
448 <lnr xsi:type="xsd:string">N000106184</lnr>
449 <navn xsi:type="xsd:string">Enger, Magnus</navn>
450 <p_adresse1 xsi:type="xsd:string">Svarthammarveien 633333</p_adresse1>
451 <p_adresse2 xsi:type="xsd:string"/>
452 <p_postnr xsi:type="xsd:string">8015</p_postnr>
453 <p_sted xsi:type="xsd:string">Bodø</p_sted>
454 <p_land xsi:type="xsd:string">no</p_land>
455 <p_sjekk xsi:type="xsd:string">0</p_sjekk>
456 <m_adresse1 xsi:type="xsd:string"/>
457 <m_adresse2 xsi:type="xsd:string"/>
458 <m_postnr xsi:type="xsd:string"/>
459 <m_sted xsi:type="xsd:string"/>
460 <m_land xsi:type="xsd:string">no</m_land>
461 <m_sjekk xsi:type="xsd:string">0</m_sjekk>
462 <m_gyldig_til xsi:type="xsd:string">0000-00-00</m_gyldig_til>
463 <tlf_hjemme xsi:type="xsd:string">95158548</tlf_hjemme>
464 <tlf_jobb xsi:type="xsd:string"/>
465 <tlf_mobil xsi:type="xsd:string"/>
466 <epost xsi:type="xsd:string">magnus@enger.priv.no</epost>
467 <epost_sjekk xsi:type="xsd:string"/>
468 <prim_kontakt xsi:type="xsd:string"/>
469 <hjemmebibliotek xsi:type="xsd:string">5180401</hjemmebibliotek>
470 <fdato xsi:type="xsd:string">1973-08-11</fdato>
471 <fnr_hash xsi:type="xsd:string">11087345795</fnr_hash>
472 <kjonn xsi:type="xsd:string">M</kjonn>
473 <pin xsi:type="xsd:string">a632c504b8c4fba3149115cb07e0796c</pin>
474 <passord xsi:type="xsd:string"/>
475 <feide xsi:type="xsd:string">0</feide>
476 <opprettet xsi:type="xsd:string">2014-04-28T14:52:02</opprettet>
477 <opprettet_av xsi:type="xsd:string">5180401</opprettet_av>
478 <sist_endret xsi:type="xsd:string">2014-05-13T11:01:33</sist_endret>
479 <sist_endret_av xsi:type="xsd:string">5180401</sist_endret_av>
480 <folkeregsjekk_dato xsi:type="xsd:string">0000-00-00</folkeregsjekk_dato>
483 <server_tid xsi:type="xsd:string">2014-05-16T14:44:44</server_tid>
485 </ns1:soekEndretResponse>
491 sub soekEndret_zero_new
{
492 return <<'ENDRESPONSE';
493 <?xml version="1.0" encoding="UTF-8"?>
494 <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/">
496 <ns1:soekEndretResponse>
497 <return xsi:type="ns1:Resultat">
498 <status xsi:type="xsd:boolean">false</status>
499 <melding xsi:type="xsd:string">ingen treff</melding>
500 <antall_treff xsi:type="xsd:int">0</antall_treff>
501 <antall_poster_returnert xsi:type="xsd:int">0</antall_poster_returnert>
502 <neste_indeks xsi:type="xsd:int">0</neste_indeks>
503 <respons_poster SOAP-ENC:arrayType="ns1:Laaner[0]" xsi:type="ns1:LaanerListe"/>
504 <server_tid xsi:type="xsd:string">2014-05-20T13:02:02</server_tid>
506 </ns1:soekEndretResponse>
513 return <<'ENDRESPONSE';
514 <?xml version="1.0" encoding="UTF-8"?>
516 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
517 xmlns:ns1="http://lanekortet.no"
518 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
519 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
520 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
521 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
524 <return xsi:type="ns1:Resultat">
525 <status xsi:type="xsd:boolean">false</status>
526 <melding xsi:type="xsd:string">hent: Ulovlig argument: hverken LNR eller FNR_HASH</melding>
527 <antall_treff xsi:type="xsd:int">0</antall_treff>
528 <antall_poster_returnert xsi:type="xsd:int">0</antall_poster_returnert>
529 <neste_indeks xsi:type="xsd:int">0</neste_indeks>
530 <respons_poster SOAP-ENC:arrayType="ns1:Laaner[0]" xsi:type="ns1:LaanerListe"/>
531 <server_tid xsi:type="xsd:string">2014-05-15T10:56:24</server_tid>
542 return <<'ENDRESPONSE';
543 <?xml version="1.0" encoding="UTF-8"?>
545 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
546 xmlns:ns1="http://lanekortet.no"
547 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
548 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
549 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
550 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
553 <return xsi:type="ns1:Resultat">
554 <status xsi:type="xsd:boolean">true</status>
555 <melding xsi:type="xsd:string">OK</melding>
556 <antall_treff xsi:type="xsd:int">1</antall_treff>
557 <antall_poster_returnert xsi:type="xsd:int">1</antall_poster_returnert>
558 <neste_indeks xsi:type="xsd:int">0</neste_indeks>
559 <respons_poster SOAP-ENC:arrayType="ns1:Laaner[1]" xsi:type="ns1:LaanerListe">
560 <item xsi:type="ns1:Laaner">
561 <lnr xsi:type="xsd:string">N000123456</lnr>
562 <navn xsi:type="xsd:string">Test, Testersen</navn>
563 <p_adresse1 xsi:type="xsd:string">Bibliotekveien 6</p_adresse1>
564 <p_adresse2 xsi:type="xsd:string"/>
565 <p_postnr xsi:type="xsd:string">1234</p_postnr>
566 <p_sted xsi:type="xsd:string">Lillevik</p_sted>
567 <p_land xsi:type="xsd:string">no</p_land>
568 <p_sjekk xsi:type="xsd:string">0</p_sjekk>
569 <m_adresse1 xsi:type="xsd:string"/>
570 <m_adresse2 xsi:type="xsd:string"/>
571 <m_postnr xsi:type="xsd:string"/>
572 <m_sted xsi:type="xsd:string"/>
573 <m_land xsi:type="xsd:string">no</m_land>
574 <m_sjekk xsi:type="xsd:string">0</m_sjekk>
575 <m_gyldig_til xsi:type="xsd:string">0000-00-00</m_gyldig_til>
576 <tlf_hjemme xsi:type="xsd:string"/>
577 <tlf_jobb xsi:type="xsd:string"/>
578 <tlf_mobil xsi:type="xsd:string">12345678</tlf_mobil>
579 <epost xsi:type="xsd:string">test@example.com</epost>
580 <epost_sjekk xsi:type="xsd:string">0</epost_sjekk>
581 <prim_kontakt xsi:type="xsd:string"/>
582 <hjemmebibliotek xsi:type="xsd:string">2060000</hjemmebibliotek>
583 <fdato xsi:type="xsd:string">1964-05-22</fdato>
584 <fnr_hash xsi:type="xsd:string">22056412345</fnr_hash>
585 <kjonn xsi:type="xsd:string">F</kjonn>
586 <pin xsi:type="xsd:string">g345abc123dab567abc78900abc123ab</pin>
587 <passord xsi:type="xsd:string"/>
588 <feide xsi:type="xsd:string"/>
589 <opprettet xsi:type="xsd:string">2005-10-20</opprettet>
590 <opprettet_av xsi:type="xsd:string">2060000</opprettet_av>
591 <sist_endret xsi:type="xsd:string">2013-05-13T13:51:24</sist_endret>
592 <sist_endret_av xsi:type="xsd:string">2060000</sist_endret_av>
593 <gyldig_til xsi:type="xsd:string"/>
594 <folkeregsjekk_dato xsi:type="xsd:string">0000-00-00</folkeregsjekk_dato>
597 <server_tid xsi:type="xsd:string">2014-01-07T14:43:18</server_tid>