Problems with Sudz-c for iOS, missing namespace
I'm working on an app that uses a web service. This is a private service so I cannot post the WSDL or generated code 开发者_开发问答here so this is more of a question for some general advice rather than specifics.
I fed the WSDL into Sudz-c. The WSDL originally had some imports of XSD's that sudz-c would overlook so I copied these into the types section of the WSDL.
I use the generated code to make a request to the service but I'm finding that the request is missing a name space for the complex type objects I copied into the types section of the WSDL.
Again I know this is very general information but if anyone else has had a similar issue with Sudz it would be great to get your advice.
I know the thread has ended, but I found solution to this problem.. If a WSDL has external XSDs included/imported then YES, you are right to have those XSDs types copied over into WSDL (i.e. Directly EMBED it into WSDL rather than including/importing).. The generated Code is almost perfect in any sense since it generates types for XSD types as well.. but you might receive an ERROR (same error in multiple files).. which will be a missing BASE-Class of few request/response types.. after analyzing the code I realized that that missing namespace is nothing but the same SOAPObject object so I replaced that missing namespace with SOAPObject.h and used SOAPObject interface/class as the base class. e.g. in my case
#include "SOAP.h"
#include "sudz.h"
@class sudz;
@interface sudzAbstractRequestType : sudz
{
}
(Note: 'sudz' is the unique name that you use when generate code using SUDZ-C website/project, in your case it can be different). I changed the code to (everywhere in the project where this error was encountered):
#include "SOAP.h"
#include "SOAPObject.h"
@class SOAPObject;
//#include "sudz.h"
//@class sudz;
@interface sudzAbstractRequestType : SOAPObject//sudz
{
}
I hope this will help others... I was stuck for days but later got it working OK.. Happy Coding :)
One thing you might try is to make sure you fix your namespace in the actual service itself.
here is a link help get that done:
http://alensiljak.blogspot.com/2009/06/removing-httptempuriorg-namespace-from.html
Couldn't find an answer to this so ended up just hand coding the web service messages :(
精彩评论