Announcement

Collapse
No announcement yet.

Hilfe beim Aufbau einer SOAP Envelope Anfrage

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

  • Hilfe beim Aufbau einer SOAP Envelope Anfrage

    Hallo liebes Entwicklerforum,
    vielleicht könnt ihr mir helfen. Ich habe folgende XML Dateien (Schemata) von einem SOAP Server:

    <xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/CisLogic.MobileHybriCare.Data" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/CisLogic.MobileHybriCare.Data">
    <xs:import schemaLocation="http://80.153.206.248/MobileHybriCareService/?xsd=xsd3" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
    <xs:complexType name="AnswerDto">
    <xs:sequence>
    <xs:element minOccurs="0" name="AnswerNr" type="xs:int"/>
    <xs:element minOccurs="0" name="QuestionNr" type="xs:int"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="AnswerDto" nillable="true" type="tns:AnswerDto"/>
    <xs:complexType name="SequenceDto">
    <xs:sequence>
    <xs:element minOccurs="0" name="AnswerList" nillable="true" type="q1:ArrayOfanyType" xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
    <xs:element minOccurs="0" name="CreationDate" type="xs:dateTime"/>
    <xs:element minOccurs="0" name="MobileId" nillable="true" type="xs:string"/>
    <xs:element minOccurs="0" name="QuestionaryNr" type="xs:int"/>
    <xs:element minOccurs="0" name="SequenceKey" type="xs:int"/>
    <xs:element minOccurs="0" name="TimeStamp" type="xs:int"/>
    </xs:sequence>
    </xs:complexType>
    ...

    sowie für das ArrayOfanyType

    <xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <xs:complexType name="ArrayOfanyType">
    <xs:sequence>
    <xs:element minOccurs="0" maxOccurs="unbounded" name="anyType" nillable="true" type="xs:anyType"/>
    </xs:sequence>
    </xs:complexType>
    <xs:element name="ArrayOfanyType" nillable="true" type="tns:ArrayOfanyType"/>
    </xs:schema>

    SoapUI (http://www.soapui.org/) gab mir den folgenden Vorschlag ausgehend von den XML Schemata und der WSDL Beschreibung für einen Service-Aufruf mit der Capability/Methode AddSequence

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:cis="http://schemas.datacontract.org/2004/07/CisLogic.MobileHybriCare.Data" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <soapenv:Header/>
    <soapenv:Body><tem:AddSequence>
    <!--Optional:-->
    <tem:sequence>
    <!--Optional:-->
    <cis:AnswerList>
    <!--Zero or more repetitions:-->
    <arr:anyType>?</arr:anyType>
    </cis:AnswerList>
    <!--Optional:-->
    <cis:CreationDate>?</cis:CreationDate>
    <!--Optional:-->
    <cis:MobileId>?</cis:MobileId>
    <!--Optional:-->
    <cis:QuestionaryNr>?</cis:QuestionaryNr>
    <!--Optional:-->
    <cis:SequenceKey>?</cis:SequenceKey>
    <!--Optional:-->
    <cis:TimeStamp>?</cis:TimeStamp>
    </tem:sequence>
    </tem:AddSequence>
    </soapenv:Body>
    </soapenv:Envelope>

    Der Soap Call funktioniert dann auch mit:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:cis="http://schemas.datacontract.org/2004/07/CisLogic.MobileHybriCare.Data" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <soapenv:Header/>
    <soapenv:Body>
    <tem:AddSequence>
    <!--Optional:-->
    <tem:sequence>
    <!--Optional:-->
    <cis:AnswerList>
    </cis:AnswerList>
    <!--Optional:-->
    <cis:CreationDate>2008-10-29T12:01:05</cis:CreationDate>
    <!--Optional:-->
    <cis:MobileId>x111111</cis:MobileId>
    <!--Optional:-->
    <cis:QuestionaryNr>1</cis:QuestionaryNr>
    <!--Optional:-->
    <cis:SequenceKey>1</cis:SequenceKey>
    <!--Optional:-->
    <cis:TimeStamp>20091111</cis:TimeStamp>
    </tem:sequence>
    </tem:AddSequence>
    </soapenv:Body>
    </soapenv:Envelope>

    Aber hier ist dann AnswerList ausgelassen. Ich habe keine Ahnung wie ich das dort füllen muss. Wenn jemand weiss, wie ich dort AnswerList füllen kann oder wo ich nachschauen kann wie die richtige Syntax zur Darstellung ist, wäre ich sehr verbunden.
    Zuletzt editiert von altmann; 16.02.2010, 18:36.
Working...
X