Announcement

Collapse
No announcement yet.

Probleme zwischen PHP Webservice und .NET-Client

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Probleme zwischen PHP Webservice und .NET-Client

    Hallo,

    ich habe leider ein relativ grosses Problem beim verarbeiten von PHP-Webservices im .NET-Framework (Visual Studio Webdeveloper)

    folgende Situation:
    Der Webservice läuft derzeit erfolgreich mittels NuSoap-Bibliothek und wird von verschiedenen Applikationen (geschrieben in Delphi, Java, PHP) angesprochen - ohne Probleme.

    Beim Aufruf über .NET werden die Arrays aus den Webservice Responses nicht verarbeitet und sind immer NULL.

    Im folgenden hab ich mal die wichtigsten Dateien (WSDL,Request,Response) aufgelistet, die die Funktionsweise verdeutlichen. Vielleicht liegt ja ein mir unbekannter Fehler in den Definitionen des WSDL vor, mit dem .NET nicht klar kommt?
    Eine Überprüfung mittels XML-Spy hat keine Fehler ergeben...

    WSDL-File:
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="auvito" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="auvito" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
    <xsd:schema targetNamespace="auvito">
    <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
    <xsd:complexType name="CategoriesRequestType">
    <xsd:all>
    <xsd:element minOccurs="0" name="ParentCategory" type="xsd:int" />
    <xsd:element minOccurs="0" name="LimitLevel" type="xsd:int" />
    <xsd:element minOccurs="0" name="ShowAllNodes" type="xsd:boolean" />
    </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="CategoryType">
    <xsd:all>
    <xsd:element name="CategoryID" type="xsd:int" />
    </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="CategoryContainerType">
    <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="unbounded" name="Category" type="tns:CategoryType" />
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="CategoriesResponseType">
    <xsd:all>
    <xsd:element name="CategoryCount" type="xsd:int" />
    <xsd:element name="HasMoreCategories" type="xsd:int" />
    <xsd:element name="TreeVersion" type="xsd:string" />
    <xsd:element minOccurs="0" name="ParentCategory" type="xsd:int" />
    <xsd:element minOccurs="0" name="CategoryContainer" type="tns:CategoryContainerType" />
    </xsd:all>
    </xsd:complexType>
    </xsd:schema>
    </wsdl:types>
    <wsdl:message name="getCategoriesRequest">
    <wsdlTongue outart name="CategoriesRequest" type="tns:CategoriesRequestType" />
    </wsdl:message>
    <wsdl:message name="getCategoriesResponse">
    <wsdlTongue outart name="CategoriesResponse" type="tns:CategoriesResponseType" />
    </wsdl:message>
    <wsdlTongue outortType name="serverPortType">
    <wsdlperation name="getCategories">
    <documentation>Retrieve the Categories</documentation>
    <wsdl:input message="tns:getCategoriesRequest" />
    <wsdlutput message="tns:getCategoriesResponse" />
    </wsdlperation>
    </wsdlTongue outortType>
    <wsdl:binding name="serverBinding" type="tns:serverPortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
    <wsdlperation name="getCategories">
    <soapperation soapAction="getCategories" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="auvito" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdlutput>
    <soap:body use="encoded" namespace="auvito" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdlutput>
    </wsdlperation>
    </wsdl:binding>
    <wsdl:service name="server">
    <wsdlTongue outort name="serverPort" binding="tns:serverBinding">
    <soap:address location="http://km22322.auvito.de/server.php" />
    </wsdlTongue outort>
    </wsdl:service>
    </wsdl:definitions>


    XML-Request:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <m:getCategories xmlns:m="auvito" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <CategoriesRequest xsi:type="m:CategoriesRequestType">
    <ParentCategory xsi:type="xsd:int">0</ParentCategory>
    <LimitLevel xsi:type="xsd:int">0</LimitLevel>
    <ShowAllNodes xsi:type="xsd:boolean">true</ShowAllNodes>
    </CategoriesRequest>
    </m:getCategories>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>


    Response:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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/" xmlns:tns="auvito">
    <SOAP-ENV:Body>
    <ns1:getCategoriesResponse xmlns:ns1="auvito">
    <CategoriesResponse xsi:type="tns:CategoriesResponseType">
    <CategoryCount xsi:type="xsd:int">1</CategoryCount>
    <HasMoreCategories xsi:type="xsd:int">0</HasMoreCategories>
    <TreeVersion xsi:type="xsd:string">1.00</TreeVersion>
    <CategoryContainer xsi:type="tns:CategoryContainerType">
    <Category xsi:type="tns:CategoryType">
    <CategoryID xsi:type="xsd:int">123</CategoryID>
    </Category>
    </CategoryContainer>
    </CategoriesResponse>
    </ns1:getCategoriesResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

  • #2
    Hallo,

    Ich hatte am Anfang auch ähnliche Probleme (unter anderem auch mit Arrays) mit PHP-Soap und .NET. Bei mir lag es daran, dass .NET das "rpc/encoded" WSDL nicht mochte. Nachdem ich das WSDL auf "document/literal" umgestellt hatte, lief alles wunderbar.

    Bei mir war laut XML-Spy auch alles mit der "rpc/encoded" WSDL-Datei in Ordnung, aber das Microsoft WSDL-Tool (wsdl.exe aus dem .NET-Framework) hatte einiges zu meckern, das ich dann behoben habe.

    Comment

    Working...
    X