Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: SoapServer - nie przesyła zwrotnego parametru
Forum PHP.pl > Forum > PHP
radoslawchojnacki@tlen.pl
Stworzyłem soap servera takiego:

  1. header('Content-Type: text/xml; charset=utf-8');
  2.  
  3. function setStatus() {
  4. return true;
  5. }
  6.  
  7. $wsdl = 'http://ddomena/strony/AAA/file.wsdl';
  8. //$soap = new SoapServer(null, array('uri' => "urn://domena/strony/AAA/ss_BBB.php"));
  9.  
  10. $soap = new SoapServer($wsdl, array('soap_version' => SOAP_1_2,
  11. 'uri' => "urn://domena/strony/AAA/ss_BBB.php"));
  12.  
  13. $soap->addFunction("setStatus");
  14. $soap->handle();


Wysylam takie coś :

  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:net="http://domena/AAA_2_8/">
  2. <soapenv:Header/>
  3. <soapenv:Body>
  4. <net:setStatus>
  5. <net:applicationId>12345</net:applicationId>
  6. <net:status>ABC</net:status>
  7. <!--Optional:-->
  8. <net:documents>
  9. <!--1 or more repetitions:-->
  10. <net:document>
  11. <net:content>cid:309278966708</net:content>
  12. <net:documentType></net:documentType>
  13. <net:name></net:name>
  14. </net:document>
  15. </net:documents>
  16. <!--Optional:-->
  17. <net:message></net:message>
  18. <!--Optional:-->
  19. <net:grantedAmount></net:grantedAmount>
  20. <!--Optional:-->
  21. <net:grantedTerm></net:grantedTerm>
  22. </net:setStatus>
  23. </soapenv:Body>
  24. </soapenv:Envelope>


a dostaję takie coś:

  1. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://domena/AAA_2_8//">
  2. <SOAP-ENV:Body>
  3. <ns1:setStatusResponse/>
  4. </SOAP-ENV:Body>
  5. </SOAP-ENV:Envelope>



jeśli zmienię $wsdl na null

  1. $soap = new SoapServer(null, array('soap_version' => SOAP_1_2,
  2. 'uri' => "urn://domena/strony/AAA/ss_BBB.php"));


wtedy zwrotka jest dobra:

  1. <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn://domena/AAA_2_8/netCredit/file.php" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
  2. <SOAP-ENV:Body>
  3. <ns1:setStatusResponse>
  4. <return xsi:type="xsd:boolean">true</return>
  5. </ns1:setStatusResponse>
  6. </SOAP-ENV:Body>
  7. </SOAP-ENV:Envelope>



o co chodzi tutaj test tutek http://www.herongyang.com/Web-Services/PHP...ServerWsdl.html

Powinno być dobrz z $wsdl a nie jest, czemu ?
SHiP
Próbowałeś wyłączyć cache wsdl?

Na szybko:
  1. ini_set("soap.wsdl_cache_enabled", "0");


albo w bardziej elegancki sposób przesyłając odpowiednią flagę w konfiguracji.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.