Page 1 of 1
Exceptions in .NET API
Posted: Tue May 27, 2014 5:49 am
by roey.kosovski
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?
Re: Exceptions in .NET API
Posted: Tue May 27, 2014 7:06 am
by sm_support2
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
Re: Exceptions in .NET API
Posted: Tue May 27, 2014 7:32 am
by roey.kosovski
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.
Re: Exceptions in .NET API
Posted: Wed May 28, 2014 5:07 am
by roey.kosovski
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?
Re: Exceptions in .NET API
Posted: Wed May 28, 2014 8:59 am
by Elliotfehr
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
Re: Exceptions in .NET API
Posted: Sun Jun 01, 2014 10:08 am
by roey.kosovski
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.
Re: Exceptions in .NET API
Posted: Sun Jun 01, 2014 10:27 am
by Elliotfehr
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
Re: Exceptions in .NET API
Posted: Thu Jun 05, 2014 9:02 am
by Elliotfehr
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
Re: Exceptions in .NET API
Posted: Thu Jun 12, 2014 1:46 pm
by madullah
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.