Professional Support

Get professional support quickly from the people who create and maintain 51Degrees.mobi.

Professional Support
How Much Faster is 51Degrees.mobi Framework?
Watch Speed Comparison Loading the same picture on the same mobile device, with the same network connection, over twice as fast.
Watch Video
Welcome to the 51Degrees.mobi online community. These forums offer the opportunity for you to discuss support topics with your peers and with members of the 51Degrees.mobi development team.
HomeHome51Degrees.mobi ...51Degrees.mobi ...51degrees.mobi ...51degrees.mobi ...Mobile Detection as a Web ServiceMobile Detection as a Web Service
Previous
 
Next
New Post
7/25/2012 3:29 PM
 
Hi James,

Could you recommend a good guide for implementing the mobile detection as a web service?  I found the guide for doing this for PHP, but haven't found much in the way of implementing this for ASP.NET

Thank you and great product!

Karl
 
New Post
7/26/2012 8:34 AM
 
Karl,

The PHP guide is the best one we have. It's pretty transferable.

The core .NET C# you'd need would be something like this.

var client = new WebService.MobileDevice();
client.AllowAutoRedirect = false;
client.UserAgent = "UserAgent";

You'll need to add the MobileDevice.asmx web service from the sample project to your client solution as a web reference. If you're not familiar with web services in .NET then I'd suggest reading the intro guides on MSDN.

I hope this helps. If you'd like to publish your solution as a blog post please let me know.

Thanks,

James
 
New Post
7/31/2012 2:22 PM
 
Hi James,

Thanks for the information.  I would prefer to use a WCF/REST architecture for this project, however.  Could you provide some assistance concerning how to obtain True/False for a certain user-provided user agent string? 

So far, this is what I have:

BaseDeviceInfo device = DataProvider.Provider.GetDeviceInfo("Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7");     
DeviceExplorer _deviceExplorer = new DeviceExplorer();
_deviceExplorer.DeviceID = device.DeviceId;

Karl 
 
New Post
7/31/2012 8:23 PM
 
Karl, With regard to obtaining the properties of the device I suggest you use the GetPropertyValues method of the BaseDeviceInfo object returned from the call to GetDeviceInfo. This method takes a property name, and returns an array of values. The DeviceExplorer user control isn't really designed for use in this scenario. It is designed for use by 3rd parties wishing to integrate UI components into their solution. Mainly CMS vendors. With regard to WCF and REST. Could you use the FiftyOne.Foundation.Mobile.Detection.Binary.Reader classes public Create method? This will enable you to operate outside the HttpModule and is very flexible. All the public methods are documented in the code and should be reasonably self explanatory. Regards, James
 
Previous
 
Next
HomeHome51Degrees.mobi ...51Degrees.mobi ...51degrees.mobi ...51degrees.mobi ...Mobile Detection as a Web ServiceMobile Detection as a Web Service