7

I have web service, which is returning XML data. but in the data I am receiving Null fields in the beginning of it. The actual data is also available but followed by Null fields. I am accessing the webservice in Android using ksoap2. SoapObject variable has full data but also have those null field, which is kinda creating problem to work with this service. here you can see, in the starting it has nothing but later it has data starting with Tag "Title"

04-12 10:55:09.405: D/ENVELOPE(1394): GetGuestEventsListingForServiceResponse{GetGuestEventsListingForServiceResult=anyType{schema=anyType{element=anyType{complexType=anyType{choice=anyType{element=anyType{complexType=anyType{sequence=anyType{element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{}; }; }; }; }; }; }; }; diffgram=anyType{NewDataSet=anyType{Table=anyType{Title=THE CLUSTER DAY-1,  JUNKOVATION; Description=anyType{}; EventDate=Apr 12, 2013; EventTime=5:00 PM; Venue=BLOCK 13-306; CreatedBy=16689; CreatedOn=2013-04-11T09:52:07.163+05:30; EventFor=All; Type=Internal; IsActive=true; };  
4

1 回答 1

1

我不明白问题出在哪里。如果将结果字符串格式化为 xml,您将获得以下信息:

<GetGuestEventsListingForServiceResponse>
  <GetGuestEventsListingForServiceResult>
     <schema>
        <element>
          <complexType>
            <choice>
              <element>
                <complexType>
                   <sequence>
                     <element/>
                     <element/>
                     <element/>
                     <element/>
                     <element/>
                     <element/>
                     <element/>
                     <element/>
                     <element/>
                     <element/>
                   </sequence>
                </complexType>
              </element>
            </choice>
          </complexType>
        </element>
     </schema>
    <diffgram>
      <NewDataSet>
        <Table>
          <Title>THE CLUSTER DAY-1, JUNKOVATION</Title>
          <Description/>
          <EventDate>Apr 12, 2013</EventDate>
          <EventTime>5:00 PM</EventTime>
          <Venue>BLOCK 13-306</Venue>
          <CreatedBy>16689</CreatedBy>
          <CreatedOn>2013-04-11T09:52:07.163+05:30</CreatedOn>
          <EventFor>All</EventFor>
          <Type>Internal</Type>
          <IsActive>true</IsActive>
        </Table>
      </NewDataSet>
    </diffgram>
  </GetGuestEventsListingForServiceResult>
</GetGuestEventsListingForServiceResponse>

如果您的意思是为什么会有这些空元素,则必须检查服务器端的 Web 服务。如果您在服务器端与“.NET”Web 服务交互,请尝试将绑定设置为 BasicBinding

于 2013-04-14T17:43:07.630 回答