Forum Discussion
Darren_Person_2
Nimbostratus
Jul 06, 2007SQLCLR / iControl Integration Issues
Hi All,
I have been spending time working with the F5 supplied iControl.dll for ASP.NET. One of the projects I'm currently working on deals with expiring content from the cache through the provided API. Since a lot of our cache is tied to publishing, we first implemented this as a direct call to the F5 when someone publishes content (everything worked great). An additional business rule came up where we would need to schedule content publishing and this is where things started to get more complicated.
Give that our scheduling agent is directly within SQL Server 2005, this looked like a perfect opportunity to leverage SQLCLR for this integration. We proceeded down this path and were immediately struck with a bug referencing the XmlSerializers.Dll:
System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. Please see inner exception for more information. ---> System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
We were able to overcome this by running sgen /force iControl.dll and generating an iControl.XmlSerializers.Dll file and registering that.
The issue we are at now is that when we make a call to any function after the Initialize() method, we get the following error:
System.InvalidOperationException: There is an error in XML document (11, 2). ---> System.ArgumentException: Item has already been added. Key in dictionary: 'urn:iControl:Common.ULong64' Key being added: 'urn:iControl:Common.ULong64'
System.ArgumentException:
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at System.Xml.Serialization.XmlSerializationReader.AddReadCallback(String name, String ns, Type type, XmlSerializationReadCallback read)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.InitCallbacks()
at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String name, String ns, Boolean elementCanBeType, String& fixupReference)
at System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String name, String ns, String& fixupReference)
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read5926_get_failover_stateResponse()
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer8221.Deserialize(XmlSerializationReader reader)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, Xml
...
System.InvalidOperationException:
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at iControl.SystemFailover.get_failover_state()
Notice that we are just calling the "get_failover_state()" which should return an enum. For some reason, we are getting an error with the Hashtable already having the Key? Any thoughts or ideas would be greatly appreciated!
Thanks!
- Oliver_69038
Nimbostratus
Hi Darren,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects