SoapClient hibakeresés
Üdv Mindenkinek,
olyan kérdésem lenne,hogy van egy comlpex type-os Soap Server és Client, mindkettő PHP-ban van megcsinálva, de állandóan hibaüzentet kapok: DTD are not Supported by SOAP-al
Server (wsServer.php):Client (wsclient.php):wsdl (wsServer.wsdl):Azt hiszem, jelen pillanatban ez így elég jól használható, mindössze, annyi, hogy az egészet a "docroot"/wsdlmaker/example könyvtárba kellene helyezni.
Én már nem látom a fától az erdőt és a hibát sem tudom felderíteni. Egy szóköz változás sincs a tegnap estihez képest.
A kérdés, hogy ha valaki le tudná tesztelni, hogy nála se működik az jó lenne és megköszönném? Tegnap éjjel még működött, de ma reggelre felmondta a szolgálatot. Nem éles rendszer!!!
Üdv
Sanyi
■ olyan kérdésem lenne,hogy van egy comlpex type-os Soap Server és Client, mindkettő PHP-ban van megcsinálva, de állandóan hibaüzentet kapok: DTD are not Supported by SOAP-al
Server (wsServer.php):
- <?php
- class ctManu {
- /** @var string Identity of the Manufacturer */
- public $id;
- /** @var string Name of the Manufacturer */
- public $name;
- public function __construct( $id, $name ) {
- $this->id = $id;
- $this->name = $name;
- }
- }
- class wsServer {
- protected $tranid;
- public function __construct( ) {
- $this->tranid = $this->loadTransid();
- }
- private function loadTransid() {
- if ( !isset($_SESSION) ) {
- session_start();
- }
- //return $_SESSION['tranid'];
- return '20C';
- }
- /**
- * Get Car manufacturers to fill up combobox
- * @param string $tranid transaction identifier after login
- * @return ctManu[]
- */
- public function getManufacturers( $tranid ) {
- if ( $tranid == $this->tranid ) {
- $out = array(
- new ctManu('aaa','Opel'),
- new ctManu('xxx','Porsche')
- );
- return $out;
- }
- }
- }
- ini_set("soap.wsdl_cache_enabled", "0");
- $server = new SoapServer( "http://localhost/wsdlmaker/example/wsServer.php" );
- $server->setClass( "wsServer" );
- $server->handle();
- ?>
- <?php
- $client = new SoapClient("http://localhost/wsdlmaker/example/wsServer.wsdl");
- $tranid = '20C';
- //var_dump( $client->__getFunctions() );
- //var_dump( $client->__getTypes() );
- try{
- $res = $client->getManufacturers( $tranid );
- } catch ( SoapFault $SF) {
- var_dump( $SF );
- }
- var_dump($res);?>
- <?xml version="1.0" encoding="UTF-8"?>
- <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" name="service1" targetNamespace="http://localhost/WS/login.php?f=wsServer.wsdl" xmlns:tns="http://localhost/WS/login.php?f=wsServer.wsdl" xmlns:impl="http://localhost/WS/login.php?f=wsServer.wsdl" xmlns:xsd1="http://localhost/WS/login.php?f=wsServer.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://localhost/WS/login.php?f=wsServer.wsdl">
- <complexType name="ArrayOfctManu">
- <complexContent>
- <restriction base="soapenc:Array">
- <attribute ref="soapenc:arrayType" wsdl:arrayType="tns:ctManu[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="ctManu">
- <sequence>
- <element name="id" type="xsd:string"/>
- <element name="name" type="xsd:string"/>
- </sequence>
- </complexType>
- </schema>
- </types>
- <portType name="service1PortType">
- <operation name="getManufacturers" parameterOrder="tranid">
- <input message="tns:GetManufacturersRequest"/>
- <output message="tns:GetManufacturersResponse"/>
- </operation>
- </portType>
- <binding name="service1Binding" type="tns:service1PortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="getManufacturers">
- <soap:operation soapAction="urn:service1#service1Server#getManufacturers"/>
- <input>
- <soap:body parts="tranid" use="encoded" namespace="http://localhost/WS/login.php?f=wsServer.wsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body parts="return" use="encoded" namespace="http://localhost/WS/login.php?f=wsServer.wsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
- <message name="GetManufacturersRequest">
- <part name="tranid" type="xsd:string"/>
- </message>
- <message name="GetManufacturersResponse">
- <part name="return" type="tns:ArrayOfctManu"/>
- </message>
- <service name="service1Service">
- <port name="service1Port" binding="tns:service1Binding">
- <soap:address location="http://localhost/wsdlmaker/example/wsServer.php"/>
- </port>
- </service>
- </definitions>
Én már nem látom a fától az erdőt és a hibát sem tudom felderíteni. Egy szóköz változás sincs a tegnap estihez képest.
A kérdés, hogy ha valaki le tudná tesztelni, hogy nála se működik az jó lenne és megköszönném? Tegnap éjjel még működött, de ma reggelre felmondta a szolgálatot. Nem éles rendszer!!!
Üdv
Sanyi
megloldás
hát hosszú bajlódás után végül is sikerült kiderítenem, hogy a PHP cache-li a wsdl fájlokat és hiába van kikapcsolva a cache-lés 1xűen nem hajlandó frissíteni a wsdl, csak ha manuálisan kitörlöm a cache-ből a wsdl kezdetű fájt.
Mindenesetre sokat segített a __getLastResponse(), __getLastRequestHeaders, __getLastRequest függvények a probléma felderítésében.
Elnézést mindenkitől, aki foglalkozott vele és idejét vettel el.
Üdv
Sanyi