Exceptions in .NET API

roey.kosovski
Posts: 7
Joined: Tue Apr 22, 2014 1:04 am

Exceptions in .NET API

Postby roey.kosovski » Tue May 27, 2014 5:49 am

Hi

I recently upgrade the .NET API to latest version 1.5.1 and I started to get exceptions that I didn't get with version 1.4.
I'm using C++ code with com wrapper as a bridge but I didn't change any code in the com wrapper.
The exception that I get is:
STD: Specified argument was out of the range of valid values.

Are you familiar with such cases?

sm_support2
Posts: 294
Joined: Mon Jun 20, 2011 5:04 pm

Re: Exceptions in .NET API

Postby sm_support2 » Tue May 27, 2014 7:06 am

Hello Roey,

can you provide code that we can use to reproduce the issue?

btw, a few minor modifications were necessary for the transition from API 1.4 to 1.5

http://wurfl.sourceforge.net/dotnet_index.php

Thanks

roey.kosovski
Posts: 7
Joined: Tue Apr 22, 2014 1:04 am

Re: Exceptions in .NET API

Postby roey.kosovski » Tue May 27, 2014 7:32 am

The code is quite simple

public void Init(String configFileName)
{
FileInfo configFile = new FileInfo(configFileName);
IWURFLConfigurer configurer = new InMemoryConfigurer().MainFile(configFileName);
_wurflManager = (WURFLManager)WURFLManagerBuilder.Build(configurer);
}

public string GetCapability(String userAgent, String capability)
{
if (_wurflManager == null)
{
throw new Exception("Wurfl manager not initialized");
}

IDevice device = _wurflManager.GetDeviceForRequest(new WURFLRequest(userAgent));

if (device == null)
{
throw new Exception("Device not found");
}

return GetDeviceCapability(device, capability.ToLower());
}

public String GetCapabilityByDeviceID(String deviceId, String capability)
{
if (_wurflManager == null)
{
throw new Exception("Wurfl manager not initialized");
}

IDevice device;

try
{
device = _wurflManager.GetDeviceById(deviceId);
}
catch (Exception)
{
throw new Exception("Device not found");
}

if (device == null)
{
throw new Exception("Device not found");
}

return GetDeviceCapability(device, capability.ToLower());
}

private static String GetDeviceCapability(IDevice device, String capability)
{
switch (capability)
{
case "deviceid":
return device.Id;

case "html5_level":
return (CapabilityCalculator.CalcHtml5Level(device));

default:
return device.GetCapability(capability);
}
}

WURFLManager _wurflManager;
}


I know that are some changes but it seems that there are not relevant to my code,the exception came from the method GetCapability.

roey.kosovski
Posts: 7
Joined: Tue Apr 22, 2014 1:04 am

Re: Exceptions in .NET API

Postby roey.kosovski » Wed May 28, 2014 5:07 am

I add some debug messages and this is the UA that generate the error:
Nokia311/5.0 (03.81) Profile/MIDP-2.1 Configuration/CLDC-1.1 Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+ UNTRUSTED/1.0

It seems that I cannot get device ID for that UA but with your test tools I got RIM BlackBerry 9800 (Torch).

Can you please check?

Elliotfehr

Re: Exceptions in .NET API

Postby Elliotfehr » Wed May 28, 2014 8:59 am

Roey,

Thank you for posting the UA that is causing the error. We are currently looking into why this is causing an exception in the .NET API. I will let you know when have a solution to this issue.

Thank you,

Elliot

roey.kosovski
Posts: 7
Joined: Tue Apr 22, 2014 1:04 am

Re: Exceptions in .NET API

Postby roey.kosovski » Sun Jun 01, 2014 10:08 am

Hi Guys

Are there any news regarding the exception I have in the .NET API?
This code was already deployed to release and I need an answer.

Elliotfehr

Re: Exceptions in .NET API

Postby Elliotfehr » Sun Jun 01, 2014 10:27 am

Roey,

Yes, we have identified the cause of the issue and will be releasing an updated version of the .NET API with this fix shortly.

Thank you,

Elliot

Elliotfehr

Re: Exceptions in .NET API

Postby Elliotfehr » Thu Jun 05, 2014 9:02 am

Roey,

I have just uploaded a patched version to your customer vault on scientiamobile.com. Feel free to let me know if you have any further issues.

Thank you,

Elliot

madullah
Posts: 2
Joined: Thu Jun 12, 2014 1:44 pm

Re: Exceptions in .NET API

Postby madullah » Thu Jun 12, 2014 1:46 pm

I had a similar issue, the version of dll specified in the web config, under the wurfl section tag was out of date, with the version that was downloaded as a dependency by nuget.


Who is online

Users browsing this forum: No registered users and 2 guests