Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> SOAP zwrócenie tablicy
gsk
post 4.11.2012, 19:04:55
Post #1





Grupa: Zarejestrowani
Postów: 129
Pomógł: 4
Dołączył: 21.02.2004
Skąd: z domu

Ostrzeżenie: (0%)
-----


Chcę zwrócić tablice i za chiny nie mogę wink.gif Siedzę już kilka godzin i nie wiem jak to ruszyć. Za każdym razem dostaje błąd:

  1. Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error in /var/www/Test/Soap.php:7 Stack trace: #0 [internal function]: SoapClient->__doRequest('__call('hello', Array) #2 /var/www/Test/Soap.php(7): SoapClient->hello(Array) #3 {main} thrown in /var/www/Test/Soap.php on line 7


Natomiast gdy zwracam string'a normalnie go wyświetla.

Ktoś byłby tak miły i wytłumaczyłby mi o co chodzi?

Poniżej załączam plik wsdl.

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <definitions name="HelloWebService"
  3. targetNamespace="urn:hellowebservice"
  4. xmlns:tns="urn:hellowebservice"
  5. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  6. xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  7. xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  8. xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  9. xmlns="http://schemas.xmlsoap.org/wsdl/">
  10.  
  11. <types>
  12. <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:hellowebservice">
  13. <xsd:complexType name="ArrayOfString">
  14. <xsd:complexContent>
  15. <xsd:restriction base="soapenc:Array">
  16. <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
  17. </xsd:restriction>
  18. </xsd:complexContent>
  19. </xsd:complexType>
  20. </xsd:schema>
  21. </types>
  22. <message name="helloRequest">
  23. <part name="name" type="xsd:ArrayOfString" />
  24. </message>
  25. <message name="helloResponse">
  26. <part name="return" type="xsd:ArrayOfString" />
  27. </message>
  28. <portType name="HelloService">
  29. <operation name="hello">
  30. <input message="tns:helloRequest"/>
  31. <output message="tns:helloResponse"/>
  32. </operation>
  33. </portType>
  34. <binding name="HelloServiceBinding" type="tns:HelloService">
  35. <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  36. <operation name="hello">
  37. <soap:operation soapAction="urn:arnleadservicewsdl#hello" style="rpc"/>
  38. <input>
  39. <soap:body use="encoded" namespace="urn:hellowebservice"
  40. encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  41. </input>
  42. <output>
  43. <soap:body use="encoded" namespace="urn:hellowebservice"
  44. encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  45. </output>
  46. </operation>
  47. </binding>
  48. <service name="HelloService">
  49. <port name="HelloServicePort" binding="tns:HelloServiceBinding">
  50. <soap:address location="http://hello.pl/api/soap" />
  51. </port>
  52. </service>
  53. </definitions>


--------------------
pomoglem wcisnij przycisk "pomogl" - dzieki...
Go to the top of the page
+Quote Post
Dudon
post 4.11.2012, 22:49:55
Post #2





Grupa: Zarejestrowani
Postów: 9
Pomógł: 0
Dołączył: 23.05.2011

Ostrzeżenie: (0%)
-----


Miałem podobny problem, tutaj masz coś co może ci pomóc:

http://www.ws-i.org/profiles/basicprofile-...l#soapenc_Array

możesz też użyć biblioteki NuSoap, pozwala ona na bardzo szybkie tworzenie serwera i klienta soap, ale mi osobiście działa tylko w sytuacji :

klient PHP + PHP serwer

Ten post edytował Dudon 4.11.2012, 22:54:14
Go to the top of the page
+Quote Post
gsk
post 5.11.2012, 18:38:03
Post #3





Grupa: Zarejestrowani
Postów: 129
Pomógł: 4
Dołączył: 21.02.2004
Skąd: z domu

Ostrzeżenie: (0%)
-----


Ok poradzilem sobie smile.gif Problem był w tym, że wsdl był cache'owany i nie reagował na moje zmiany... Na przyszłość radzę zaglądnąć to katalogu /tmp smile.gif

Pozdrawiam,

Ten post edytował gsk 5.11.2012, 22:26:21


--------------------
pomoglem wcisnij przycisk "pomogl" - dzieki...
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 25.06.2025 - 01:56