GeneralMappingStrategy using XML
See original GitHub issueHI all
Really useful library! Saving me a lot of time, however I have an issue I currently don’t know how to fix. I am trying to use XML for my GeneralMappingStrategy in Asternet. I have my program working fine using List such as:
agiServer.MappingStrategy = new GeneralMappingStrategy( new List<ScriptMapping>() { new ScriptMapping() { ScriptName = "testIVR", ScriptClass = "Asterisk_Test.testIVR", } });
But I’d rather have it read an XML file as it says it can do in the documentation, however it does not seem to say anywhere what the XML format is required. I have tried:
string pathtoxml = "test.xml"; agiServer.MappingStrategy = new GeneralMappingStrategy(pathtoxml);
With my XML as:
<?xml version="1.0"?> <ScriptMapping> <ScriptName>testIVR</ScriptName> <ScriptClass>Asterisk_Test.testIVR</ScriptClass> </ScriptMapping>
As a complete guess, seemed to make sense, but this won’t compile, I get errors of:
System.InvalidOperationException: ‘There was an error reflecting type ‘System.Collections.Generic.List`1[AsterNET.FastAGI.MappingStrategies.ScriptMapping]’.’
If possible can you let me know what I am doing wrong please?
Cheers
David
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Worked out the pull request!!! First time contributor to GitHub - Sorry!
Fixed by #99