Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP][SOAP][WSDL]SOAP Jak uwtorzyć klienta
Forum PHP.pl > Forum > PHP
escobar1983
Witam serdecznie.
Dostałem od klienta linka do połaczenia via SOAP
acc-flexwerkers.hollandzorg.nl/uzb/services/uzb-v1.wsdl


Jak powinien wygladać klient?
  1. $wsdl="https://acc-flexwerkers.hollandzorg.nl/uzb/services/uzb-v1.wsdl";
  2. $client = new SoapClient($wsdl,array('trace'=>true,
  3. 'exceptions'=>false));
  4. var_dump($client->__getFunctions());

zwraca mi
  1. array(1) { [0]=> string(39) "UzbResponse Uzb(UzbRequest $UzbRequest)" }

Wiem że muszę się odwołać do Uzb ale jak i jak powinien wyglądać klient

  1. $param=array(
  2. 'UzbRequest'=>array(
  3. 'Aanlevering'=>array(
  4. 'Authorisatie'=>
  5. array('AuthorisatieType'=>array(
  6. array('Afzender'=>array("_"=>'test')
  7. ,'Sleutel'=>array("_"=>'test12344')
  8. )
  9. )
  10. )
  11. )
  12. )
  13. );
  14. $client->__soapCall("Uzb", $param);

Zwraca mi wtedy
  1. Fatal error: SOAP-ERROR: Encoding: object hasn't 'Authorisatie' property


Z góry dzięki za pomoc
Puszy
Nie wiem dlaczego ale niektóre Web Service'y odróżniają tablice od obiektów o poprawnych nazwach, spróbuj utworzyć modele.

więcej: http://forum.php.pl/index.php?s=&showt...t&p=1023864
escobar1983
Próbowałem zmienić array'a na obiekt przy użyciu json'a ale ten sam efekt
Puszy
Potrzeba tutaj jakiegoś hasła i loginu? Teoretycznie skrypt mi działa, ale zwraca wyjątek bo serwer nie może odczytać XMLa, miałem tak nie raz z pewnym WebServicem. Tam problemem było złe wypełnienie pól, np int w stringu lub null zamiast floata etc.

  1. <?php
  2.  
  3. require_once 'nl_models.php';
  4.  
  5. class NLSC extends SoapClient{
  6.  
  7. private $WSDL = 'https://acc-flexwerkers.hollandzorg.nl/uzb/services/uzb-v1.wsdl';
  8.  
  9. public function __construct(){
  10. parent::SoapClient($this->WSDL);
  11. }
  12.  
  13. /**
  14. * @return UzbResponse
  15. */
  16. public function doUzb(){
  17. $callQuery = new UzbRequest();
  18.  
  19. #
  20. # tutaj dodaj odpowiednie dane do obiektu $callQuery
  21. #
  22.  
  23. return $this->__soapCall("Uzb", array($callQuery));
  24. }
  25.  
  26. }
  27.  
  28. print_r('<pre>');
  29.  
  30. $test = new NLSC();
  31.  
  32. print_r($test->doUzb());
  33.  
  34. print_r('</pre>');
  35.  
  36. ?>


