php.de

Zurück   php.de > Webentwicklung > PHP-Fortgeschrittene

PHP-Fortgeschrittene Arbeiten mit PHP ohne Einschränkungen

Antwort
 
LinkBack Themen-Optionen Bewertung: Bewertung: 1 Stimmen, 5,00 durchschnittlich.
Alt 20.06.2011, 12:28  
Neuer Benutzer
 
Registriert seit: 16.06.2011
Beiträge: 18
PHP-Kenntnisse:
Fortgeschritten
]jolly[ befindet sich auf einem aufstrebenden Ast
Standard [Erledigt] WSDL - ComplexType enthält nur ARRAY

Hab folgendes Problem

beim Response enthält der ComplexType nur ARRAY

mein Code:
PHP-Code:
<?php
// includes
require_once('./lib/nusoap.php');
require_once(
"./config/dbconnect.php");

// Create the server instance
$server = new soap_server();
// Initialize WSDL support
$server->configureWSDL('xcpService''urn:xcpService');
$server->wsdl->addComplexType(
    
'Category',
    
'complexType',
    
'struct',
    
'all',
    
'',
    array(
        
'name' => array('name' => 'name''type' => 'xsd:string'),
        
'value' => array('name' => 'value''type' => 'xsd:int')
    )
);

// Register the method to expose
$server->register('hello',                // method name
    
array('name' => 'xsd:string'),        // input parameters
    
array('return' => 'xsd:string'),    // output parameters
    
'urn:xcpService',                    // namespace
    
'urn:xcpService#hello',                // soapaction
    
'rpc',                                // style
    
'encoded',                            // use
    
'Says hello to the caller'            // documentation
);


$server->register('getCategories',                // method name
    
array('language' => 'xsd:string'),        // input parameters
    
array('return' => 'xsd:Category'),    // output parameters
    
'urn:xcpService',                    // namespace
    
'urn:xcpService#getCategories',                // soapaction
    
'rpc',                                // style
    
'encoded',                            // use
    
'Retruns a List of the Categories'            // documentation
);
// Define the method as a PHP function
function hello($name) {
        return 
'Hello, ' $name;
}

function 
getCategories($language){
        
        
//$categories = array();
        
        
        //$categories[] = array("name"=>"Teil", "value"=>2);*/
        //$categories = "blub";
        //return array('Category' => array('name'=>"Auto", 'value'=>1));
        
return array('name'=>"Auto"'value'=>1);
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA '';
$server->service($HTTP_RAW_POST_DATA);
?>
Die WSDL Datei:
PHP-Code:
<definitions targetNamespace="urn:xcpService"><types><xsd:schema targetNamespace="urn:xcpService"><xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/><xsd:complexType name="Category"><xsd:all><xsd:element name="name" type="xsd:string"/><xsd:element name="value" type="xsd:int"/></xsd:all></xsd:complexType></xsd:schema></types><message name="helloRequest"><part name="name" type="xsd:string"/></message><message name="helloResponse"><part name="return" type="xsd:string"/></message><message name="getCategoriesRequest"><part name="language" type="xsd:string"/></message><message name="getCategoriesResponse"><part name="return" type="xsd:Category"/></message><portType name="xcpServicePortType"><operation name="hello"><documentation>Says hello to the caller</documentation><input message="tns:helloRequest"/><output message="tns:helloResponse"/></operation><operation name="getCategories"><documentation>Retruns a List of the Categories</documentation><input message="tns:getCategoriesRequest"/><output message="tns:getCategoriesResponse"/></operation></portType><binding name="xcpServiceBinding" type="tns:xcpServicePortType"><soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/><operation name="hello"><soap:operation soapAction="urn:xcpService#hello" style="rpc"/><input><soap:body use="encoded" namespace="urn:xcpService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" namespace="urn:xcpService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation><operation name="getCategories"><soap:operation soapAction="urn:xcpService#getCategories" style="rpc"/><input><soap:body use="encoded" namespace="urn:xcpService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input><output><soap:body use="encoded" namespace="urn:xcpService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output></operation></binding><service name="xcpService"><port name="xcpServicePort" binding="tns:xcpServiceBinding"><soap:address location="http://localhost/Xcarsnparts/server.php"/></port></service></definitions
nun der Client:
PHP-Code:
try {
    
$options = array(
                
'soap_version'=>SOAP_1_1,
                
'exceptions'=>true,
                
'trace'=>1,
                
'cache_wsdl'=>WSDL_CACHE_NONE
            
); 
$client = new SOAPClient('http://localhost/********/server.php?wsdl');  


var_dump($client->__getFunctions());



echo 
$client->hello("test");
echo 
"<br><br>";
/*foreach($client->getCategories("de") AS $cat){
    echo $cat."<br>";
}*/
var_dump($client->getCategories("de")); 
ich find einfach nicht meinen Fehler!
hab schon unzählige Beispiele auf Google verglichen...

ich hoff ihr könnt mir schnell helfen
]jolly[ ist offline   Mit Zitat antworten
Sponsor Mitteilung
PHP Code Flüsterer

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

Alt 20.06.2011, 14:39  
Erfahrener Benutzer
 
Registriert seit: 19.06.2009
Beiträge: 837
PHP-Kenntnisse:
Fortgeschritten
Jens Clasen ist einfach richtig nettJens Clasen ist einfach richtig nettJens Clasen ist einfach richtig nettJens Clasen ist einfach richtig nettJens Clasen ist einfach richtig nett
Standard

Nimm mal nen anderes Prefix für Deinen ComplexType. tns bietet sich an.

Gruß Jens
Jens Clasen ist offline   Mit Zitat antworten
Alt 20.06.2011, 14:43  
Neuer Benutzer
 
Registriert seit: 16.06.2011
Beiträge: 18
PHP-Kenntnisse:
Fortgeschritten
]jolly[ befindet sich auf einem aufstrebenden Ast
Standard

Zitat:
Zitat von Jens Clasen Beitrag anzeigen
Nimm mal nen anderes Prefix für Deinen ComplexType. tns bietet sich an.

Gruß Jens
Danke!
da hätt ich noch lange gesucht.
]jolly[ ist offline   Mit Zitat antworten
Antwort


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] Mehrdimensionalem Array umformen, Index neu setzen und anschließend sortie wooha PHP Einsteiger 3 26.04.2011 12:08
Array aus SQL Abfrage zusammenbauen um es rekursiv abzuarbeiten litterauspirna PHP Einsteiger 7 01.02.2011 18:44
Feed in Datenbank eintragen (Formate: json, php serialized, xml) high_five Datenbanken 5 17.06.2010 03:04
IE8 verliert Session Lenki PHP-Fortgeschrittene 10 25.04.2010 01:10
Ein (Teil)Array anhand von level und depth zurückgeben. greatcthulhu Scriptbörse 4 16.04.2010 10:45
[Erledigt] Problem bei update mit array feldern fulltilt PHP Tipps 2010 6 13.02.2010 00:59
merge Array? tommy_725 PHP Tipps 2009 3 07.08.2009 18:30
[Erledigt] Array Sortieren beist PHP Tipps 2009 4 10.07.2009 08:53
[Erledigt] array sortieren PHP Tipps 2004 17 13.05.2009 10:44
Turnierbaum aus array erstellen kingflo PHP-Fortgeschrittene 11 30.07.2008 11:32
Soapfault: Undefined Property Argi PHP-Fortgeschrittene 0 28.07.2008 11:17
Menü mit Unterpunkten supertramp Beitragsarchiv 7 18.10.2005 22:40
Sortieren von Arrays mit mehr als 2 Dimensionen (Teil 2) Buhmann PHP-Fortgeschrittene 4 12.07.2005 14:03
[Erledigt] Mehrdimensionales Array in eindimensionales Array umwandeln PHP-Fortgeschrittene 3 03.01.2005 22:31
Abfrage mit id aus anderer Tabelle suter PHP Tipps 2004-2 15 16.12.2004 14:25

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
wsdl complextype array php, multi-operation wsdl php, nusoap sql complextype, complextype type array, soap server complex type, wsdl php define two-dimensional array, php complextype client, wsdl generate php xsd, wsdl xsd:int list, php \getcategoriesrequest\, return complextype php5, wsdl php struct, wsdl array, wsdl array of complextype, json parameter wsdl, php5 wsdl to array, schema complex type array, $server->wsdl->addcomplextype, wsdl nusoap array, phpwsdl multidimensional array return

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