Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Webservice Nusoap
Randallmaster
post 8.01.2015, 13:37:03
Post #1





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


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?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
com
post 8.01.2015, 15:05:25
Post #2





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


daj ten komunikat smile.gif
Go to the top of the page
+Quote Post
Randallmaster
post 8.01.2015, 15:27:22
Post #3





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

Ostrzeżenie: (0%)
-----


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
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 06:15