I've been searching for a solution that can generate Objective C classes from XSD schema, but cant fin开发者_C百科d anything useful so far. I am planning to use it in my nextcoming app within Xcode.
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.
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.
精彩评论