sssuourabh / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
0 stars 0 forks source link

bodyParts is empty though result is visible in log #179

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I have attached the WSDL and code
2.
3.

What is the expected output?
bodyParts should have several purchase orders

What do you see instead?
empty bodyParts array but response is visible in log

What version of the product are you using? On what operating system?
0.7 pre release on Mac OS Lion

Please provide any additional information below.

Original issue reported on code.google.com by jagadish...@gmail.com on 26 Mar 2012 at 6:10

Attachments:

GoogleCodeExporter commented 9 years ago
Are the issues still being looked? Is group active?

Original comment by jagadish...@gmail.com on 27 Mar 2012 at 6:50

GoogleCodeExporter commented 9 years ago
Have you been able to find a work around this issue?

Original comment by saco.met...@gmail.com on 27 May 2012 at 11:41

GoogleCodeExporter commented 9 years ago
I just got around this issue... I'm not even close to be sure if this is the 
correct solution for the problem but it seems to be working so far, at least 
for me.

Just a little explanation (I won't go much further because I solved the problem 
just by following my intuition):

I looked at the code generated in types.m and noticed the following line of 
code 

xmlChar *instanceType = xmlGetNsProp(cur, (const xmlChar *) "type", (const 
xmlChar *) "http://www.w3.org/2001/XMLSchema-instance");

I also looked at the response I received from the server and noticed that this 
namespace is not present, but this one is:

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

So I wondered where is the first one coming from? Maybe it was specified in the 
wsdl... But it wasn't... 

So I went back to types.m and replaced every occurence of 
"http://www.w3.org/2001/XMLSchema-instance" with 
"http://www.w3.org/2001/XMLSchema" and everything seems to be working.

Original comment by francisco.samuel on 27 May 2012 at 5:24

GoogleCodeExporter commented 9 years ago
Hi,
I was able to resolve the issue. Some times WSDL2OBJC is getting confused if 
element name and complex type name in it is same. So I changed the wsdl so 
complex type name is different and regenerated the code. 

Regards,
Jagadish

Original comment by jagadish...@gmail.com on 28 May 2012 at 6:32

GoogleCodeExporter commented 9 years ago
I had a similar problem, I solved it by adding few chunks of code in 

- (void)connectionDidFinishLoading:(NSURLConnection *)connection

while debugging I noticed that I receive response but its not parsed well, so 
its actually missing an element that I wanted to 

so I added these lines, 

 if(xmlStrEqual(bodyNode->name, (const xmlChar *) "FlagResponse")) {
                                    vbBankServiceService_FlagResponse *bodyObject = [vbBankServiceService_FlagResponse deserializeNode:bodyNode];
                                    //NSAssert1(bodyObject != nil, @"Errors while parsing body %s", bodyNode->name);
                                    if (bodyObject != nil) [responseBodyParts addObject:bodyObject];
                                }

the above chunk must be placed in the for loop that traverses bodyNode.
this is in my case, for you the object/class may differ while the concept 

An alternative way to fix this would be to add a response operation to the WSDL 
and regenerate the code, though I tried it and failed.

Original comment by salim.me...@gmail.com on 21 Mar 2014 at 5:19