none
Exception when trying to generate schema - help needed. RRS feed

  • Question

  • I am developing a custom WCF Adapter for the Sybase Advantage Database. I am able to access the metadata for the tables. When

    I am getting this exception, The value '' is invalid according to its schema type 'http://www.w3.org/2001/XMLSchema:boolean' - The string '' is not a valid Boolean value from this method and have no idea how its being thrown.

     

    ServiceDescription IWsdlRetrieval.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout){

    ServiceDescription description = mBaseWsdlRetrieval.GetWsdl(nodes, uri, timeout);

    foreach (XmlSchema schema in description.Types.Schemas)

    ProcessFileNameHint(schema);

     

    return description;}

       at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e)
       at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)
       at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e)
       at System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe)
       at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle)
       at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle)
       at System.Xml.Schema.Compiler.CompileComplexTypeElements(XmlSchemaComplexType complexType)
       at System.Xml.Schema.Compiler.Compile()
       at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo)
       at System.Xml.Schema.XmlSchemaSet.Compile()
       at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.GetServiceDescription()
       at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout)
       at Ceridian.Benefits.AdvantageDbAdapter.Utilities.AdsAdapterWsdlRetrieval.Microsoft.ServiceModel.Channels.Common.IWsdlRetrieval.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout)

    Thanks,

    Howard

    Thursday, June 24, 2010 1:37 PM

Answers

  • I have developed a custom WCF adapter before. I think your error is occuring when generating the metadata (schema or WCF proxy) after you have selected a table and click OK. Did you use the WCF LOB SDK VS extension to generate classes for your adapter?

    I think you should be able to handle this in your ResolverHandler.ResolveOperationMetadata or ResolverHandler.ResolveTypeMetadata methods. I do not see an exception name but put a try/catch over everything and logging the exception somewhere to get more information about the problem.

    If you do not get as far as clicking OK to generate the metadata (schema or WCF proxy) then I would suggest looking at the BrowseHandler.Browse.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Thursday, June 24, 2010 6:13 PM
    Moderator
  • It sounds like it is trying to convert an empty string to a boolean. One thing I do is externalize the logic for getting the metadata from the target data source (in your case Sybase) into a separate .NET project and then in the solution have a console app that references the separate .NET project. This way you can step into the logic.

    If it helps to have another project sample, I have started a CodePlex project for custom WCF bindings - http://customwcfbindings.codeplex.com/. I am still working on a SalesForce binding but it gets as far as generating a BizTalk schema or WCF proxy successfully. You can download the source at this point.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Thursday, June 24, 2010 8:04 PM
    Moderator

All replies

  • I have developed a custom WCF adapter before. I think your error is occuring when generating the metadata (schema or WCF proxy) after you have selected a table and click OK. Did you use the WCF LOB SDK VS extension to generate classes for your adapter?

    I think you should be able to handle this in your ResolverHandler.ResolveOperationMetadata or ResolverHandler.ResolveTypeMetadata methods. I do not see an exception name but put a try/catch over everything and logging the exception somewhere to get more information about the problem.

    If you do not get as far as clicking OK to generate the metadata (schema or WCF proxy) then I would suggest looking at the BrowseHandler.Browse.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Thursday, June 24, 2010 6:13 PM
    Moderator
  • Ben,

    I used the WCF LOB SDK to generate the classes. I am able to generate metadata for the tables. I can see the tables and table operations. It's after selecting a table operation and clicking OK that the exception is thrown.

    I am going to take your advice and wrap try/catch blocks in the ResolveOperationMetadata and ResolveTypeMetadata methods.

    Thanks,

    Howard

     

     

     

    Thursday, June 24, 2010 7:45 PM
  • It sounds like it is trying to convert an empty string to a boolean. One thing I do is externalize the logic for getting the metadata from the target data source (in your case Sybase) into a separate .NET project and then in the solution have a console app that references the separate .NET project. This way you can step into the logic.

    If it helps to have another project sample, I have started a CodePlex project for custom WCF bindings - http://customwcfbindings.codeplex.com/. I am still working on a SalesForce binding but it gets as far as generating a BizTalk schema or WCF proxy successfully. You can download the source at this point.

    Thanks,


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Thursday, June 24, 2010 8:04 PM
    Moderator
  • Ben,

    Again, thanks for your help. :-)


    Since the Advantage Database (http://devzone.advantagedatabase.com/dz/content.aspx?key=1) syntax is similiar to SQL and as a .Net Data Provider (helper class), I decided to use Reflector to to disassemble the WCF SQL Adapter. This provided me with a better understanding of what I needed to do.

    I used many of the adapter's metadata, interface, and utility classes as templates for my solution. Getting the metadata for Advantage tables and table columns is fairly easy. The rest is fairly complicated. Advantage SQL doesn't support XML and schemas.

    My exception is probally being thrown from one of these classes. So externalizing the logic makes sense.

    Thanks,

    Howard

    Friday, June 25, 2010 12:21 PM