Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> SOAP pierwsze kroki
smiady
post
Post #1





Grupa: Zarejestrowani
Postów: 137
Pomógł: 2
Dołączył: 2.07.2007
Skąd: Ostrzeszów

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


Zdobywam wiedzę i uczę się SOAPa i mam taki kod:

Plik SoapName.php
  1. class Name {
  2. private $full_name;
  3.  
  4. public function createName($first_name, $second_name) {
  5. $first= strtoupper(substr($first_name, 0, 1));
  6. $second= ucfirst(strtolower($second_name));
  7.  
  8. $this->full_name= $first . '. ' . $second;
  9.  
  10. return $this->full_name;
  11. }
  12.  
  13. public function countName() {
  14. return strlen($this->full_name);
  15. }
  16. }
  17.  
  18. $options= array('uri' => 'http://localhost/soap');
  19. $server= new SoapServer(NULL, $options);
  20. $server->setClass('Name');
  21. $server->handle();


index.php
  1. try {
  2. $options= array('uri' => 'http://localhost/soap',
  3. 'location' => 'http://localhost/soap/SoapName.php');
  4. $client= new SoapClient(NULL, $options);
  5. echo $client->createName('alicja', 'kowalska');
  6. } catch(Exception $e) {
  7. echo $e->getMessage();
  8. }


Klasa jest dobrze napisana, bo sprawdzałem, ale niestety wyskakuje mi taki wyjątek:
DTD are not supported by SOAP
Czy ktoś się kiedyś z takim problemem spotkał ?

Ten post edytował smiady 4.07.2014, 18:38:02
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 23.08.2025 - 14:49