modele:
  1. <?php
  2.  
  3. class UzbRequest{
  4. /**
  5. * @var AuthorisatieType
  6. */
  7. public $Authorisatie;
  8.  
  9. /**
  10. * @var Aanlevering
  11. */
  12. public $Aanlevering;
  13.  
  14.  
  15. }
  16. class Aanlevering{
  17. /**
  18. * @var Correcties
  19. */
  20. public $Correcties;
  21.  
  22. /**
  23. * @var Mutaties
  24. */
  25. public $Mutaties;
  26.  
  27. /**
  28. * @var string
  29. */
  30. public $ID;
  31.  
  32.  
  33. }
  34. class Correcties{
  35. /**
  36. * @var Correctie
  37. */
  38. public $Correctie;
  39.  
  40.  
  41. }
  42. class Correctie{
  43. /**
  44. * @var Aanmelding
  45. */
  46. public $Aanmelding;
  47.  
  48. /**
  49. * @var Afmelding
  50. */
  51. public $Afmelding;
  52.  
  53. /**
  54. * @var string
  55. */
  56. public $ID;
  57.  
  58. /**
  59. * @var string
  60. */
  61. public $MutatieID;
  62.  
  63. /**
  64. * @var BSNType
  65. */
  66. public $BSN;
  67.  
  68. /**
  69. * @var string
  70. */
  71. public $Collectiviteit;
  72.  
  73.  
  74. }
  75. class Afmelding{
  76. /**
  77. * @var date
  78. */
  79. public $Einddatum;
  80.  
  81.  
  82. }
  83. class Mutaties{
  84. /**
  85. * @var Mutatie
  86. */
  87. public $Mutatie;
  88.  
  89.  
  90. }
  91. class Mutatie{
  92. /**
  93. * @var Aanmelding
  94. */
  95. public $Aanmelding;
  96.  
  97. /**
  98. * @var Afmelding
  99. */
  100. public $Afmelding;
  101.  
  102. /**
  103. * @var Persoonsgegevens
  104. */
  105. public $Persoonsgegevens;
  106.  
  107. /**
  108. * @var string
  109. */
  110. public $ID;
  111.  
  112. /**
  113. * @var BSNType
  114. */
  115. public $BSN;
  116.  
  117. /**
  118. * @var string
  119. */
  120. public $Collectiviteit;
  121.  
  122.  
  123. }
  124. class Aanmelding{
  125. /**
  126. * @var date
  127. */
  128. public $Ingangsdatum;
  129.  
  130. /**
  131. * @var date
  132. */
  133. public $Geboortedatum;
  134.  
  135. /**
  136. * @var GeslachtType
  137. */
  138. public $Geslacht;
  139.  
  140. /**
  141. * @var NAWType
  142. */
  143. public $NAW;
  144.  
  145. /**
  146. * @var NationaliteitType
  147. */
  148. public $Nationaliteit;
  149.  
  150. /**
  151. * @var KeuzeType
  152. */
  153. public $E106;
  154.  
  155.  
  156. }
  157. class Persoonsgegevens{
  158. /**
  159. * @var date
  160. */
  161. public $Geboortedatum;
  162.  
  163. /**
  164. * @var GeslachtType
  165. */
  166. public $Geslacht;
  167.  
  168. /**
  169. * @var NAWType
  170. */
  171. public $NAW;
  172.  
  173. /**
  174. * @var NationaliteitType
  175. */
  176. public $Nationaliteit;
  177.  
  178.  
  179. }
  180. class UzbResponse{
  181. /**
  182. * @var string
  183. */
  184. public $Referentie;
  185.  
  186. /**
  187. * @var Statuscode
  188. */
  189. public $Statuscode;
  190.  
  191. /**
  192. * @var Foutmeldingen
  193. */
  194. public $Foutmeldingen;
  195.  
  196.  
  197. }
  198. class Statuscode{
  199.  
  200. }
  201. class Foutmeldingen{
  202. /**
  203. * @var Foutmelding
  204. */
  205. public $Foutmelding;
  206.  
  207.  
  208. }
  209. class Foutmelding{
  210. /**
  211. * @var Foutcode
  212. */
  213. public $Foutcode;
  214.  
  215. /**
  216. * @var string
  217. */
  218. public $Omschrijving;
  219.  
  220. /**
  221. * @var string
  222. */
  223. public $ID;
  224.  
  225.  
  226. }
  227. class Foutcode{
  228.  
  229. }
  230. class AuthorisatieType{
  231. /**
  232. * @var string
  233. */
  234. public $Afzender;
  235.  
  236. /**
  237. * @var string
  238. */
  239. public $Sleutel;
  240.  
  241.  
  242. }
  243. class KeuzeType{
  244.  
  245. }
  246. class BSNType{
  247.  
  248. }
  249. class CollectiviteitType{
  250.  
  251. }
  252. class GeslachtType{
  253.  
  254. }
  255. class AchternaamType{
  256. /**
  257. * @var string
  258. */
  259. public $Voorvoegsel;
  260.  
  261. /**
  262. * @var string
  263. */
  264. public $Achternaam;
  265.  
  266.  
  267. }
  268. class VolledigeNaamType{
  269. /**
  270. * @var string
  271. */
  272. public $Voorletters;
  273.  
  274. /**
  275. * @var AchternaamType
  276. */
  277. public $EigenNaam;
  278.  
  279. /**
  280. * @var AchternaamType
  281. */
  282. public $NaamEchtgenoot;
  283.  
  284.  
  285. }
  286. class AdresType{
  287. /**
  288. * @var string
  289. */
  290. public $Straat;
  291.  
  292. /**
  293. * @var string
  294. */
  295. public $Huisnummer;
  296.  
  297. /**
  298. * @var string
  299. */
  300. public $HuisnummerToevoeging;
  301.  
  302. /**
  303. * @var string
  304. */
  305. public $Postcode;
  306.  
  307. /**
  308. * @var string
  309. */
  310. public $Plaats;
  311.  
  312.  
  313. }
  314. class DomicilieAdresType{
  315. /**
  316. * @var LandcodeType
  317. */
  318. public $Landcode;
  319.  
  320.  
  321. }
  322. class LandcodeType{
  323.  
  324. }
  325. class NAWType{
  326. /**
  327. * @var VolledigeNaamType
  328. */
  329. public $Naam;
  330.  
  331. /**
  332. * @var DomicilieAdresType
  333. */
  334. public $DomicilieAdres;
  335.  
  336.  
  337. }
  338. class NationaliteitcodeType{
  339.  
  340. }
  341. class NationaliteitType{
  342. /**
  343. * @var NationaliteitcodeType
  344. */
  345. public $Nationaliteitcode;
  346.  
  347. /**
  348. * @var LandcodeType
  349. */
  350. public $Landcode;
  351.  
  352. /**
  353. * @var string
  354. */
  355. public $Omschrijving;
  356.  
  357.  
  358. }
  359.  
  360. ?>
