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?
Exceptions in .NET API
-
- Posts: 294
- Joined: Mon Jun 20, 2011 5:04 pm
Re: Exceptions in .NET API
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
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
-
- Posts: 7
- Joined: Tue Apr 22, 2014 1:04 am
Re: Exceptions in .NET API
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.
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.
-
- Posts: 7
- Joined: Tue Apr 22, 2014 1:04 am
Re: Exceptions in .NET API
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?
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
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
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
-
- Posts: 7
- Joined: Tue Apr 22, 2014 1:04 am
Re: Exceptions in .NET API
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.
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
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
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
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
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
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 3 guests