InvalidDataContractException was handled - wcf

I am getting the following error when try to import an xmlschema using datacontract serializer:
Invalid type specified. Type with name 'ArrayOfanyType' not found in schema with namespace 'http://schemas.microsoft.com/2003/10/Serialization/Arrays'.
I know it happened because I am using a List but how would I get around it? by using
knownTypes.Add(typeof(????))
thanks.

You'd need to share the XSD bit here. My guess is that one of the elements in the schema is of type xs:any. Assuming you meant you are using svcutil to import the info, you need to use svcutil /t:xmlserializer to import the schema.

Related

how to use addXmlBody?

May I get any sample codes of restsharp using .addXmlBody? and I'd like to know if I can remove xml namespace when I use .addXmlBody?
actually, I'm new to the restsharp. so I totally have no idea how to use xml request.appreciate it any inputs from you.

RPS: Cannot import name ExporterIFCUtils

With the revitpythonshell 2020 I try to import the class ExporterIFCUtils
from Autodesk.Revit.DB.IFC import ExporterIFCUtils
and get the error:
"Exception : IronPython.Runtime.Exceptions.ImportException: Cannot import name ExporterIFCUtils"
#StefanAnd you'll need to add a reference to the RevitAPIIFC.dll first:
>>> clr.AddReference("RevitAPIIFC")
>>> from Autodesk.Revit.DB.IFC import ExporterIFC
>>> ExporterIFC
<type 'ExporterIFC'>
>>>
It's a bit weird, since it looks like you're importing from a module, but it's a .NET "namespace". These can span multiple assemblies as in the case here, so first referencing the RevitAPIIFC.dll will populate the namespace with the types you expect. Sadly, the Revit API documentation doesn't actually seem to provide the assembly names. At least, I couldn't find them...

How can i create a Dynamic Multi-Select List in hippo cms?

I am trying to create a Dynamic Multi-Select List. I tried to add a DynamicDropdown and added Multiple in Fields properties but throws an error:
An error has occurred, sorry for that.
java.lang.IllegalStateException:
org.onehippo.forge.selection.frontend.plugin.DynamicDropdownPlugin
does not support fields that are multiple: please use
org.onehippo.forge.selection.frontend.plugin.DynamicMultiSelectPlugin
for that. Field name is *. Failed to instantiate plugin class
'org.onehippo.forge.selection.frontend.plugin.DynamicDropdownPlugin'
for wicket id
'home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown-preview.cluster..plugin.home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown.cluster.default.service.wicket.id'
in plugin
'home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown-preview.cluster..plugin.home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor0.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.dynamicdropdown.cluster.default.plugin.root'
(JcrPluginConfig:/hippo:namespaces/system/DynamicDropdown/editor:templates/default/root)
Indeed the DynamicDropdownPlugin is not meant for multi-selects, you should use the DynamicMultiSelectPlugin. Easiest to install using Essentials set=up tool, see 'Add a Selection Field to a Document Type
Using the Setup Application' at https://documentation.bloomreach.com/library/concepts/plugins/selections/configuration.html
HTH
Jeroen

Softlayer API: filter image by OS referenceCode

I am trying to filter out my list of images by OS reference code. Here is the url I am trying:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getBlockDeviceTemplateGroups.json?objectMask=mask[flexImageFlag]&objectFilter={'children': {'blockDevices': {'diskImage': {'softwareReferences': {'softwareDescription': {'referenceCode': {'operation': 'REDHAT_6_64'}}}}}}}
But I am kept getting the following error msg:
{"error":"Unable to parse object filter.","code":"SoftLayer_Exception_Public"}
Can anyone help me see what is wrong? Thanks in advance!
Q.Z.
The filter is wrong, but in my tests the filter is not working with the "referenceCode" property; you need to use another property such as name, version or both. See below the examples:
using name and version property
https://api.softlayer.com/rest/v3/SoftLayer_Account/getBlockDeviceTemplateGroups?objectMask=mask[flexImageFlag]&objectFilter={"blockDeviceTemplateGroups": {"children":{"blockDevices":{"diskImage":{"softwareReferences":{"softwareDescription":{"name":{"operation":"CentOS"}, "version":{"operation":"6.3-32"}}}}}}}}
Using only a property (name in this case)
https://api.softlayer.com/rest/v3/SoftLayer_Account/getBlockDeviceTemplateGroups?objectMask=mask[flexImageFlag]&objectFilter={"blockDeviceTemplateGroups": {"children":{"blockDevices":{"diskImage":{"softwareReferences":{"softwareDescription":{"name":{"operation":"CentOS"}}}}}}}}
Regards
Looks like you are using the REST api. The example in the
API reference, suggests that this parameter should be in JSON format:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getVirtualGuests?objectMask=mask[id,hostname]&objectFilter={"datacenter":{"name":{"operation":"dal05"}}}
Your error says "Unable to parse object filter.", so the error is probably just be that your parameter is invalid JSON: The JSON standard only accepts double quotes.
Try replacing
{'children': {'blockDevices': {'diskImage': {'softwareReferences': {'softwareDescription': {'referenceCode': {'operation': 'REDHAT_6_64'}}}}}}}
with the corresponding valid json:
{"children": {"blockDevices": {"diskImage": {"softwareReferences": {"softwareDescription": {"referenceCode": {"operation": "REDHAT_6_64"}}}}}}}

eXist: is it possible to have XQuery modules stored in XML files?

You can store a module in eXist, such as the following, say under /modules/my.xqm:
module namespace my = "http://www.example.com/";
declare function my:answerToTheUltimateQuestion() as xs:integer { 42 }
And then import it into a query, such as:
import module namespace my="http://www.example.com/"
at "xmldb:exist:///db/modules/my.xqm";
my:answerToTheUltimateQuestion()
Instead of storing the XQuery in a "text file", is it possible to store it in an XML file, which would just be a wrapper around the XQuery? I am thinking about a wrapper similar to the one we use when POSTing queries to eXist (<exist:query><exist:text>). This would make it easier to manipulate XQuery modules with tools that expects XML data stored in the database.
You could store your XQuery in XQueryX format into eXist-db and then use a small XQuery and the XSLT from the XQueryX W3C spec within eXist-db to transform this into XQuery and execute it.