I've been searching for a solution that can generate Objective C classes from XSD schema, but cant find anything useful so far. I am planning to use it in my nextcoming app within Xcode.
Asked
Active
Viewed 2,507 times
4
-
Why do you need to do that? Do you have existing XSDs you want to generate classes from? If not, then you may want to look at other options specific to Objective-C. – Cajunluke Aug 16 '11 at 13:56
-
The entire concept is to communicate to specific Cloud Service Bus service via Iphone. The bus itselfs have specific XSD schema. I would like to generate classes for Objective C from that XSD. – Haris Aug 16 '11 at 14:09
-
Does this service use a SOAP interface that includes these schemas as part of the SOAP WSDL? Or is this a general-purpose web service that just happens to document its XML interfaces using XSD schemas? – Tim Dean Aug 16 '11 at 15:42
2 Answers
1
You might want to try and make a SOAP-to-ObjectiveC tool work for this purpose. There are number of them revealed by a Google search. They may not work ideally if your services are not SOAP-based. However, all SOAP-based interfaces will internally use XSD schema files to describe their interface so a SOAP library may be something you can use to generate the code you want.

Tim Dean
- 8,253
- 2
- 32
- 59
-
Used services are SOAP-based for couple of performance reasons. Have a link to something you can recommend? – Haris Aug 17 '11 at 06:44
-
I used SudzC to communicate with my service but I am looking for a tool equivalent to xsd.exe, but for Objective C classes. So far nothing found. – Haris Aug 18 '11 at 06:18
-
Since the WSDL files processed by SudzC typically include or import the XSD for the XML required in its messages, I had assumed that it would generate the stub code for whatever the XSD defines: In other words, I presumed it would do everything xsd.exe does plus more. I can't get it to work on any of my WSDL's so I can't verify this. So if SudzC doesn't generate the Objective-C code based on the XSD content in (or imported into) the XSDL, what exactly does it generate? – Tim Dean Aug 18 '11 at 16:20
-1
Another approach that I have found successful when I have only a couple of SOAP calls I need to make:
- Use a tool like SOAPUI to generate a sample SOAP message
- Copy/paste the sample message into new files that you store within you app bundle, with placeholder text for any fields of the message you want to specify at run time.
- When you want to send the message, read in the sample message file and then do some simple XML manipulation to fill in the fields that you need to.
I have been using this approach for a simple SOAP-based client, rather that using one of the full-blown solutions. I need to use on 5 or 6 simple SOAP methods out of the several dozen defined in my service's WSDL file, so this approach has worked fairly well for me.

Tim Dean
- 8,253
- 2
- 32
- 59