php.de

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

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 17.03.2010, 18:59  
Neuer Benutzer
 
Registriert seit: 22.02.2010
Beiträge: 12
PHP-Kenntnisse:
Anfänger
thomasch befindet sich auf einem aufstrebenden Ast
Standard SOAP greift auf falsche Funktion zu

Hallo,
ich versuche mich gerade in Webservices einzuarbeiten - nach dem, was ich bisher so gelesen habe, scheint das - bis auf die WSDL auch kein großes Thema zu sein.

Ich habe momentan folgendes Problem:
Wenn ich meinen Server mit der Zweiten Funktion (sayBallo) teste, wird anscheindend intern die erste Funktion (sayHallo) aufgerufen - und dementsprechend ein ungültiges Ergebnis (Objekt statt String) generiert.

Wo ist der Haken?

Mein Server:
PHP-Code:
<?php
    
class Baum {
        public 
$Wer;
        public 
$Wann;
        public 
$Was;

        function 
__construct() {
            
$this->Wann='2010';
            
$this->Was='alles';
            
$this->Wer='ich';
        }
    }



    function 
sayHallo($wer){
       
$mybaum=new Baum();
       return 
$mybaum;
    }

    function 
sayBallo($param) {

    return 
$param->Wer.'|Tut';
    }

    
$myServer = new SoapServer("Komplex.wsdl");
    
$myServer->addFunction(array("sayBallo""sayHallo"));
    
$myServer->handle();

?>
Meine WSDL:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ubuntu/~thomas/WSDL1/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Komplex" targetNamespace="http://ubuntu/~thomas/WSDL1/">
  <wsdl:types>
    <xsd:schema targetNamespace="http://ubuntu/~thomas/WSDL1/">
    	<xsd:element name="sayHalloType">
    		<xsd:complexType>
    			<xsd:sequence>
    				<xsd:element name="Wer" type="xsd:string" />
    				<xsd:element name="Wann" type="xsd:int"></xsd:element>
    				<xsd:element name="Was" type="xsd:string"></xsd:element>
    			</xsd:sequence>
    		</xsd:complexType>
    	</xsd:element>
    	<xsd:element name="sayBalloResponse1">
    		<xsd:complexType>
    			<xsd:sequence>
    				<xsd:element name="out" type="xsd:string"></xsd:element>
    			</xsd:sequence>
    		</xsd:complexType>
    	</xsd:element>
    	<xsd:element name="sayBalloResponse">
    		<xsd:complexType>
    			<xsd:sequence>

    				<xsd:element name="out" type="xsd:string"></xsd:element>
    			</xsd:sequence>
    		</xsd:complexType>
    	</xsd:element></xsd:schema>
  </wsdl:types>
  <wsdl:message name="sayHalloResponse">
    <wsdl:part element="tns:sayHalloType" name="MyResponse"/>
  </wsdl:message>
  <wsdl:message name="sayHalloRequest1">
  	<wsdl:part name="MyInput" element="tns:sayHalloType"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="sayBalloRequest">
  	<wsdl:part name="MyOtherInput" element="tns:sayHalloType"></wsdl:part>
  </wsdl:message>
  <wsdl:message name="sayBalloResponse">
  	<wsdl:part name="MyRes" type="xsd:string"></wsdl:part>
  </wsdl:message>
  <wsdl:portType name="Komplex">
    <wsdl:operation name="sayHallo">
            <wsdl:input message="tns:sayHalloRequest1"></wsdl:input>
            <wsdl:output message="tns:sayHalloResponse"/>
    </wsdl:operation>

    
    <wsdl:operation name="sayBallo">
    	<wsdl:input message="tns:sayBalloRequest"></wsdl:input>
    	<wsdl:output message="tns:sayBalloResponse"></wsdl:output>
    </wsdl:operation></wsdl:portType>

  
  <wsdl:binding name="KomplexSOAP" type="tns:Komplex">
  	<soap:binding style="document"
  		transport="http://schemas.xmlsoap.org/soap/http" />
  	<wsdl:operation name="sayHallo">

  		<soap:operation
  			soapAction="http://ubuntu/~thomas/WSDL1/sayHallo" />
  		<wsdl:input>

  			<soap:body use="literal" />
  		</wsdl:input>
  		<wsdl:output>

  			<soap:body use="literal" />
  		</wsdl:output>
  	</wsdl:operation>
  	<wsdl:operation name="sayBallo">

  		<soap:operation
  			soapAction="http://ubuntu/~thomas/WSDL1/sayBallo" />
  		<wsdl:input>

  			<soap:body use="literal" />
  		</wsdl:input>
  		<wsdl:output>

  			<soap:body use="literal" />
  		</wsdl:output>
  	</wsdl:operation>
  </wsdl:binding>



  <wsdl:service name="Komplex">
    <wsdl:port binding="tns:KomplexSOAP" name="KomplexSOAP">
      <soap:address location="http://ubuntu/~thomas/WSDL1/"/>
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions>
Danke schonmal

Thomasch
thomasch ist offline  
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
[Erledigt] funktion aufrufen wenn andere funktion aufgerufen wird kalli.c0re PHP Tipps 2009 16 05.06.2009 13:49
JS: Einführung - Javascript im Schichtenmodell nikosch Tutorials 4 11.04.2009 17:06
ü,ä,ö bei mail funktion, falsche Darstellung Radik PHP Tipps 2009 1 30.03.2009 17:48
Fragen und Verwendung der SOAP Erweiterung von PHP Tanja PHP-Fortgeschrittene 5 15.09.2008 09:29
phpmyadmin greift auf falsche db-daten zu nieselfriem Server, Hosting und Workstations 8 13.08.2008 16:38
Größenbeschränkung bei PEAR SOAP Antwort? Anotherone PHP-Fortgeschrittene 1 13.01.2008 20:32
Komplexe Funktion: +Übersichtlichkeit, -Performance Jacks Rache PHP Tipps 2006 3 07.06.2006 14:22
SOAP WSDL-> Funktion hinzufügen... PHP Tipps 2006 0 16.02.2006 15:07
falsche funktion?? mollitz PHP Tipps 2006 12 07.02.2006 18:51
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
Funktion in einer Funktion aufrufen? PHP Tipps 2005-2 11 14.06.2005 15:14
[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
ubuntu soap, soap falsche adresse, soap php xsd hinzufügen, \xmlns:tns\ funktion, wsdl elementname php, php soap nimmt falsche funktion, wsdl:message ohne part, wsdl sequence, wsdl function aufrufen php, elementname php soap, php soap ubuntu, php soap-erweiterung ubuntu, php soap xsd int, soap server führt falsche funktion aus, soap falsche funktion wird aufgerufen, <soap:body use=\literal\/> php, soap without wsdl php, \message name\ same xsd \element name\ wsdl

Alle Zeitangaben in WEZ +2. Es ist jetzt 21:32 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