October 25, 2004

More information when using WSMakeStubs

I have finally been able to get my program to send and receive XML data using Document-style web services using the WSMakeStubs generated code. My previous article describes a few bugs in the generated output from WSMakeStubs but I have also found that it tries to return the wrong object which is null. Trying to use null objects is very hard so I went digging to find out what was wrong. What I found out was that the stubs was getting the XML SOAP response message fine but it was trying to return an object from the result dictionary called “parameters” that did not exist. Once I ended up finding this it was an easy fix to just change the return statement in all the resultValue methods in the WS[name_of_service].m file. for instance change:

return [[super getResultDictionary] objectForKey: @“parameter”];

to:

return [[super getResultDictionary] objectForKey: @“/Result”];

I found this out by adding a few debug logging statements to the gotResults method in the WSGeneratedObj.m file. The debug statement used was:

NSLog(@“RESULT: %@”, [fResult allKeys]);

Hope this helps others out there.

Links
Previous WSMakeStubs Post

Posted by Egon Kuster at October 25, 2004 12:44 AM
Comments