Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Webservice Nusoap
Forum PHP.pl > Forum > Przedszkole
Randallmaster
Stworzyłem taki webservice za pomocą nusoap:

  1. $this->namespace = $this->Session->host;
  2. $server = new soap_server();
  3. $server->debug_flag = false;
  4. $server->configureWSDL('WebService', $this->namespace, 'http://'.$_SERVER['HTTP_HOST'] . $this->webroot . $this->params['controller'] );
  5. $server->soap_defencoding = 'UTF-8';
  6. $server->decode_utf8 = false;
  7. $server->wsdl->schemaTargetNamespace = $this->namespace;
  8.  
  9. //register position
  10. $server->register(
  11. 'WsController.contractors', //name of function
  12. array("array"=>"xsd:Array", "email"=>"xsd:string", "password"=>"xsd:string"), //inputs
  13. array("return"=>"xsd:Array") //outputs //Array - tablica
  14. );
  15. //register position - end
  16.  
  17. $HTTP_RAW_POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA']) ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';
  18. $server->service($HTTP_RAW_POST_DATA);


problem mam z tym miejscem:
  1. array("array"=>"xsd:Array"


Dlaczego po połączeniu się z webservice mam informację że to pole jest sringiem?
Czy poprawnie dodałem tablicę array?
com
daj ten komunikat smile.gif
Randallmaster
Nie miałem zdefiniowanego:

  1. $server->wsdl->addComplexType (
  2. 'servelArrayName',
  3. 'complexType',
  4. 'struct',
  5. 'all',
  6. '',
  7. 'first' => array('name' => 'first', 'type' => 'xsd:string'),
  8. 'second' => array('name' => 'second', 'type' => 'xsd:string'),
  9. 'third' => array('name' => 'third', 'type' =>'xsd:string'))
  10. );
  11.  
  12. $server->wsdl->addComplexType(
  13. 'rdElement',
  14. 'complexType',
  15. 'array',
  16. '',
  17. 'SOAP-ENC:Array',
  18. array(),
  19.  
  20. array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:servelArrayName[]')),
  21. 'tns:servelArrayName');


pokazuje teraz że niby jest struktura array, tylko nie wiem jak teraz to odebrać biggrin.gif
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.