locked
Implementing ExportXmlSchema() for custom MetaData of a WCF LOB Adapter RRS feed

  • Question

  • I am developing a WCF Adapter and my Operations are to have MetaData generated from XSD Schemas that I provided.  I have gotten the simple case to work but am having trouble with a particular Operation whose XSD Schema "imports" another XSD Schema.  The Operation needs a WCF_CL_SITE object defined by this schema:

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:ADDR="
    http://SIS.ESB.Schema.WCF_CL_ADDR" xmlns="http://SIS.ESB.Schema.WCF_CL_SITE" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://SIS.ESB.Schema.WCF_CL_SITE" id="SiteDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <xs:import schemaLocation="WCF_CL_ADDR.xsd" namespace="
    http://SIS.ESB.Schema.WCF_CL_ADDR" />
      
    <xs:element name="WCF_CL_SITE" type="WCF_CL_SITE">
      </xs:element>
        <xs:complexType name="WCF_CL_SITE">
          <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="TransactionId" type="xs:string" />
            <xs:element minOccurs="0" maxOccurs="unbounded" name="Site">
              <xs:complexType>
                <xs:sequence>
                  <xs:element minOccurs="1" maxOccurs="1" name="MessageId" type="xs:string" />
                  <xs:element minOccurs="1" maxOccurs="3" ref="ADDR:Address" />
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
     </xs:complexType>
    </xs:schema>


    Notice how it imports a WCF_CL_ADDR shown here:

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:b="
    http://schemas.microsoft.com/BizTalk/2003" xmlns="http://SIS.ESB.Schema.WCF_CL_ADDR" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://SIS.ESB.Schema.WCF_CL_ADDR" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element msdata:Prefix="ADDR" name="Address" type="WCF_CL_ADDR"/>
        <xs:complexType name="WCF_CL_ADDR">
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
                 <xs:element msdata:Prefix="ADDR" minOccurs="1" maxOccurs="1" name="address" nillable="true">
              <xs:complexType>
                <xs:simpleContent msdata:Prefix="ADDR" msdata:ColumnName="address_Text" msdata:Ordinal="0">
                  <xs:extension base="xs:string" />
                </xs:simpleContent>
              </xs:complexType>
            </xs:element>
            <xs:element msdata:Prefix="ADDR" minOccurs="1" maxOccurs="1" name="city" nillable="true">
              <xs:complexType>
                <xs:simpleContent msdata:Prefix="ADDR" msdata:ColumnName="city_Text" msdata:Ordinal="0">
                  <xs:extension base="xs:string" />
                </xs:simpleContent>
              </xs:complexType>
            </xs:element>
            <xs:element msdata:Prefix="ADDR" minOccurs="1" maxOccurs="1" name="state" nillable="true">
              <xs:complexType>
                <xs:simpleContent msdata:Prefix="ADDR" msdata:ColumnName="state_Text" msdata:Ordinal="0">
                  <xs:extension base="xs:string" />
                </xs:simpleContent>
              </xs:complexType>
            </xs:element>
            <xs:element msdata:Prefix="ADDR" minOccurs="1" maxOccurs="1" name="zipcode" nillable="true">
              <xs:complexType>
                <xs:simpleContent msdata:Prefix="ADDR" msdata:ColumnName="zipcode_Text" msdata:Ordinal="0">
                  <xs:extension base="xs:string" />
                </xs:simpleContent>
              </xs:complexType>
            </xs:element>
            <xs:element msdata:Prefix="ADDR" minOccurs="1" maxOccurs="1" name="country" nillable="true">
              <xs:complexType>
                <xs:simpleContent msdata:Prefix="ADDR" msdata:ColumnName="country_Text" msdata:Ordinal="0">
                  <xs:extension base="xs:string" />
                </xs:simpleContent>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
    </xs:schema>

    A sample xml message adhereing to the WCF_CL_SITE schema (and including an Address structure) looks like this:

    <?xml version="1.0" ?>
    <WCF_CL_SITE xmlns="
    http://SIS.ESB.Schema.WCF_CL_SITE">
        <TransactionId>123-345-456</TransactionId>
        <SourceSystemId>SAP_ECC_36C</SourceSystemId>
        <DestinationSystemId>Clarify_V12</DestinationSystemId>
        <TransactionType>InsertSite</TransactionType>
        <ContentType>Site</ContentType>
        <CorrelatingSystemId>BTS-123-234</CorrelatingSystemId>
        <Site>
            <MessageId>123-456-789</MessageId>
            <objid>9</objid>
            <site_id>47</site_id>
            <s_site_id>665</s_site_id>
            <notes>this is a test to see if notes work</notes>
            <name>Jonny</name>
            <is_active>Y</is_active>
            <bus_org>kmx67</bus_org>
            <x_sa_id>67</x_sa_id>
            <ADDR:Address xmlns:ADDR="
    http://SIS.ESB.Schema.WCF_CL_ADDR">
                <ADDR:objid>2</ADDR:objid>
                <ADDR:address_type>PRI</ADDR:address_type>
                <ADDR:time_zone>GMT</ADDR:time_zone>
                <ADDR:address>20 Trace Street</ADDR:address>
                <ADDR:city>Miami</ADDR:city>
                <ADDR:state>FL</ADDR:state>
                <ADDR:zipcode>33123</ADDR:zipcode>
                <ADDR:country>USA</ADDR:country>
            </ADDR:Address>
        </Site>
    </WCF_CL_SITE>



    In my WCF Adapter I included both of these schemas as embedded resources and then set about defining the Metadata for the "InsertSite" Operations which accepts a WCF_CL_SITE object.

    My Adapter's ResolveOperationMetadata() and  ResolveTypeMetadata() methods look like:

     public OperationMetadata ResolveOperationMetadata(string operationId, TimeSpan timeout, 
                             out TypeMetadataCollection extraTypeMetadataResolved)
            {
                extraTypeMetadataResolved = null;
                TypeMetadata extraTypeMetadata = null;
                ParameterizedOperationMetadata om = null;
                switch (operationId)
    
                    case "Clarify/InsertSite":
                        om = new ParameterizedOperationMetadata(operationId, "ClarifyInsertSite");
                        om.OriginalName = "InsertSite";
                        om.Description = "Some Description.";
                        om.OperationGroup = "ClarifyContract";
                        om.OperationNamespace = ClarifyAdapter.SERVICENAMESPACE;
                        //// syntax: void InsertCustomer( Site  )
                        OperationParameter parmSite = new OperationParameter(
                                     "WCF_CL_SITE", OperationParameterDirection.In,
                                                   new ComplexQualifiedType("ClarifySite"), false);
                        parmSite.Description = "Site to be inserted";
                        om.Parameters.Add(parmSite);
                        om.OperationResult =  OperationResult.Empty;
    
                        return om;
    
                       default:
                        throw new AdapterException("Cannot resolve metadata for operation identifier " + operationId);
                }
            }
    
    
     



    public TypeMetadata ResolveTypeMetadata(string typeId, TimeSpan timeout, out TypeMetadataCollection extraTypeMetadataResolved) { System.Diagnostics.Debug.WriteLine("...............Attempting to resolve TypeMetadata typeId: " + typeId); TypeMetadata oTypeMetadata = null; extraTypeMetadataResolved = null;
    TypeMetadata extraTypeMetadata = null; switch (typeId) { case "ClarifySite": System.Diagnostics.Debug.WriteLine("-+++++++++++++++++ ClarifySite resolved Entered!"); oTypeMetadata = new ClarifyTypeMetadataFromExternalSchema(typeId, "WCF_CL_SITE", "http://SIS.ESB.Schema.WCF_CL_SITE", "MyAdapter.Resources.WCF_CL_SITE.xsd");

    // Provide Address type information
    extraTypeMetadata = new new ClarifyTypeMetadataFromExternalSchema(typeId, "Address", "http://SIS.ESB.Schema.WCF_CL_ADDR", "MyAdapter.Resources.WCF_CL_ADDR.xsd"); extraTypeMetadataResolved.Add(oTypeMetadata); System.Diagnostics.Debug.WriteLine("++++++++++++++++++ ClarifySite resolved Left!"); return oTypeMetadata; default: throw new AdapterException("Invalide type " + typeId); } }

     Notice how I provide the nested Address type as an "extra" TypeMetadata object in the ResolveTypeMetadata() method.  I think this is what you are suppose to do because if I don't do this I get the following error while attempting to use the Add Adapter Service Reference VS-plugin:

    "Error while retrieving or generating the WSDL.  Adpater message: The 'http://SIS.ESB.Schema.WCF_CL_ADD:Addres' element is not declared"

    The ClarifyTypeMetadataFromExternalSchema class is my TypeMetadata subclass where I provide the two XSD Schemas via the ExportXmlSchema() method:

        public class ClarifyTypeMetadataFromExternalSchema : TypeMetadata
        {
            private string resourcename;
            public ClarifyTypeMetadataFromExternalSchema(string typeId, string typeName, string nameSpace, string resourceName)
                : base(typeId, typeName)
            {
    
           System.Diagnostics.Debug.WriteLine("A");
                this.resourcename = resourceName;
                this.TypeNamespace = nameSpace; 
                this.Description = " ";
                //this.CanUseCommonCache = true;
                // if the nillable is not set to true, the generated proxy wraps the operation
                // with request and response objects
                this.IsNillable = true;
                System.Diagnostics.Debug.WriteLine("TypeId: " + typeId);
                System.Diagnostics.Debug.WriteLine("TypeName: " + typeName);
                System.Diagnostics.Debug.WriteLine("Resource: " + resourceName);
                System.Diagnostics.Debug.WriteLine("TypeNamespace: " + nameSpace);
            }
    
            public override void ExportXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timeout)
            {
                System.Diagnostics.Debug.WriteLine("B");
                Assembly assembly = Assembly.GetExecutingAssembly();
                System.Diagnostics.Debug.WriteLine(assembly.ToString());
                using (Stream s = assembly.GetManifestResourceStream( resourcename ))
                {
                    XmlReader reader = XmlReader.Create(s);
                    XmlSchema schema = XmlSchema.Read(reader, null);
    
                    if (!IsComplexTypeAlreadyDefined(schemaExportContext.SchemaSet, schema))
                    {
                        schemaExportContext.SchemaSet.Add(schema);
                        if (!schemaExportContext.NamespacePrefixSet.ContainsKey(this.TypeNamespace))
                        {
                            schemaExportContext.NamespacePrefixSet.Add(this.TypeNamespace, getUniqueNamespacePrefix(schemaExportContext, 0));
                        }
                    }
    
                    reader.Close();
                }
                System.Diagnostics.Debug.WriteLine("Inside ClarifyTypeMetadata.ExportXmlSchema");
            }
    
            public override bool CanSetDefaultValue
            {
                get { return false; }
            }
    
    
            /// <summary>
            /// Helper function to see if the schema is already defined in the 
            /// XmlSchemaSet.
            /// </summary>
            /// <param name="oldschemaset"></param>
            /// <param name="newschema"></param>
            /// <returns></returns>
            public static bool IsComplexTypeAlreadyDefined(XmlSchemaSet oldschemaset, XmlSchema newschema)
            {
                System.Diagnostics.Debug.WriteLine("C");
                // ensure correct namespace was defined in the passed-in schema
                foreach (XmlSchema schema in oldschemaset.Schemas(newschema.TargetNamespace))
                {
                    foreach (XmlSchemaObject newschemaObject in newschema.Items)
                    {
                        if (newschemaObject is XmlSchemaComplexType)
                        {
                            //check for the definition of complex type in the schemaset           
                            foreach (XmlSchemaObject schemaObject in schema.Items)
                            {
                                XmlSchemaComplexType complexType = schemaObject as XmlSchemaComplexType;
                                // Definition of this Complex Type already exists
                                if (complexType != null && String.Compare(complexType.Name, ((XmlSchemaComplexType)newschemaObject).Name, false, System.Globalization.CultureInfo.InvariantCulture) == 0)
                                    return true;
                            }
                        }
                    }
                }
                return false;
            }
    
    
            /// <summary>
            /// Helper function to generate a unique namespace prefix
            /// </summary>
            /// <param name="schemaExportContext"></param>
            /// <param name="startSuffix"></param>
            /// <returns></returns>
            private string getUniqueNamespacePrefix(XmlSchemaExportContext schemaExportContext, int startSuffix)
            {
                System.Diagnostics.Debug.WriteLine("D");
                string defaultPrefix = "ns";
                string val = defaultPrefix + startSuffix;
                if (schemaExportContext.NamespacePrefixSet.ContainsValue(val))
                {
                    return getUniqueNamespacePrefix(schemaExportContext, ++startSuffix);
                }
                else
                {
                    return val;
                }
            }
    
        }
    

    Now when I run the Add Adapter Service Reference VS-plugin with the above code in my adapter I get the following error:

    "Error while retrieving or generating the WSDL.  Adapter message:  Retrieval of TypeMetadata has failed while building WSDL at 'ClarifySite'"

    MySystem.Diagnostics.Debug.WriteLine() output (I have all of the trace output from the WCF LOB SDK turned on - plus my own debugging statements as seen in the above code) is shown below.  Notice the bolded section that clearly shows my ResolveTypeMetadata() method being called which inturn creates the two instances of the ClarifyAdapterMetadataFromExternalSchema objects - one for ClarifySite and the other for ClarifyAddress - the two types I define.

    But that is where the trail ends.  I am getting a NullReferenceException inside of Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata() and I don't know why.  If anybody has any insites or better yet has an example of how to provide external Schemas that import other schemas as metadata for a WCF LOB adapter, I would love to see one.  I have spent three days trying to figure this out to no avail.

    Thanks, in advance.
    Rod

    [260] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection handler of type 'IMetadataResolverHandler' was requested for client with Id '0b31e4de-444c-46bb-947e-0dfdc591e0ed'DefaultDomain 
    [260] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoReusing a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '65608c39-f5a1-4a93-92a3-a73ec4f4f3df' to build handler of type 'IMetadataResolverHandler'DefaultDomain 
    [260] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA handler of type 'IMetadataResolverHandler' was built from a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '65608c39-f5a1-4a93-92a3-a73ec4f4f3df'DefaultDomain 
    [260] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for operation 'Clarify/InsertSite'DefaultDomain 
    [260] Microsoft.ServiceModel.Channels Information: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingNewSchemaAdding New Schema while exporting Xml SchemaDefaultDomain 
    [260] Microsoft.ServiceModel.Channels Information: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingRequestElementAdding Request Element for 'ClarifyInsertSite' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/2824348 
    [260] Microsoft.ServiceModel.Channels Information: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingOperationParameterElementAdding Operation Parameter Element for 'WCF_CL_SITE' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/2824348 
    [260] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '0b31e4de-444c-46bb-947e-0dfdc591e0ed' is getting metadata definition for type 'ClarifySite'DefaultDomain 
    [260] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for type 'ClarifySite'DefaultDomain 
    [260] ...............Attempting to resolve TypeMetadata typeId: ClarifySite 
    [260] -+++++++++++++++++ ClarifySite resolved Entered! 
    [260] A 
    [260] TypeId: ClarifySite 
    [260] TypeName: WCF_CL_SITE 
    [260] Resource: MyAdapter.Resources.WCF_CL_SITE.xsd 
    [260] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_SITE 
    [260] A 
    [260] TypeId: ClarifyAddress 
    [260] TypeName: WCF_CL_ADDR 
    [260] Resource: MyAdapter.Resources.WCF_CL_ADDR.xsd 
    [260] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_ADDR 
    [260] Microsoft.ServiceModel.Channels Error: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataExceptionAn exception was thrown while resolving metadata 'ClarifySite'DefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.MetadataCache/59311316System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Object reference not set to an instance of an object.   at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout)System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260] Microsoft.ServiceModel.Channels Error: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataExceptionRetrieval of Type Metadata has failed while building WSDL at '{0}'DefaultDomainMicrosoft.ServiceModel.Channels.Common.MetadataException, Microsoft.ServiceModel.Channels, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite'Microsoft.ServiceModel.Channels.Common.MetadataException: Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite' ---&gt; System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    --- End of inner exception stack trace ---System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Object reference not set to an instance of an object.   at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout)System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260] Microsoft.ServiceModel.Channels Error: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportInputXmlSchemaExceptionExporting Input Xml Schema failed while building WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/37578102Microsoft.ServiceModel.Channels.Common.MetadataException, Microsoft.ServiceModel.Channels, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite'   at Microsoft.ServiceModel.Channels.Common.Design.AdapterExceptions.ThrowMetadataException(String errorMessage, Object arg, Object source, Exception innerException) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.AddSequenceElements(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaSequence sequence, Boolean isRequest, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.ExportInputXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.AddOperationSchema(OperationMetadata operationMetadata, TimeSpan timeout)Microsoft.ServiceModel.Channels.Common.MetadataException: Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite' ---&gt; System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    --- End of inner exception stack trace --- 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.AdapterExceptions.ThrowMetadataException(String errorMessage, Object arg, Object source, Exception innerException) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.AddSequenceElements(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaSequence sequence, Boolean isRequest, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.ExportInputXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.AddOperationSchema(OperationMetadata operationMetadata, TimeSpan timeout)System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Object reference not set to an instance of an object.   at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.C
    [260] hannels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout)System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260] Microsoft.ServiceModel.Channels Error: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/GenerateOperationSchemaExceptionError in generating Operation Schema while building WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilder/50942646Microsoft.ServiceModel.Channels.Common.MetadataException, Microsoft.ServiceModel.Channels, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite'   at Microsoft.ServiceModel.Channels.Common.Design.AdapterExceptions.ThrowMetadataException(String errorMessage, Object arg, Object source, Exception innerException) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.AddSequenceElements(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaSequence sequence, Boolean isRequest, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.ExportInputXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.AddOperationSchema(OperationMetadata operationMetadata, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.SearchBrowseNodes(MetadataRetrievalNode[] nodes, WsdlBuilderHelper helper, TimeoutHelper timeoutHelper) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GenerateOperationSchemas(WsdlBuilderHelper helper, MetadataRetrievalNode[] nodes, TimeSpan timeout)Microsoft.ServiceModel.Channels.Common.MetadataException: Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite' ---&gt; System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    --- End of inner exception stack trace --- 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.AdapterExceptions.ThrowMetadataException(String errorMessage, Object arg, Object source, Exception innerException) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.AddSequenceElements(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaSequence sequence, Boolean isRequest, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.ExportInputXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.AddOperationSchema(OperationMetadata operationMetadata, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.SearchBrowseNodes(MetadataRetrievalNode[] nodes, WsdlBuilderHelper helper, TimeoutHelper timeoutHelper) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GenerateOperationSchemas(WsdlBuilderHelper
    [260]  helper, MetadataRetrievalNode[] nodes, TimeSpan timeout)System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Object reference not set to an instance of an object.   at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout)System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260] Microsoft.ServiceModel.Channels Error: 0 : 
    [260] http://schemas.microsoft.com/servicemodel/adapters/Metadata/GetWsdlExceptionAn exception was thrown while trying to get WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.MetadataExchanger/63162610Microsoft.ServiceModel.Channels.Common.MetadataException, Microsoft.ServiceModel.Channels, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite'   at Microsoft.ServiceModel.Channels.Common.Design.AdapterExceptions.ThrowMetadataException(String errorMessage, Object arg, Object source, Exception innerException) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.AddSequenceElements(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaSequence sequence, Boolean isRequest, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.ExportInputXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.AddOperationSchema(OperationMetadata operationMetadata, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.SearchBrowseNodes(MetadataRetrievalNode[] nodes, WsdlBuilderHelper helper, TimeoutHelper timeoutHelper) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GenerateOperationSchemas(WsdlBuilderHelper helper, MetadataRetrievalNode[] nodes, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataGet(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup)Microsoft.ServiceModel.Channels.Common.MetadataException: Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite' ---&gt; System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    --- End of inner exception stack trace --- 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.AdapterExceptions.ThrowMetadataException(String errorMessage, Object arg, Object source, Exception innerException) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.AddSequenceElements(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaSequence sequence, Boolean isRequest, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.ExportInputXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.AddOperationSchema(OperationMetadata operationMetadata, TimeSpan timeout
    [260] ) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.SearchBrowseNodes(MetadataRetrievalNode[] nodes, WsdlBuilderHelper helper, TimeoutHelper timeoutHelper) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GenerateOperationSchemas(WsdlBuilderHelper helper, MetadataRetrievalNode[] nodes, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataGet(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup)System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Object reference not set to an instance of an object.   at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout)System.NullReferenceException: Object reference not set to an instance of an object. 
    [260]    at Siemens.Clarify.Adapter.ClarifyAdapterMetadataResolverHandler.ResolveTypeMetadata(String typeId, TimeSpan timeout, TypeMetadataCollection&amp; extraTypeMetadataResolved) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetTypeMetadata(String uniqueId, Guid clientId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.MetadataLookup.GetTypeDefinition(String typeId, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Error: 0 : 
    [260] Wsdl retrieval exception: Retrieval of Type Metadata has failed while building WSDL at 'ClarifySite' 
    [260] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Error: 0 : 
    [260] Wsdl retrieval exception:  
    [260] Server stack trace:  
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.AdapterExceptions.ThrowMetadataException(String errorMessage, Object arg, Object source, Exception innerException) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.XmlSchemaGenHelper.SetElementSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaElement elem, QualifiedTypeContainer qualifiedTypeContainer, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.AddSequenceElements(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, XmlSchema schema, XmlSchemaSequence sequence, Boolean isRequest, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata.ExportInputXmlSchema(XmlSchemaExportContext schemaExportContext, MetadataLookup metadataLookup, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.AddOperationSchema(OperationMetadata operationMetadata, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.SearchBrowseNodes(MetadataRetrievalNode[] nodes, WsdlBuilderHelper helper, TimeoutHelper timeoutHelper) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GenerateOperationSchemas(WsdlBuilderHelper helper, MetadataRetrievalNode[] nodes, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataGet(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataMessage(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup, Message& replyMessage) 
    [260]    at Microsoft.ServiceModel.Channels.Common.Channels.AdapterRequestChannel.Request(Message message, TimeSpan timeout) 
    [260]    at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) 
    [260]    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    [260]    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) 
    [260]    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    [260]    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 
    [260]  
    [260] Exception rethrown at [0]:  
    [260]    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    [260]    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    [260]    at Microsoft.ServiceModel.Channels.IMetadataRetrievalContract.GetMetadata(MetadataRetrievalNode[] nodes) 
    [260]    at Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse.MetadataPanel.GetWsdl(MetadataRetrievalNode[] nodes) 
    


    Sunday, July 5, 2009 8:10 PM

Answers

All replies

  • Hi,

    Your immediate problem is that you have not initialized your extraTypeMetadataResolved, and it is still null in ResovleTypeMetadata(). That is where you're getting the null ref exception from. Lets do that and see if things get any better. (Your stack trace metions that the exception is coming from ResolveTypeMetadata - that is how I was prompted to look at that code more closely).

    Hope this helps!
    Manas
    • Edited by Manas G Monday, July 6, 2009 7:51 AM typo
    Monday, July 6, 2009 7:50 AM
  • Manas

    Thank-you very much for the resposne.  And right you are.  So I added the missing line:

    extraTypeMetadataResolved = new TypeMetadataCollection();

    in the appropriate place in ResolveTypeMetadata().  It use to be there but got accidently removed.

    Now I get a little further but ultimate still get the the error:

    "Error while retrieving or generating the WSDL.  Adapter message:  "The 'http://SIS.ESB.Schema:WCF_CL_ADDR:Address' element is not declared"

    Here is my Debug.WriteLine() output which seems to show the type look up happening now.  Any further ideas?

    THanks,
    Rod

    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection handler of type 'IMetadataResolverHandler' was requested for client with Id 'c54d34ac-0986-4305-8acb-abefe0e8a64c'DefaultDomain 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoReusing a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '5cc86379-b833-4a18-bfbe-5d5f3339e51f' to build handler of type 'IMetadataResolverHandler'DefaultDomain 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA handler of type 'IMetadataResolverHandler' was built from a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '5cc86379-b833-4a18-bfbe-5d5f3339e51f'DefaultDomain 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for operation 'Clarify/InsertSite'DefaultDomain 
    [2428] *********************** 
    [2428] Microsoft.ServiceModel.Channels Information: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingNewSchemaAdding New Schema while exporting Xml SchemaDefaultDomain 
    [2428] Microsoft.ServiceModel.Channels Information: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingRequestElementAdding Request Element for 'ClarifyInsertSite' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/9437072 
    [2428] Microsoft.ServiceModel.Channels Information: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingOperationParameterElementAdding Operation Parameter Element for 'WCF_CL_SITE' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/9437072 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient 'c54d34ac-0986-4305-8acb-abefe0e8a64c' is getting metadata definition for type 'ClarifySite'DefaultDomain 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for type 'ClarifySite'DefaultDomain 
    [2428] ...............Attempting to resolve TypeMetadata typeId: ClarifySite 
    [2428] -+++++++++++++++++ ClarifySite resolved Entered! 
    [2428] A 
    [2428] TypeId: ClarifySite 
    [2428] TypeName: WCF_CL_SITE 
    [2428] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_SITE.xsd 
    [2428] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_SITE 
    [2428] A 
    [2428] TypeId: ClarifyAddress 
    [2428] TypeName: WCF_CL_ADDR 
    [2428] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_ADDR.xsd 
    [2428] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_ADDR 
    [2428] ++++++++++++++++++ ClarifySite resolved Left! 
    [2428] B 
    [2428] Siemens.Clarify.Adapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c312778b28951635 
    [2428] C 
    [2428] D 
    [2428] Inside ClarifyTypeMetadata.ExportXmlSchema 
    [2428] Microsoft.ServiceModel.Channels Information: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingResponseElementAdding Response Element for 'ClarifyInsertSiteResponse' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/9437072 
    [2428] Microsoft.ServiceModel.Channels Information: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingResponseElementAdding Response Element for 'ClarifyInsertSiteResult' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/9437072 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient 'c54d34ac-0986-4305-8acb-abefe0e8a64c' is getting metadata definition for type 'ClarifyACK'DefaultDomain 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for type 'ClarifyACK'DefaultDomain 
    [2428] ...............Attempting to resolve TypeMetadata typeId: ClarifyACK 
    [2428] A 
    [2428] TypeId: ClarifyACK 
    [2428] TypeName: WCF_CL_ACK 
    [2428] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_ACK.xsd 
    [2428] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_ACK 
    [2428] B 
    [2428] Siemens.Clarify.Adapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c312778b28951635 
    [2428] C 
    [2428] D 
    [2428] D 
    [2428] D 
    [2428] Inside ClarifyTypeMetadata.ExportXmlSchema 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/63960804Clarify/InsertSiteThis operation Inserts a Site returning either an ACK message or a SOAPFault message.Site to be insertedClarify/InsertSite/responseThis operation Inserts a Site returning either an ACK message or a SOAPFault message. 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/63960804 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/63960804 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaGenerationException&lt;?xml version=&quot;1.0&quot;?&gt; 
    [2428] &lt;xs:schema xmlns:ns0=&quot;http://SIS.ESB.Schema.WCF_CL_SITE&quot; xmlns:ns1=&quot;clarify://siemens.clarify.adapter&quot; xmlns:ns2=&quot;http://SIS.ESB.Schema.WCF_CL_ACK&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;clarify://siemens.clarify.adapter&quot; version=&quot;1.0&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt; 
    [2428]   &lt;xs:import namespace=&quot;http://SIS.ESB.Schema.WCF_CL_SITE&quot; /&gt; 
    [2428]   &lt;xs:import namespace=&quot;http://SIS.ESB.Schema.WCF_CL_ACK&quot; /&gt; 
    [2428]   &lt;xs:element name=&quot;ClarifyInsertSite&quot;&gt; 
    [2428]     &lt;xs:annotation&gt; 
    [2428]       &lt;xs:documentation&gt; 
    [2428]         &lt;doc:action xmlns:doc=&quot;http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation&quot;&gt;Clarify/InsertSite&lt;/doc:action&gt; 
    [2428]         &lt;doc:description xmlns:doc=&quot;http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation&quot;&gt;This operation Inserts a Site returning either an ACK message or a SOAPFault message.&lt;/doc:description&gt; 
    [2428]       &lt;/xs:documentation&gt; 
    [2428]     &lt;/xs:annotation&gt; 
    [2428]     &lt;xs:complexType&gt; 
    [2428]       &lt;xs:sequence&gt; 
    [2428]         &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;WCF_CL_SITE&quot; nillable=&quot;true&quot; type=&quot;ns0:WCF_CL_SITE&quot;&gt; 
    [2428]           &lt;xs:annotation&gt; 
    [2428]             &lt;xs:documentation&gt;Site to be inserted&lt;/xs:documentation&gt; 
    [2428]           &lt;/xs:annotation&gt; 
    [2428]         &lt;/xs:element&gt; 
    [2428]       &lt;/xs:sequence&gt; 
    [2428]     &lt;/xs:complexType&gt; 
    [2428]   &lt;/xs:element&gt; 
    [2428]   &lt;xs:element name=&quot;ClarifyInsertSiteResponse&quot;&gt; 
    [2428]     &lt;xs:annotation&gt; 
    [2428]       &lt;xs:documentation&gt; 
    [2428]         &lt;doc:action xmlns:doc=&quot;http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation&quot;&gt;Clarify/InsertSite/response&lt;/doc:action&gt; 
    [2428]         &lt;doc:description xmlns:doc=&quot;http://schemas.microsoft.com/servicemodel/adapters/metadata/documentation&quot;&gt;This operation Inserts a Site returning either an ACK message or a SOAPFault message.&lt;/doc:description&gt; 
    [2428]       &lt;/xs:documentation&gt; 
    [2428]     &lt;/xs:annotation&gt; 
    [2428]     &lt;xs:complexType&gt; 
    [2428]       &lt;xs:sequence&gt; 
    [2428]         &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;ClarifyInsertSiteResult&quot; nillable=&quot;true&quot; type=&quot;ns2:WCF_CL_ACK&quot; /&gt; 
    [2428]       &lt;/xs:sequence&gt; 
    [2428]     &lt;/xs:complexType&gt; 
    [2428]   &lt;/xs:element&gt; 
    [2428] &lt;/xs:schema&gt;DefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/63960804 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaGenerationException&lt;?xml version=&quot;1.0&quot;?&gt; 
    [2428] &lt;xs:schema xmlns:msdata=&quot;urn:schemas-microsoft-com:xml-msdata&quot; xmlns:ADDR=&quot;http://SIS.ESB.Schema.WCF_CL_ADDR&quot; xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot; xmlns=&quot;http://SIS.ESB.Schema.WCF_CL_SITE&quot; attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;http://SIS.ESB.Schema.WCF_CL_SITE&quot; id=&quot;SiteDataSet&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt; 
    [2428]   &lt;xs:import schemaLocation=&quot;WCF_CL_ADDR.xsd&quot; namespace=&quot;http://SIS.ESB.Schema.WCF_CL_ADDR&quot; /&gt; 
    [2428]   &lt;xs:annotation&gt; 
    [2428]     &lt;xs:appinfo&gt; 
    [2428]       &lt;b:references xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot;&gt; 
    [2428]         &lt;b:reference targetNamespace=&quot;http://SIS.ESB.Schema.WCF_CL_ADDR&quot; /&gt; 
    [2428]       &lt;/b:references&gt; 
    [2428]     &lt;/xs:appinfo&gt; 
    [2428]   &lt;/xs:annotation&gt; 
    [2428]   &lt;xs:element name=&quot;WCF_CL_SITE&quot; type=&quot;WCF_CL_SITE&quot;&gt; 
    [2428]     &lt;xs:annotation&gt; 
    [2428]       &lt;xs:appinfo&gt; 
    [2428]         &lt;b:recordInfo rootTypeName=&quot;WCF_CL_SITE&quot; xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot; /&gt; 
    [2428]       &lt;/xs:appinfo&gt; 
    [2428]     &lt;/xs:annotation&gt; 
    [2428]   &lt;/xs:element&gt; 
    [2428]   &lt;xs:complexType name=&quot;WCF_CL_SITE&quot;&gt; 
    [2428]     &lt;xs:sequence&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;TransactionId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;SourceSystemId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;DestinationSystemId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;TransactionType&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;ContentType&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;CorrelatingSystemId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; name=&quot;Site&quot;&gt; 
    [2428]         &lt;xs:complexType&gt; 
    [2428]           &lt;xs:sequence&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;MessageId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;objid&quot; type=&quot;xs:long&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;site_id&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;s_site_id&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;notes&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;name&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;is_active&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;bus_org&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;0&quot; maxOccurs=&quot;1&quot; name=&quot;primary2bus_org&quot; nillable=&quot;true&quot; type=&quot;xs:long&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;x_sa_id&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;3&quot; ref=&quot;ADDR:Address&quot; /&gt; 
    [2428]           &lt;/xs:sequence&gt; 
    [2428]         &lt;/xs:complexType&gt; 
    [2428]       &lt;/xs:element&gt; 
    [2428]     &lt;/xs:sequence&gt; 
    [2428]   &lt;/xs:complexType&gt; 
    [2428] &lt;/xs:schema&gt
    [2428] ;DefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/63960804 
    [2428] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaGenerationException&lt;?xml version=&quot;1.0&quot;?&gt; 
    [2428] &lt;xs:schema xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot; xmlns=&quot;http://SIS.ESB.Schema.WCF_CL_ACK&quot; attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;http://SIS.ESB.Schema.WCF_CL_ACK&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt; 
    [2428]   &lt;xs:element name=&quot;WCF_CL_ACK&quot; type=&quot;WCF_CL_ACK&quot; /&gt; 
    [2428]   &lt;xs:complexType name=&quot;WCF_CL_ACK&quot;&gt; 
    [2428]     &lt;xs:sequence minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;TransactionId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;SourceSystemId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;DestinationSystemId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;TransactionType&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;ContentType&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;CorrelatingSystemId&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element default=&quot;0&quot; name=&quot;TransactionTotalCount&quot; type=&quot;xs:long&quot;&gt; 
    [2428]         &lt;xs:annotation&gt; 
    [2428]           &lt;xs:appinfo&gt; 
    [2428]             &lt;b:fieldInfo notes=&quot;Total number of messages processed&quot; xmlns:b=&quot;http://schemas.microsoft.com/BizTalk/2003&quot; /&gt; 
    [2428]           &lt;/xs:appinfo&gt; 
    [2428]         &lt;/xs:annotation&gt; 
    [2428]       &lt;/xs:element&gt; 
    [2428]       &lt;xs:element default=&quot;0&quot; name=&quot;TransactionSuccessCount&quot; type=&quot;xs:long&quot;&gt; 
    [2428]         &lt;xs:annotation&gt; 
    [2428]           &lt;xs:appinfo&gt; 
    [2428]             &lt;b:fieldInfo notes=&quot;Number of messages which succeeded&quot; /&gt; 
    [2428]           &lt;/xs:appinfo&gt; 
    [2428]         &lt;/xs:annotation&gt; 
    [2428]       &lt;/xs:element&gt; 
    [2428]       &lt;xs:element default=&quot;0&quot; name=&quot;TransactionFailCount&quot; type=&quot;xs:long&quot;&gt; 
    [2428]         &lt;xs:annotation&gt; 
    [2428]           &lt;xs:appinfo&gt; 
    [2428]             &lt;b:fieldInfo notes=&quot;Number of messages which failed&quot; /&gt; 
    [2428]           &lt;/xs:appinfo&gt; 
    [2428]         &lt;/xs:annotation&gt; 
    [2428]       &lt;/xs:element&gt; 
    [2428]       &lt;xs:element default=&quot;0&quot; name=&quot;TransactionCompleteFlag&quot; type=&quot;xs:int&quot;&gt; 
    [2428]         &lt;xs:annotation&gt; 
    [2428]           &lt;xs:appinfo&gt; 
    [2428]             &lt;b:fieldInfo notes=&quot;0=Not Completed, 1=Completed&quot; /&gt; 
    [2428]           &lt;/xs:appinfo&gt; 
    [2428]         &lt;/xs:annotation&gt; 
    [2428]       &lt;/xs:element&gt; 
    [2428]       &lt;xs:element name=&quot;TransactionStartDateTime&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element name=&quot;TransactionEndDateTime&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; default=&quot;1&quot; name=&quot;ErrorFlag&quot; type=&quot;xs:int&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;ErrorMessage&quot; type=&quot;xs:string&quot; /&gt; 
    [2428]       &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;unbounded&quot; name=&quot;Message&quot;&gt; 
    [2428]         &lt;xs:annotation&gt; 
    [2428]           &lt;xs:appinfo&gt; 
    [2428]             &lt;b:recordInfo notes=&quot;Ack message for each message processed&quot; /&gt; 
    [2428]           &lt;/xs:appinfo&gt; 
    [2428]         &lt;/xs:annotation&gt; 
    [2428]         &lt;xs:complexType&gt; 
    [2428]           &lt;xs:sequence&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;MessageId&quot; type=&quot;xs:string&quot;&gt; 
    [2428]               &lt;xs:annotation&gt; 
    [2428]                 &lt;xs:appinfo&gt; 
    [2428]                   &lt;b:fieldInfo notes=&quot;MessageId provided by the publish
    [2428] ing or subscribing system &quot; /&gt; 
    [2428]                 &lt;/xs:appinfo&gt; 
    [2428]               &lt;/xs:annotation&gt; 
    [2428]             &lt;/xs:element&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;WCFTransactionId&quot; type=&quot;xs:string&quot;&gt; 
    [2428]               &lt;xs:annotation&gt; 
    [2428]                 &lt;xs:appinfo&gt; 
    [2428]                   &lt;b:fieldInfo notes=&quot;Internally generated transaction ID generated by WCF adapter&quot; /&gt; 
    [2428]                 &lt;/xs:appinfo&gt; 
    [2428]               &lt;/xs:annotation&gt; 
    [2428]             &lt;/xs:element&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;messagetype&quot; type=&quot;xs:string&quot;&gt; 
    [2428]               &lt;xs:annotation&gt; 
    [2428]                 &lt;xs:appinfo&gt; 
    [2428]                   &lt;b:fieldInfo notes=&quot;Type of message.  Usually set to ERR or MSG&quot; /&gt; 
    [2428]                 &lt;/xs:appinfo&gt; 
    [2428]               &lt;/xs:annotation&gt; 
    [2428]             &lt;/xs:element&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;messagecontent&quot; type=&quot;xs:string&quot;&gt; 
    [2428]               &lt;xs:annotation&gt; 
    [2428]                 &lt;xs:appinfo&gt; 
    [2428]                   &lt;b:fieldInfo notes=&quot;Internal message content generated by WCF containing processing and error message&quot; /&gt; 
    [2428]                 &lt;/xs:appinfo&gt; 
    [2428]               &lt;/xs:annotation&gt; 
    [2428]             &lt;/xs:element&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;errorlevel&quot; type=&quot;xs:string&quot;&gt; 
    [2428]               &lt;xs:annotation&gt; 
    [2428]                 &lt;xs:appinfo&gt; 
    [2428]                   &lt;b:fieldInfo notes=&quot;0=No Error, 1=Warning, 2=Non-Critical Error, 3=Critical Error&quot; /&gt; 
    [2428]                 &lt;/xs:appinfo&gt; 
    [2428]               &lt;/xs:annotation&gt; 
    [2428]             &lt;/xs:element&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;objid&quot; type=&quot;xs:long&quot;&gt; 
    [2428]               &lt;xs:annotation&gt; 
    [2428]                 &lt;xs:appinfo&gt; 
    [2428]                   &lt;b:fieldInfo notes=&quot;ObjectId used to locate record.&quot; /&gt; 
    [2428]                 &lt;/xs:appinfo&gt; 
    [2428]               &lt;/xs:annotation&gt; 
    [2428]             &lt;/xs:element&gt; 
    [2428]             &lt;xs:element minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; name=&quot;s_objid&quot; type=&quot;xs:long&quot;&gt; 
    [2428]               &lt;xs:annotation&gt; 
    [2428]                 &lt;xs:appinfo&gt; 
    [2428]                   &lt;b:fieldInfo notes=&quot;External reference to a record locator provided by Source System.&quot; /&gt; 
    [2428]                 &lt;/xs:appinfo&gt; 
    [2428]               &lt;/xs:annotation&gt; 
    [2428]             &lt;/xs:element&gt; 
    [2428]           &lt;/xs:sequence&gt; 
    [2428]         &lt;/xs:complexType&gt; 
    [2428]       &lt;/xs:element&gt; 
    [2428]     &lt;/xs:sequence&gt; 
    [2428]   &lt;/xs:complexType&gt; 
    [2428] &lt;/xs:schema&gt;DefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/63960804 
    [2428] Microsoft.ServiceModel.Channels Error: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaGenerationExceptionXML Schema generation failed while building WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/63960804System.Xml.Schema.XmlSchemaException, System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089The 'http://SIS.ESB.Schema.WCF_CL_ADDR:Address' element is not declared.   at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e) 
    [2428]    at System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileComplexTypeElements(XmlSchemaComplexType complexType) 
    [2428]    at System.Xml.Schema.Compiler.Compile() 
    [2428]    at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo) 
    [2428]    at System.Xml.Schema.XmlSchemaSet.Compile() 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.GetServiceDescription()System.Xml.Schema.XmlSchemaException: The 'http://SIS.ESB.Schema.WCF_CL_ADDR:Address' element is not declared. 
    [2428]    at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e) 
    [2428]    at System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileComplexTypeElements(XmlSchemaComplexType complexType) 
    [2428]    at System.Xml.Schema.Compiler.Compile() 
    [2428]    at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo) 
    [2428]    at System.Xml.Schema.XmlSchemaSet.Compile() 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.GetServiceDescription() 
    [2428] Microsoft.ServiceModel.Channels Error: 0 : 
    [2428] http://schemas.microsoft.com/servicemodel/adapters/Metadata/GetWsdlExceptionAn exception was thrown while trying to get WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.MetadataExchanger/22496740System.Xml.Schema.XmlSchemaException, System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089The 'http://SIS.ESB.Schema.WCF_CL_ADDR:Address' element is not declared.   at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e) 
    [2428]    at System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileComplexTypeElements(XmlSchemaComplexType complexType) 
    [2428]    at System.Xml.Schema.Compiler.Compile() 
    [2428]    at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo) 
    [2428]    at System.Xml.Schema.XmlSchemaSet.Compile() 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.GetServiceDescription() 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout) 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataGet(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup)System.Xml.Schema.XmlSchemaException: The 'http://SIS.ESB.Schema.WCF_CL_ADDR:Address' element is not declared. 
    [2428]    at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e) 
    [2428]    at System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileComplexTypeElements(XmlSchemaComplexType complexType) 
    [2428]    at System.Xml.Schema.Compiler.Compile() 
    [2428]    at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo) 
    [2428]    at System.Xml.Schema.XmlSchemaSet.Compile() 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.GetServiceDescription() 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout) 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataGet(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup) 
    [2428] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Error: 0 : 
    [2428] Wsdl retrieval exception: The 'http://SIS.ESB.Schema.WCF_CL_ADDR:Address' element is not declared. 
    [2428] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Error: 0 : 
    [2428] Wsdl retrieval exception:  
    [2428] Server stack trace:  
    [2428]    at System.Xml.Schema.XmlSchemaSet.InternalValidationCallback(Object sender, ValidationEventArgs e) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) 
    [2428]    at System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e) 
    [2428]    at System.Xml.Schema.Compiler.CompileElement(XmlSchemaElement xe) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileParticleElements(XmlSchemaComplexType complexType, XmlSchemaParticle particle) 
    [2428]    at System.Xml.Schema.Compiler.CompileComplexTypeElements(XmlSchemaComplexType complexType) 
    [2428]    at System.Xml.Schema.Compiler.Compile() 
    [2428]    at System.Xml.Schema.Compiler.Execute(XmlSchemaSet schemaSet, SchemaInfo schemaCompiledInfo) 
    [2428]    at System.Xml.Schema.XmlSchemaSet.Compile() 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper.GetServiceDescription() 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.WsdlBuilder.GetWsdl(MetadataRetrievalNode[] nodes, Uri uri, TimeSpan timeout) 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataGet(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup) 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Design.MetadataExchanger.ProcessMetadataMessage(Message message, Uri target, TimeSpan timeout, MetadataLookup metadataLookup, Message& replyMessage) 
    [2428]    at Microsoft.ServiceModel.Channels.Common.Channels.AdapterRequestChannel.Request(Message message, TimeSpan timeout) 
    [2428]    at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) 
    [2428]    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    [2428]    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) 
    [2428]    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    [2428]    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 
    [2428]  
    [2428] Exception rethrown at [0]:  
    [2428]    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    [2428]    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    [2428]    at Microsoft.ServiceModel.Channels.IMetadataRetrievalContract.GetMetadata(MetadataRetrievalNode[] nodes) 
    [2428]    at Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse.MetadataPanel.GetWsdl(MetadataRetrievalNode[] nodes) 
    
    Monday, July 6, 2009 11:31 AM
  • In your adapter constructor/place where you're setting the AdapterSettings, set MetadataSettings.CompileWsdl=false; and then try. I hope we'll move one step ahead again :)

    Thanks,
    Manas
    Monday, July 6, 2009 1:14 PM
  • Manas

    Thanks again for your continued help.

    So when I do that I do indeed move forward.  Now the only error I get is:

    "Error occurred while generating the app.config"

    I have seen this before when I tried supplying my Input and Output schemas through a custom OperationMetadata subclass.

    Note that there is no problem reported in my Debug.WriteLine() output this time.  Further, there is no problem reported by the WCF Trace logs.  So it appears that the Adapter's metadata resolution is working properly.  I am guessing that the VS "Add Service Adapter" plug-in does the app.config generation and is erroring??

    Any other ideas?

    Rod

    Monday, July 6, 2009 2:28 PM
  • Hi Rod,

    Can you set the trace level to 'verbose' and share the logs?

    Thanks,
    Manas
    Tuesday, July 7, 2009 8:13 AM
  • Manas

    Again, many thanks for your continued help. 

    So I have researched this a bit more and have more information.  As I said earlier, running the "Add Adapter Service" S plug-in I get the following error:

    "Error occurred while generating the app.config"

    No files are generated.  Looking at the WCF output to the debug viewer there are no more errors being reported:

    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] MetadataPanel successfully init 
    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] MetadataUserControl successfully init 
    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] ConfigurationForm Binding tab initialized successfully. 
    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] ConfigurationForm Security tab initialized successfully. 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Channels/ChannelsInfoA ChannelFactory of type 'AdapterChannelFactory`1' is createdDefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Channels/ChannelsInfoA Channel of type 'AdapterRequestChannel' is created with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection handler of type 'IOutboundHandler' was requested for client with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection was requested for client with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoCreating connection for secure Uri 'clarify://siemens.clarify.adapter/'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA new connection was created for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoOpening connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA handler of type 'IOutboundHandler' was built from a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] Channel successfully opened 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is browsing metadata for node '/'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection handler of type 'IMetadataBrowseHandler' was requested for client with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoReusing a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b' to build handler of type 'IMetadataBrowseHandler'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA handler of type 'IMetadataBrowseHandler' was built from a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is browsing metadata for node '/'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is browsing metadata for node 'ClarifyMainCategory'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is getting metadata definition for operation 'Clarify/InsertSite'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection handler of type 'IMetadataResolverHandler' was requested for client with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoReusing a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b' to build handler of type 'IMetadataResolverHandler'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA handler of type 'IMetadataResolverHandler' was built from a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for operation 'Clarify/InsertSite'DefaultDomain 
    [3252] *********************** 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingNewSchemaAdding New Schema while exporting Xml SchemaDefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingRequestElementAdding Request Element for 'ClarifyInsertSite' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/35279616 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingOperationParameterElementAdding Operation Parameter Element for 'WCF_CL_SITE' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/35279616 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is getting metadata definition for type 'ClarifySite'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for type 'ClarifySite'DefaultDomain 
    [3252] ...............Attempting to resolve TypeMetadata typeId: ClarifySite 
    [3252] -+++++++++++++++++ ClarifySite resolved Entered! 
    [3252] A 
    [3252] TypeId: ClarifySite 
    [3252] TypeName: WCF_CL_SITE 
    [3252] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_SITE.xsd 
    [3252] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_SITE 
    [3252] A 
    [3252] TypeId: ClarifyAddress 
    [3252] TypeName: WCF_CL_ADDR 
    [3252] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_ADDR.xsd 
    [3252] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_ADDR 
    [3252] ++++++++++++++++++ ClarifySite resolved Left! 
    [3252] B 
    [3252] Siemens.Clarify.Adapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c312778b28951635 
    [3252] C 
    [3252] D 
    [3252] Inside ClarifyTypeMetadata.ExportXmlSchema 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingResponseElementAdding Response Element for 'ClarifyInsertSiteResponse' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/35279616 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingResponseElementAdding Response Element for 'ClarifyInsertSiteResult' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/35279616 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is getting metadata definition for type 'ClarifyACK'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for type 'ClarifyACK'DefaultDomain 
    [3252] ...............Attempting to resolve TypeMetadata typeId: ClarifyACK 
    [3252] A 
    [3252] TypeId: ClarifyACK 
    [3252] TypeName: WCF_CL_ACK 
    [3252] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_ACK.xsd 
    [3252] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_ACK 
    [3252] B 
    [3252] Siemens.Clarify.Adapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c312778b28951635 
    [3252] C 
    [3252] D 
    [3252] D 
    [3252] D 
    [3252] Inside ClarifyTypeMetadata.ExportXmlSchema 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/2674433Clarify/InsertSiteThis operation Inserts a Site returning either an ACK message or a SOAPFault message.Site to be insertedClarify/InsertSite/responseThis operation Inserts a Site returning either an ACK message or a SOAPFault message. 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/2674433 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/2674433 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ServiceDescriptionAdding Service Description to the traceDefaultDomainSystem.Web.Services.Description.ServiceDescription/8218886Clarify/InsertSiteThis operation Inserts a Site returning either an ACK message or a SOAPFault message.Site to be insertedClarify/InsertSite/responseThis operation Inserts a Site returning either an ACK message or a SOAPFault message.This operation Inserts a Site returning either an ACK message or a SOAPFault message.Site to be inserted 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoAborting all connections for client '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoClosing Connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    I then added the following diagnostics settings to my devenv.exe.config file to generate detailed WCF trace logs:

      <system.diagnostics>
         <sources>
          <source name="Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse" switchValue="Verbose, ActivityTracing">
            <listeners>
              <add name="textTrace"/>
            </listeners>
          </source>
    
         <source name="Siemens.Clarify.Adapter.ClarfiyAdapter" switchValue="Verbose">
            <listeners>
              <add name="textTrace" />
            </listeners>
          </source>
          <source name="Microsoft.ServiceModel.Channels" switchValue="Verbose">
            <listeners>
              <add name="xmlTrace" />
            </listeners>
          </source>
    
        </sources>
        <sharedListeners>
          <add initializeData="C:\Siemens\aasr.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="xmlTrace">
            <filter type="" />
          </add>
          <add initializeData="C:\Siemens\aasr.log" type="System.Diagnostics.TextWriterTraceListener" name="textTrace">
            <filter type="" />
          </add>
          <add initializeData="C:\Siemens\ClarifyAdapter_Browse.txt" type="System.Diagnostics.TextWriterTraceListener" name="textTrace">
            <filter type="" />
          </add>
    
        </sharedListeners>
        <trace autoflush="true" indentsize="4" />
      </system.diagnostics>

    Viewing the asar.svlog file in SvcTraceViewer.exe shows no errors.  The generated ClarifyAdapter_Browser.txt is simply:

    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : MetadataPanel successfully init
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : MetadataUserControl successfully init
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : MetadataPanel successfully init
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : MetadataUserControl successfully init
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : ConfigurationForm Binding tab initialized successfully.
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : ConfigurationForm Security tab initialized successfully.
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : Channel successfully opened
    So I am conviced I am specifying the meta data correctly - and the adapter's metadata resolver is functioning properly.  This is why I conclued in my last email that the wizard has probably returned from the call into the adapter when this error occurs in side the wizard "proper".

    Then I decided to try and consume the same adapter operation in a BizTalk Server 2009 project in VS 2008.  This time I get the error:

    "Error occurred while crating the BizTalk port configuration file.  Index was out of range.  Must be non-neagative and less than the size of the collection.  Parameter name: index"

    And as before, no errors in any of the above trace logs.

    What was interesting however is that I did get output generated - namely the following 3 Schema files:

    - ClarifyAdapterBinding.xsd - Wrapper "Operation" schema
    - ClarifyAdapterBinding1.xsd  - "Request" schema (in my case WCF_CL_SITE - this imports WCF_CL_ADDR))
    - ClarifyAdapterBinding2.xsd - "Response" schema (in my case WCF_CL_ACK)

    Obviously (due to the error above) there was no binding file produced.

    Nonetheless, this was encouraging.  However, trying to compile the schemas as part of the BizTalk project  fails with the error:

    "The 'http://SIS.ESB.Schema.WCF_CL_ADDR:Address' element is not declared

    Looking into the generated ClarifyAdapterBinding1.xsd (i.e.; WCF_CL_SITE) I find what appears to be the culprit (shown in bold below):

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:ADDR="http://SIS.ESB.Schema.WCF_CL_ADDR" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://SIS.ESB.Schema.WCF_CL_SITE" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://SIS.ESB.Schema.WCF_CL_SITE" id="SiteDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation="WCF_CL_ADDR.xsd" namespace="http://SIS.ESB.Schema.WCF_CL_ADDR" />
      <xs:annotation>
        <xs:appinfo>
          <b:references>
                  <b:reference targetNamespace="http://SIS.ESB.Schema.WCF_CL_ADDR"></b:reference>
                </b:references>
        </xs:appinfo>
      </xs:annotation>
      <xs:element name="WCF_CL_SITE" type="WCF_CL_SITE">
        <xs:annotation>
          <xs:appinfo>
            <b:recordInfo rootTypeName="WCF_CL_SITE">
            </b:recordInfo>
          </xs:appinfo>
        </xs:annotation>
      </xs:element>
      <xs:complexType name="WCF_CL_SITE">
        <xs:sequence>
          <xs:element minOccurs="1" maxOccurs="1" name="TransactionId" type="xs:string" />
          <xs:element minOccurs="1" maxOccurs="1" name="SourceSystemId" type="xs:string" />
          <xs:element minOccurs="1" maxOccurs="1" name="DestinationSystemId" type="xs:string" />
          <xs:element minOccurs="1" maxOccurs="1" name="TransactionType" type="xs:string" />
          <xs:element minOccurs="1" maxOccurs="1" name="ContentType" type="xs:string" />
          <xs:element minOccurs="1" maxOccurs="1" name="CorrelatingSystemId" type="xs:string" />
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Site">
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="1" maxOccurs="1" name="MessageId" type="xs:string" />
                <xs:element minOccurs="1" maxOccurs="1" name="objid" type="xs:long" />
                <xs:element minOccurs="1" maxOccurs="1" name="site_id" type="xs:string" />
                <xs:element minOccurs="1" maxOccurs="1" name="s_site_id" type="xs:string" />
                <xs:element minOccurs="1" maxOccurs="1" name="notes" type="xs:string" />
                <xs:element minOccurs="1" maxOccurs="1" name="name" type="xs:string" />
                <xs:element minOccurs="1" maxOccurs="1" name="is_active" type="xs:string" />
                <xs:element minOccurs="1" maxOccurs="1" name="bus_org" type="xs:string" />
                <xs:element minOccurs="0" maxOccurs="1" name="primary2bus_org" nillable="true" type="xs:long" />
                <xs:element minOccurs="1" maxOccurs="1" name="x_sa_id" type="xs:string" />
                <xs:element minOccurs="1" maxOccurs="3" ref="ADDR:Address" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>

    The original WCF_CL_SITE schema is dependent on the imported WCF_CL_ADDR.xsd file being present in the same directory.  I have provided this schema as part of the adapter's metadata as shown in a previous post as an "extra" TypeMetatdata object.  However, this schema does not appear to be generated by the wizard.  It is probably therefore very likely that the schema is similarly not being output by the VS "Add Adapter Service" either.

    I therefore conclude that since neither wizard outputs the required schema file, they cannot complete their operations (i.e.; generating the respective project's App.config or the Binding files).

    So do you have any idea how to make the wizards generate the imported schema file?

    Note that I foresee another problem here.   Even it if the wizards did output this schema - it probably wouldn't have been generated with the required name "WCF_CL_ADDR.xsd".  The BizTalk Server "Consume Adapter Server" wizard would have probably generated it as "ClarifyAdapterBinding3.xsd" given the naming convention it appears to be following. 

    I am hopeing that I am wrong here and there is a simple soltuion.  But this is starting to look like a bug to me.

    Any help would be greatly appreciated.

    Rod
    Wednesday, July 8, 2009 2:06 AM
  • Manas

    Again, many thanks for your continued help. 

    So I have researched this a bit more and have more information.  As I said earlier, running the "Add Adapter Service" S plug-in I get the following error:

    "Error occurred while generating the app.config"

    No files are generated.  Looking at the WCF output to the debug viewer there are no more errors being reported:

    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] MetadataPanel successfully init 
    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] MetadataUserControl successfully init 
    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] ConfigurationForm Binding tab initialized successfully. 
    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] ConfigurationForm Security tab initialized successfully. 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Channels/ChannelsInfoA ChannelFactory of type 'AdapterChannelFactory`1' is createdDefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Channels/ChannelsInfoA Channel of type 'AdapterRequestChannel' is created with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection handler of type 'IOutboundHandler' was requested for client with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection was requested for client with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoCreating connection for secure Uri 'clarify://siemens.clarify.adapter/'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA new connection was created for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoOpening connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA handler of type 'IOutboundHandler' was built from a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : 
    [3252] Channel successfully opened 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is browsing metadata for node '/'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection handler of type 'IMetadataBrowseHandler' was requested for client with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoReusing a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b' to build handler of type 'IMetadataBrowseHandler'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA handler of type 'IMetadataBrowseHandler' was built from a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is browsing metadata for node '/'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is browsing metadata for node 'ClarifyMainCategory'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is getting metadata definition for operation 'Clarify/InsertSite'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA connection handler of type 'IMetadataResolverHandler' was requested for client with Id '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoReusing a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b' to build handler of type 'IMetadataResolverHandler'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoA handler of type 'IMetadataResolverHandler' was built from a valid connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for operation 'Clarify/InsertSite'DefaultDomain 
    [3252] *********************** 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingNewSchemaAdding New Schema while exporting Xml SchemaDefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingRequestElementAdding Request Element for 'ClarifyInsertSite' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/35279616 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingOperationParameterElementAdding Operation Parameter Element for 'WCF_CL_SITE' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/35279616 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is getting metadata definition for type 'ClarifySite'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for type 'ClarifySite'DefaultDomain 
    [3252] ...............Attempting to resolve TypeMetadata typeId: ClarifySite 
    [3252] -+++++++++++++++++ ClarifySite resolved Entered! 
    [3252] A 
    [3252] TypeId: ClarifySite 
    [3252] TypeName: WCF_CL_SITE 
    [3252] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_SITE.xsd 
    [3252] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_SITE 
    [3252] A 
    [3252] TypeId: ClarifyAddress 
    [3252] TypeName: WCF_CL_ADDR 
    [3252] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_ADDR.xsd 
    [3252] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_ADDR 
    [3252] ++++++++++++++++++ ClarifySite resolved Left! 
    [3252] B 
    [3252] Siemens.Clarify.Adapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c312778b28951635 
    [3252] C 
    [3252] D 
    [3252] Inside ClarifyTypeMetadata.ExportXmlSchema 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingResponseElementAdding Response Element for 'ClarifyInsertSiteResponse' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/35279616 
    [3252] Microsoft.ServiceModel.Channels Information: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ExportXmlSchemaAddingResponseElementAdding Response Element for 'ClarifyInsertSiteResult' while exporting Xml SchemaDefaultDomainMicrosoft.ServiceModel.Channels.Common.ParameterizedOperationMetadata/35279616 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoClient '95edc620-7612-4b0d-be57-3eaa379d2bb4' is getting metadata definition for type 'ClarifyACK'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Metadata/MetadataCacheInfoMetadata cache is resolving metadata definition for type 'ClarifyACK'DefaultDomain 
    [3252] ...............Attempting to resolve TypeMetadata typeId: ClarifyACK 
    [3252] A 
    [3252] TypeId: ClarifyACK 
    [3252] TypeName: WCF_CL_ACK 
    [3252] Resource: Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_ACK.xsd 
    [3252] TypeNamespace: http://SIS.ESB.Schema.WCF_CL_ACK 
    [3252] B 
    [3252] Siemens.Clarify.Adapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c312778b28951635 
    [3252] C 
    [3252] D 
    [3252] D 
    [3252] D 
    [3252] Inside ClarifyTypeMetadata.ExportXmlSchema 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/2674433Clarify/InsertSiteThis operation Inserts a Site returning either an ACK message or a SOAPFault message.Site to be insertedClarify/InsertSite/responseThis operation Inserts a Site returning either an ACK message or a SOAPFault message. 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/2674433 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/XmlSchemaAdding an xml schema to WSDLDefaultDomainMicrosoft.ServiceModel.Channels.Common.Design.WsdlBuilderHelper/2674433 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/WsdlBuilder/ServiceDescriptionAdding Service Description to the traceDefaultDomainSystem.Web.Services.Description.ServiceDescription/8218886Clarify/InsertSiteThis operation Inserts a Site returning either an ACK message or a SOAPFault message.Site to be insertedClarify/InsertSite/responseThis operation Inserts a Site returning either an ACK message or a SOAPFault message.This operation Inserts a Site returning either an ACK message or a SOAPFault message.Site to be inserted 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoAborting all connections for client '95edc620-7612-4b0d-be57-3eaa379d2bb4'DefaultDomain 
    [3252] Microsoft.ServiceModel.Channels Verbose: 0 : 
    [3252] http://schemas.microsoft.com/servicemodel/adapters/Connections/ConnectionPoolInfoClosing Connection for secure Uri 'clarify://siemens.clarify.adapter/' with connectionId '76dbc2d9-d95c-4acf-b850-50d3693aab2b'DefaultDomain 
    I then added the following diagnostics settings to my devenv.exe.config file to generate detailed WCF trace logs:

      <system.diagnostics>
         <sources>
          <source name="Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse" switchValue="Verbose, ActivityTracing">
            <listeners>
              <add name="textTrace"/>
            </listeners>
          </source>
    
         <source name="Siemens.Clarify.Adapter.ClarfiyAdapter" switchValue="Verbose">
            <listeners>
              <add name="textTrace" />
            </listeners>
          </source>
          <source name="Microsoft.ServiceModel.Channels" switchValue="Verbose">
            <listeners>
              <add name="xmlTrace" />
            </listeners>
          </source>
    
        </sources>
        <sharedListeners>
          <add initializeData="C:\Siemens\aasr.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="xmlTrace">
            <filter type="" />
          </add>
          <add initializeData="C:\Siemens\aasr.log" type="System.Diagnostics.TextWriterTraceListener" name="textTrace">
            <filter type="" />
          </add>
          <add initializeData="C:\Siemens\ClarifyAdapter_Browse.txt" type="System.Diagnostics.TextWriterTraceListener" name="textTrace">
            <filter type="" />
          </add>
    
        </sharedListeners>
        <trace autoflush="true" indentsize="4" />
      </system.diagnostics>

    Viewing the asar.svlog file in SvcTraceViewer.exe shows no errors.  The generated ClarifyAdapter_Browser.txt is simply:

    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : MetadataPanel successfully init
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : MetadataUserControl successfully init
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : MetadataPanel successfully init
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : MetadataUserControl successfully init
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : ConfigurationForm Binding tab initialized successfully.
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : ConfigurationForm Security tab initialized successfully.
    Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse Information: 0 : Channel successfully opened
    So I am conviced I am specifying the meta data correctly - and the adapter's metadata resolver is functioning properly.  This is why I conclued in my last email that the wizard has probably returned from the call into the adapter when this error occurs in side the wizard "proper".

    Then I decided to try and consume the same adapter operation in a BizTalk Server 2009 project in VS 2008.  This time I get the error:

    "Error occurred while crating the BizTalk port configuration file.  Index was out of range.  Must be non-neagative and less than the size of the collection.  Parameter name: index"

    And as before, no errors in any of the above trace logs.

    What was interesting however is that I did get output generated - namely the following 3 Schema files:

    - ClarifyAdapterBinding.xsd - Wrapper "Operation" schema
    - ClarifyAdapterBinding1.xsd  - "Request" schema (in my case WCF_CL_SITE - this imports WCF_CL_ADDR))
    - ClarifyAdapterBinding2.xsd - "Response" schema (in my case WCF_CL_ACK)

    Obviously (due to the error above) there was no binding file produced.

    Nonetheless, this was encouraging.  However, trying to compile the schemas as part of the BizTalk project  fails with the error:

    "The 'http://SIS.ESB.Schema.WCF_CL_ADDR:Address' element is not declared

    Looking into the generated ClarifyAdapterBinding1.xsd (i.e.; WCF_CL_SITE) I find what appears to be the culprit (shown in bold below):

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:ADDR="http://SIS.ESB.Schema.WCF_CL_ADDR" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://SIS.ESB.Schema.WCF_CL_SITE" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://SIS.ESB.Schema.WCF_CL_SITE" id="SiteDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation="WCF_CL_ADDR.xsd" namespace="http://SIS.ESB.Schema.WCF_CL_ADDR" />
      <xs:annotation>
        <xs:appinfo>
          <b:references>
                  <b:reference targetNamespace="http://SIS.ESB.Schema.WCF_CL_ADDR"></b:reference>
            %3
    Wednesday, July 8, 2009 2:07 AM
  • Hi,

    I'm kind of bogged down by a number of things right now, will look at this as soon as possible and reply! Thanks!

    Manas
    Wednesday, July 8, 2009 4:54 PM
  • Manas

    I really appreciate any time you can spend on this.  BTW, it looks like my previous message got truncated due to size (smile).  Here is the end of it...

    Rod

    ...

    The bolded import line above shows that this schema is dependant on the WCF_CL_ADDR.xsd schema and expects it to be in the same directory.  But it doesn't get generated - even though I have provided the XSD Schema for the WCF_CL_ADDR metadata type in my adapter as you can see in a previous post. 

     I have to conclude that this is the cause of both wizards ("Add Adapter Service Reference..." and "Consume WCF Adapter") failing to complete their operations (creating an App.config and generating a Binding file) in their respective project types (C# and BizTalk).

    So my question to you is do you know how to make these wizards generate these files?

    Furthermore, note that I think there could be another problem here potentially.  Even if the BizTalk Consume WCF Adapter wizard were to generate the schema file - I am worried that it would do so using the wrong file name (i.e.; ClarifyAdapterBinding3.xsd rather than WCF-CL_ADDR.xsd that the dependent schema is expecting) given the naming convention that wizard appears to follow for generated schema files.

    So I guess we need a way to tell the metadata of the adapter how to generate these dependent schema files, and then have those wizards respect those instructions.

    I hope you have some ideas for me.

    If I can provide any more information please let me know.

    Thanks,
    Rod

    Wednesday, July 8, 2009 5:35 PM
  • Hi,
    Looks like in the 'import' in your schema, you have the schema-location already specified. The wizard does not try to modify it, assuming it to be pointing to an external (and fixed location). Two ways to fix this:

    1. Make it point to an actual location where the schema is already present (I guess this does not work if the adapter has to be used by many consumers).
    2. Instead of specifying schema-location, specify the schema Namespace in the 'import'. The wizard will then loop through the avaibale list of schemas and figure out the correct filename to put in.

    Hope this helps!
    Manas
    Thursday, July 9, 2009 2:35 AM
  • Manas

    Can you give me an example of what you mean by 2) above?

    But even if I do this how will this help if wizard isn't generating the imported schema file (i.e.; the dependent WCF_CL_ADDR.xsd)?  The BizTalk "Consume WCF Adapter" is only generating three XSDs (the wrapper, and its contained Request (WCF_CL_EMPL), and its contained Response (WCF_ACK_EMPL).  There is no WCF_CL_ADDR being generated even though the adapter has all of the meta data for it.

    Is there away to force this, through perhaps supply more metadata settings to the adapter?

    Thanks for your continued help.

    Rod
    Thursday, July 9, 2009 11:19 AM
  • What I mean is, modify
    <xs:import schemaLocation="WCF_CL_ADDR.xsd" namespace="http://SIS.ESB.Schema.WCF_CL_ADDR" />
    to
    <xs:import 
    namespace="http://SIS.ESB.Schema.WCF_CL_ADDR" /> and see if that helps. You're sure that you've added this to the list of schemas, right?

    Thursday, July 9, 2009 12:00 PM
  • Manas

    I made the change to the schema you suggested but I get I get the same errors/problems.  The schema for WCF_CL_ADDR is simply not being generated - which causes the downstream issues discribed above.

    As for adding the metadata for this schema correctly, I am simply not sure.  I could use your review on this point.  Here is what I am doing in the ResolveOperationMetadata() routine for this "InsertSite" operation:

    .
    . 
    case "Clarify/InsertSite":
            om = new ParameterizedOperationMetadata(
                                      operationId, "ClarifyInsertSite");
            om.OriginalName = "InsertSite";
            om.Description = "This operation ....";
            om.OperationGroup = "ClarifyContract";
            om.OperationNamespace = ClarifyAdapter.SERVICENAMESPACE;
           //// syntax: Ack  InsertCustomer( Site  )
           OperationParameter parmSite = new OperationParameter(
                     WCF_CL_SITE", OperationParameterDirection.In,
                            new ComplexQualifiedType("ClarifySite"), false);
          parmSite.Description = "Site to be inserted";
          om.Parameters.Add(parmSite);
          OperationResult opSiteResult = new OperationResult(
                new ComplexQualifiedType("ClarifyACK"), false);
          om.OperationResult = opSiteResult;
    .
    .
    .
    

    Notice how I don't mention the "nested" WCF_CL_ADDR type here.  Is that correct?

    And here is what I am doing in the ResolveTypeMetadata() routine:

    .
    .
    .


    case "ClarifySite": System.Diagnostics.Debug.WriteLine("-+++++++++++++++++ ClarifySite resolved Entered!"); oTypeMetadata = new ClarifyTypeMetadataFromExternalSchema(typeId, "WCF_CL_SITE", "http://SIS.ESB.Schema.WCF_CL_SITE",
    "Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_SITE.xsd"); extraTypeMetadata = new ClarifyTypeMetadataFromExternalSchema("ClarifyAddress", "WCF_CL_ADDR", "http://SIS.ESB.Schema.WCF_CL_ADDR",
    "Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_ADDR.xsd"); extraTypeMetadataResolved = new TypeMetadataCollection(); extraTypeMetadataResolved.Add(extraTypeMetadata); System.Diagnostics.Debug.WriteLine("++++++++++++++++++ ClarifySite resolved Left!");
          return oTypeMetadata;


    case "ClarifyAddress":
           System.Diagnostics.Debug.WriteLine("&&&&&&&&&&&&&&&&&");
           oTypeMetadata = new ClarifyTypeMetadataFromExternalSchema(typeId,
                "WCF_CL_ADDR", "http://SIS.ESB.Schema.WCF_CL_ADDR",
    "Siemens.Clarify.Adapter.ContractSchemas.WCF_CL_ADDR.xsd");
           return oTypeMetadata;




    .
    .
    .


    Notice how I use the "extraTypeMetadata" feature to specify the dependent WCF_CL_ADDR schema in the "ClarifyInsertSite" case.  Is that correct?  One thing that is strange is that the "ClarifyAddress" case above is never called!  IOWs I never see the debugger output line:

    &&&&&&&&&&&&&&&&&&

    in the output.  This might be an indicator I am doing something wrong?

    I guess I don't understand when to use the "extraTypeMetadata" TypeMetadataCollection in the ResolveOperationMetadata() code and when to use it in the ResolveTypeMetadata() code.   It is probable that here is where I am going wrong - if in fact you are certain that the nested schemas should be getting generated...

    Can you have a look and tell what you think?  Please review my use of TypeId and TypeName here as well. 

    Thanks,

    Rod

    • Edited by RodDaSilva Thursday, July 9, 2009 4:29 PM Formatting
    Thursday, July 9, 2009 4:27 PM
  • Hi Rod,

    I dont understand why you expect "ClarifyAddress" case to be called. The semantics of extraTypeMetadata is that when resolving the metadata for a complex type foo, you're also able to resolve the metadata for bar, you want to give it out so that it goes and sits in the metadata cache. Giving something out in ExtraTypeMetadata does not mean that it becomes a part of your operation definition - that happens only when the type is referenced in an OperationParameter or from a ComplexQualifiedType which has been referenced from an OperationParameter. In general, I'd say that using extraTypeMetadata should be avoided if it is possible (though I must say that there is no issue/problem associated with its use - not using it tends to keep code cleaner).

    As you're using your own implementation of ExportInputXmlSchema and ExportOutputXmlSchema in the OperationMetadata, it really depends on the XmlSchemas give out in those methods that control how the WSDL/schemas look like in the end - not on your OperationMetadata. If you want the the ASDK to auto-generate the schemas for you by looking at the OperationMetadata, then you should not override ExportInputXmlSchema, ExportOutputXmlSchema and should use ParameterizedOperationMetadata that already have an implementation of these methods. However, in that case you will not be able to put many restrictions on the schema. It might be worthwhile to investigate.

    Regarding the original issue of the ADDR schema not appearing in the final list of schemas generated, can you verify that it is being correctly added to the list of schemas in the ExportInputXmlSchema and ExportOutputXmlSchema methods?
    Tuesday, July 14, 2009 1:15 PM
  • Manas

    Thanks for the response and sorry for the long delay in getting back to you.  I have been heads down trying to meet a deadline.

    Thanks for the explaination, but to be clear while I have tried to implement my own OperationMetadata sub class it did not work for me so I am not using that approach.  As you can see in my previous post I am only using ParameterizedOperationMetadata.  So everything regarding the ADDR schema/type is handled with ExtraTypeMetadata in my ResolveTypeMetadata() routine as shown.

    The only way I can get this all to work is to put ADDR in the same namespace as the schema that references.  This is not want I wanted but when I do this the wizards all generate the proper schema because in fact both types are defined in the same schema.  As soon as I spllit the schemas in two and give them separate namespaces, the dependent (ADDR) schema is not generated, causing the <import  schemaLocation=".\ADDR.xsd".../> tag to fail in the outer schema.

    Rod
    Friday, July 17, 2009 6:41 PM
  • I guess this may be the answer for the issue

    http://blogs.digitaldeposit.net/saravana/post/2011/09/16/WCF-LOB-Adapter-dealing-with-TypeMetadata-and-xsdInclude.aspx


    Regards, Saravana Kumar [MVP BizTalk Server] http://blogs.digitaldeposit.net/saravana/ http://www.biztalk247.com/
    Friday, September 16, 2011 1:58 PM