escobar1983
Tak potrzebny jest tak login i hasło
Własnie dostałem informację jak powinnien wyglądać przesyłany xml.
Możesz mi pomóc ogarnać jak ma być wywołny ten UZB skoro mamy Authorisatie oraz Aanlevering no i Aanlevering ma ID tak jak np. Mutatie ID i BSN


  1. <UzbRequest xmlns="http://flexwerkers.hollandzorg.nl/uzb/v1">
  2. <Authorisatie>
  3. <Afzender>LOGIN</Afzender>
  4. <Sleutel>PASS</Sleutel>
  5. </Authorisatie>
  6. <Aanlevering ID="2012-10-17 14:41:18.000088">
  7. <Mutaties>
  8. <Mutatie ID="194526" BSN="XXXXX" Collectiviteit="YYYYY">
  9. <Aanmelding>
  10. <Ingangsdatum>2012-09-24</Ingangsdatum>
  11. <Geboortedatum>1901-01-01</Geboortedatum>
  12. <Geslacht>M</Geslacht>
  13. <NAW>
  14. <Naam>
  15. <Voorletters>CP</Voorletters>
  16. <EigenNaam>
  17. <Achternaam>NOWAK</Achternaam>
  18. </EigenNaam>
  19. </Naam>
  20. <DomicilieAdres>
  21. <Straat>ZWYCIENSTWA</Straat>
  22. <Huisnummer>5</Huisnummer>
  23. <Postcode>99-999</Postcode>
  24. <Plaats>TEST</Plaats>
  25. <Landcode>PL</Landcode>
  26. </DomicilieAdres>
  27. </NAW>
  28. <Nationaliteit>
  29. <Landcode>DE</Landcode>
  30. </Nationaliteit>
  31. <E106>Nee</E106>
  32. </Aanmelding>
  33. </Mutatie>
  34. </Mutaties>
  35. </Aanlevering>
  36. </UzbRequest>
  37.  
Puszy
Spróbuj skrypt z posta wyżej, podstaw swój login, hasło i potrzebne dane, odpal i daj znać czy przeszło.
escobar1983
Zobacz mojego posta powyżej.
Puszy
Jak na moje oko XML jest ciut źle chodzi o fragment gdzie dla taga masz przypisany atrybuty. Przerzuć ID przy Aanlevering i ID, BSN, Collectiviteit przy Mutatie.

  1. <UzbRequest xmlns="http://flexwerkers.hollandzorg.nl/uzb/v1">
  2. <Authorisatie>
  3. <Afzender>LOGIN</Afzender>
  4. <Sleutel>PASS</Sleutel>
  5. </Authorisatie>
  6. <Aanlevering>
  7. <ID>2012-10-17 14:41:18.000088</ID>
  8. <Mutaties>
  9. <Mutatie>
  10. <ID>194526</ID>
  11. <BSN>XXXXX</BSN>
  12. <Collectiviteit>YYYYY</Collectiviteit>
  13. <Aanmelding>
  14. <Ingangsdatum>2012-09-24</Ingangsdatum>
  15. <Geboortedatum>1901-01-01</Geboortedatum>
  16. <Geslacht>M</Geslacht>
  17. <NAW>
  18. <Naam>
  19. <Voorletters>CP</Voorletters>
  20. <EigenNaam>
  21. <Achternaam>NOWAK</Achternaam>
  22. </EigenNaam>
  23. </Naam>
  24. <DomicilieAdres>
  25. <Straat>ZWYCIENSTWA</Straat>
  26. <Huisnummer>5</Huisnummer>
  27. <Postcode>99-999</Postcode>
  28. <Plaats>TEST</Plaats>
  29. <Landcode>PL</Landcode>
  30. </DomicilieAdres>
  31. </NAW>
  32. <Nationaliteit>
  33. <Landcode>DE</Landcode>
  34. </Nationaliteit>
  35. <E106>Nee</E106>
  36. </Aanmelding>
  37. </Mutatie>
  38. </Mutaties>
  39. </Aanlevering>
  40. </UzbRequest>
  41.  
escobar1983
Aha ok sprobuje tak. A mozesz mi przyklad pokazac jak to podlaczy razem czyli Authorisatie i Aanlevering
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.