php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2006

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 16.02.2006, 15:07  
Gast
 
Beiträge: n/a
Standard SOAP WSDL-> Funktion hinzufügen...

Hallo,

ich beschäftige mich gerade mit SOAP unter PHP5. Hierzu versuche ich gerade das Beispiel von folgender Seite nachzuvollziehen:

http://www.professionelle-softwareen...-php.soap.html

Das Beispiel läuft auch soweit, allerdings enden meine Versuche, eine weiter Funktion (nennen wir sie mal zum Test halloHoelle()) immer in Fehlermeldungen...

Also bisher habe ich einfach in das gegebene Beispiel folgendes Eingefügt:

Datei Bulletin2_server.php

Code:
<?php
class Webdienst {
  public function halloWelt() {
    return 'Hallo Welt';
  }
  
    public function halloHoelle() {
    return 'Hallo Hölle';
  }
}
 
try {
  $server = new SOAPServer('Bulletin2.wsdl');
  $server->setClass('Webdienst');
  $server->handle();
}
 
catch (SOAPFault $f) {
  print $f->faultstring;
}
?>

Datei client.php

Code:
<?php
try {

 $client = new SOAPClient('http://localhost/Bulletin2_server.php?wsdl');
 
  print $client->halloWelt();
  print $client->halloHoelle();
  
}
 
catch (SOAPFault $f) {
  print $f->faultstring;
}
?>

und zu guter letzt, meiner Meinung nach der Grund für meine Problemchen:

Die WSDL-Datei:

Code:
<?xml version ="1.0" encoding ="UTF-8" ?>

<definitions name="Bulletin2_server"
 targetNamespace="http://localhost/Bulletin2_server"
 xmlns:tns=" http://localhost/Bulletin2_server"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
 xmlns="http://schemas.xmlsoap.org/wsdl/">

 <message name="halloWeltResponse">
  <part name="Result" type="xsd:string"/>
 </message>

 <portType name="HalloWeltPortType">
  <operation name="halloWelt">
   <output message="tns:halloWeltResponse"/>
  </operation>
    <operation name="halloHoelle">
   <output message="tns:halloHoelleResponse"/>
  </operation>
 </portType>

 <binding name="HalloWeltBinding" type="tns:HalloWeltPortType">
  <soap:binding
   style="rpc"
   transport="http://schemas.xmlsoap.org/soap/http"/>

  <operation name="halloWelt">
   <soap:operation soapAction="urn:hallowelt#halloWelt"/>
   <output>
    <soap:body
     use="encoded"
     namespace="urn:hallowelt"
     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
   </output>
  </operation>
 </binding>
 

 <message name="halloHoelleResponse">
  <part name="Result" type="xsd:string"/>
 </message>

 <binding name="HalloHoelleBinding" type="tns:HalloHoellePortType">
  <soap:binding
   style="rpc"
   transport="http://schemas.xmlsoap.org/soap/http"/>

  <operation name="halloHoelle">
   <soap:operation soapAction="urn:hallohoelle#halloHoelle"/>
   <output>
    <soap:body
     use="encoded"
     namespace="urn:hallohoelle"
     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
   </output>
  </operation>
 </binding>


 <service name="HalloWeltService">
  <port name="HalloWeltPort" binding="HalloWeltBinding">
   <soap:address location="http://localhost/Bulletin2_server.php"/>
  </port>
 </service>
 
  <service name="HalloHoelleService">
  <port name="HalloWeltPort" binding="HalloHoelleBinding">
   <soap:address location="http://localhost/Bulletin2_server.php"/>
  </port>
 </service>
 
</definitions>

Also Fehlermeldung kommt immer folgendes:

Zitat:
Hallo WeltFunction ("halloHoelle") is not a valid method for this service
Also ich wäre für jede Hilfe dankbar!!

Gruß,
Michael
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
JS: Einführung - Javascript im Schichtenmodell nikosch Tutorials 4 11.04.2009 17:06
Rekursive Funktion bricht ab... duras666 PHP Tipps 2008 9 28.04.2008 11:36
Größenbeschränkung bei PEAR SOAP Antwort? Anotherone PHP-Fortgeschrittene 1 13.01.2008 20:32
gpc_quotes funktion: verbesserungsvorschläge? Promaetheus PHP Tipps 2007 10 12.08.2007 19:29
php5 soap extension, soap attachment zcmaster PHP-Fortgeschrittene 0 07.08.2006 16:09
Komplexe Funktion: +Übersichtlichkeit, -Performance Jacks Rache PHP Tipps 2006 3 07.06.2006 14:22
[Erledigt] Soap wsdl und Arrays PHP-Fortgeschrittene 1 06.01.2006 12:26
PHP-GTK Tutorial Beitragsarchiv 9 02.11.2005 21:07
Rückgabewert einer rekrusiven Funktion PHP-Fortgeschrittene 7 06.10.2005 18:44
(schnellere) Funktion zum Zusammenfassen von CSS PHP-Fortgeschrittene 21 08.08.2005 16:47
In einer Funktion auf eine Funktion der Klasse zugreifen phpbeginner PHP Tipps 2005-2 2 28.07.2005 00:30
Funktion in einer Funktion aufrufen? PHP Tipps 2005-2 11 14.06.2005 15:14
[Erledigt] Array-Übergabe in Funktion PHP Tipps 2005 1 08.05.2005 21:05
[Erledigt] Wie kann ich beliebig viele Werte an eine Funktion übergeben PHP Tipps 2005 11 25.01.2005 10:44
[Erledigt] Referenz auf Funktion übergeben PHP-Fortgeschrittene 7 20.07.2004 09:51

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
wsdl funktionen anzeigen, php soap mehrere funktionen, wsdl function, wsdl datei 2 funktionen, \soap::wsdl\ beispiel, php soap hallowelt result, wsdl beispiel, function aus wsdl aufrufen, php wsdl operation, wsdl zusammenführen, php function to wsdl, wsdl exapmle 2 functions, wsdlfunction is not a valid method, php wsdl function, wsdl example 2 functions, wsdl beispiel \2 funktionen\, wsdl beispiel mehrere funktionen, wsdl example mehrere funktionen, php wsdl mehrere results, what are soap <port name

Alle Zeitangaben in WEZ +2. Es ist jetzt 11:58 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.