More on Mobile Applications and Web Services

sap.jpgFollowing on from my previous post on Mobile Applications and Web Services, I thought I’d post some more tips that might be useful to Symbian, Java ME and Windows Mobile developers.

What if you can’t get the gSOAP libraries working against your web services nor use the S60 Nokia WSDL wizard and associated large XmlDataBinding.sis? For example, it’s my experience is that datetimes tend to be especially troublesome for auto generated web service code tools.

You might like to try hand crafting the web service queries and parse the results. It’s not as hard as it seems and you can use this technique from Symbian c++, Java ME or Windows Mobile. In fact, it’s an ideal method if you want common code across these platforms.

What you need is a web site such as the SAP web services navigator. Type in the URL of the WSDL and it will allow you to query the web service from the web browser. More importantly, it provides the XML for the request and the resultant XML response. Copy the request into your code as a http request and programmatically change the service parameters (search replace strings) to be those provided by your application. Similarly, you can look at the response to determine how to write code to extract resultant data from the returned XML in the http response. You don’t even need an XML parser – just extract strings between XML tags.

Incidentally, if you use the SAP web services navigator you can also strip out the session stuff in the XML request as it usually isn’t required by the server.

The resultant code is as lean as you can get (if you have to use web services) as it doesn’t rely on any extra classes to convert XML to objects.

Finally, if you have (repeating) web site content that you wish to convert to more structured content for downloading to a mobile application then you might like to try Dapper. You can also purchase a SLA should you wish to use Dapper for commercial purposes.