jrdionicio / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

Problem with nested nodes XML response with ksoap2 #107

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. invoking a couple of methods of a .NET WS, I always obtain the first level 
of the aspected complex object. it is about 10 days that I am tryng to solve 
this issue (starting from suggestions of issue=90 of this site) whithout success
2. I will put here all the documentation I think could be significant for just 
one of the 2 methods: the second one gives me the same problems
3.

What is the expected output? What do you see instead?

This is the wsdl block for request:

 <soap:Body>
    <ElencoLinks xmlns="http://tempuri.org/">
      <Guid>string</Guid>
      <Id_Progetto>int</Id_Progetto>
    </ElencoLinks>
  </soap:Body>

and this is the response:

<soap:Body>
    <ElencoLinksResponse xmlns="http://tempuri.org/">
      <ElencoLinksResult xmlns="">
        <Success>boolean</Success>
        <Message>string</Message>
        <Links>
          <Link>
            <id_Link>int</id_Link>
            <PathLink>string</PathLink>
            <DescLink>string</DescLink>
            <Sottotitolo>string</Sottotitolo>
          </Link>
          <Link>
            <id_Link>int</id_Link>
            <PathLink>string</PathLink>
            <DescLink>string</DescLink>
            <Sottotitolo>string</Sottotitolo>
          </Link>
        </Links>
      </ElencoLinksResult>
    </ElencoLinksResponse>
  </soap:Body>

If I invoke the method with any other system (a .net web site, an app of 
i-world) with Guid = any not empty string (this parameter is not significat in 
this moment) and Id_Progetto = 1 I obtain exactly what expected: the following 
is, i.e., what SmartBear soapUI 4.0.1 gives:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <ElencoLinksResponse xmlns="http://tempuri.org/">
         <ElencoLinksResult xmlns="">
            <Success>true</Success>
            <Message>OK</Message>
            <Links>
               <Link>
                  <id_Link>1</id_Link>
                  <PathLink>http://sirpac.cultura.marche.it</PathLink>
                  <DescLink>&lt;strong>portale regionale&lt;/strong> del catalogo</DescLink>
                  <Sottotitolo>prova di sottotitolo</Sottotitolo>
               </Link>
               <Link>
                  <id_Link>2</id_Link>
                  <PathLink>http://musei.cultura.marche.it</PathLink>
                  <DescLink>&lt;i>portale dei musei&lt;/i> regiopnali</DescLink>
                  <Sottotitolo>altra prova</Sottotitolo>
               </Link>
            </Links>
         </ElencoLinksResult>
      </ElencoLinksResponse>
   </soap:Body>
</soap:Envelope>

In my aandroid/ksoap2 application instad I obtain

anyType{Success=true;Message=OK;Links=anyType{};}

the dump of logCat is exacly the same:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ElencoLinksResponse 
xmlns="http://tempuri.org/"><ElencoLinksResult 
xmlns=""><Success>true</Success><Message>OK</Message><Links 
/></ElencoLinksResult></ElencoLinksResponse></soap:Body></soap:Envelope>

What version of the product are you using? On what operating system?

ksoap2-android-assembly-2.6.0-jar-with-dependencies in android  2.2 environment 
with eclipse SDK 3.7.1  java compiler set to 1.6

Please provide any additional information below.

I added the code developed in the attached file that contains:
1) Presentazione.java (the very simple activity class correcly working)
2) webService.java (that invokes WS)
3) ElencoLinksResult.java (the outer kvm serialization class of the object of 
the response aspected)
4) and 5) Links.java and Link.java (the other 2 kvmserialization classes 
invoved in this question)

Any help will be ENORMOUSLY appreciated....

Original issue reported on code.google.com by effesco on 11 Feb 2012 at 4:10

Attachments:

GoogleCodeExporter commented 9 years ago
This works just fine normally. I suspect your problem is the embedded html .. 
get rid of that..and try again

<DescLink><i>portale dei musei</i> regiopnali</DescLink>

Original comment by mosa...@gmail.com on 11 Feb 2012 at 5:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Tank You mosa...@gmail.com for Your quick response!!!

SOLVED!!!!!
The problem was not in the embedded html... but in a very stupid my mistake: 
when I setted propertyinfo to call the ws I used two variables: a and b (copied 
from ad example of code) without contestualizing them with the 2 right names: 
Giud and Id_progetto!!!!!

Original comment by effesco on 11 Feb 2012 at 6:51

GoogleCodeExporter commented 9 years ago
Good.... next time please post on the mailing list rather than creating an 
issue.

Original comment by mosa...@gmail.com on 11 Feb 2012 at 7:01