none
WCF-SQL Binding property UseDatabaseNameInXsdNamespace RRS feed

  • Question

  • Hi,

    There is a binding property named "UseDatabaseNameInXsdNamespace" that can be used in the WCF-SQL send ports.  It is explained here (Microsoft doco):

    ------------------------------------------------------------------------------------------------------------------------------------

    Specifies whether the XSD generated for a particular artifact contains the database name. Set this to True to include the database name. Otherwise, set this to False. Default is False.

    This is useful in scenarios where a single application wants to execute operations on identically named artifacts with different metadata in different databases. If there is no database name in the namespace, the generated metadata will conflict. By setting this binding property you can include the database name in the namespace, thereby making them unique. Here is an example highlighting the change in namespace.

    UseDatabaseNameInXsdNamespace = False

    http://schemas.microsoft.com/Sql/2008/05/TableOp/dbo/Employee

    UseDatabaseNameInXsdNamespace = True

    http://schemas.microsoft.com/Sql/2008/05/TableOp/MyDatabase/dbo/Employee

    Notice that the database name is included in the namespace when the binding property is set to True.

    ---------------------------------------------------------------------------------------------------------------------

    I have tried this but Im getting the following error:

    ************************
    A message sent to adapter "WCF-SQL" on send port "[send port name]" with URI "mssql://localhost//BizTalkSqlWcfTesting?" is suspended.

    Error details: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The start element with name "Student" and namespace "http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo" was unexpected. Please ensure that your input XML conforms to the schema for the operation.
    ************************

    The message looks like this:

    <ns0:Insert xmlns:ns0="
    http://schemas.microsoft.com/Sql/2008/05/TableOp/BizTalkSqlWcfTesting/dbo/Student">
      <ns0:Rows>
        <ns1:Student xmlns:ns1="
    http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo">
          <ns1:Name>John Smith</ns1:Name>
          <ns1:Age>23</ns1:Age>
          <ns1:PostCode>3131</ns1:PostCode>
        </ns1:Student>
        <ns1:Student xmlns:ns1="
    http://schemas.microsoft.com/Sql/2008/05/Types/Tables/dbo">
          <ns1:Name>Joe Blow</ns1:Name>
          <ns1:Age>34</ns1:Age>
          <ns1:PostCode>5555</ns1:PostCode>
        </ns1:Student>
      </ns0:Rows>
    </ns0:Insert>

    The database name is BizTalkSqlWcfTesting and its trying to insert records to the table Student.  When I did not have the database name in the namespace and the property was set to false all is fine.

    Has anyone got this property to work?

    Thanks in advance. 

     

    Monday, February 8, 2010 1:01 AM

Answers

  • Hi John,

    I think you have to create three schema's (for each environment). I do not think you can get around the fact that the namespace database must match the send port database name.

    Regards,

    Steef-Jan Wiggers
    MCTS BizTalk Server
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk Server
    • Marked as answer by John Devers Wednesday, February 10, 2010 10:11 PM
    Wednesday, February 10, 2010 8:24 AM
    Moderator

All replies