locked
Error while creating a new entity member in MDS RRS feed

  • Question

  • Hi

     

    I ma trying to create a new member ( below is the Request Message) but somehow it is failing with the error "A Member code is required".

    It's a very simple model where I have an entity with the following attributes : Name , Code , Cost

     

    <EntityMembersCreateResponse xmlns="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09"><OperationResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Errors><Error><Code>310022</Code><Context><FullyQualifiedName /><Identifier i:type="MemberIdentifier"><Id>00000000-0000-0000-0000-000000000000</Id><Name i:nil="true" /><InternalId>0</InternalId><Code i:nil="true" /><MemberType>Leaf</MemberType></Identifier><Type>MemberCode</Type></Context><Description>A member code is required.</Description></Error><Error><Code>201</Code><Context i:nil="true" /><Description>A database error has occurred. Contact your system administrator.</Description></Error></Errors><RequestId>557b7462-908c-411d-b348-60d81df5bb6f</RequestId></OperationResult></EntityMembersCreateResponse>

     

    Here is my Request Message

     

    <ns0:EntityMembersCreateRequest xmlns:ns1="http://schemas.datacontract.org/2004/07/Microsoft.MasterDataServices.Services.DataContracts" xmlns:ns0="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09" xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ns0:Members>
        <ns0:EntityId xsi:type="ns0:Identifier">
          <ns0:Name>Models</ns0:Name>
        </ns0:EntityId>
        <ns0:MemberType>Leaf</ns0:MemberType>
        <ns0:Members>
          <ns0:Member>
            <ns0:Attributes>         
              <ns0:Attribute>
                <ns0:Identifier xsi:type="ns0:Identifier">
                  <ns0:Name>Cost</ns0:Name>
                </ns0:Identifier>
                <ns0:Value xsi:type="a:string" xmlns:a="http://www.w3.org/2001/XMLSchema">1500</ns0:Value>
              </ns0:Attribute>
            </ns0:Attributes>
            <MemberId>
              <Name>Elitebook</Name>
              <Code>8440P0</Code>
              <MemberType>Leaf</MemberType>
            </MemberId>
          </ns0:Member>
        </ns0:Members>
        <ns0:ModelId xsi:type="ns0:Identifier">
          <ns0:Name>Notebooks</ns0:Name>
        </ns0:ModelId>
        <ns0:VersionId xsi:type="ns0:Identifier">
          <ns0:Name>Version_1</ns0:Name>
        </ns0:VersionId>
      </ns0:Members>
    </ns0:EntityMembersCreateRequest>

     

    Any suggestions

    Wednesday, February 2, 2011 4:18 PM

Answers

  • Hi

     

    I ma trying to create a new member ( below is the Request Message) but somehow it is failing with the error "A Member code is required".

    It's a very simple model where I have an entity with the following attributes : Name , Code , Cost

     

    <EntityMembersCreateResponse xmlns="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09"><OperationResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Errors><Error><Code>310022</Code><Context><FullyQualifiedName /><Identifier i:type="MemberIdentifier"><Id>00000000-0000-0000-0000-000000000000</Id><Name i:nil="true" /><InternalId>0</InternalId><Code i:nil="true" /><MemberType>Leaf</MemberType></Identifier><Type>MemberCode</Type></Context><Description>A member code is required.</Description></Error><Error><Code>201</Code><Context i:nil="true" /><Description>A database error has occurred. Contact your system administrator.</Description></Error></Errors><RequestId>557b7462-908c-411d-b348-60d81df5bb6f</RequestId></OperationResult></EntityMembersCreateResponse>

     

    Here is my Request Message

     

    <ns0:EntityMembersCreateRequest xmlns:ns1="http://schemas.datacontract.org/2004/07/Microsoft.MasterDataServices.Services.DataContracts" xmlns:ns0="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09" xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ns0:Members>
        <ns0:EntityId xsi:type="ns0:Identifier">
          <ns0:Name>Models</ns0:Name>
        </ns0:EntityId>
        <ns0:MemberType>Leaf</ns0:MemberType>
        <ns0:Members>
          <ns0:Member>
            <ns0:Attributes>         
              <ns0:Attribute>
                <ns0:Identifier xsi:type="ns0:Identifier">
                  <ns0:Name>Cost</ns0:Name>
                </ns0:Identifier>
                <ns0:Value xsi:type="a:string" xmlns:a="http://www.w3.org/2001/XMLSchema">1500</ns0:Value>
              </ns0:Attribute>
            </ns0:Attributes>
            <MemberId>
              <Name>Elitebook</Name>
              <Code>8440P0</Code>
              <MemberType>Leaf</MemberType>
            </MemberId>
          </ns0:Member>
        </ns0:Members>
        <ns0:ModelId xsi:type="ns0:Identifier">
          <ns0:Name>Notebooks</ns0:Name>
        </ns0:ModelId>
        <ns0:VersionId xsi:type="ns0:Identifier">
          <ns0:Name>Version_1</ns0:Name>
        </ns0:VersionId>
      </ns0:Members>
    </ns0:EntityMembersCreateRequest>

     

    Any suggestions

    Hi Amit

    it looks like you forgot the namespace on the member name and code, and memberId (and also MemberType):

     <ns0:MemberId>
     <ns0:Name>Elitebook</ns0:Name>
     <ns0:Code>8440P0</ns0:Code>
     </ns0:MemberId>
     



    Xavier Averbouch - Avanade , FRANCE
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Wednesday, February 2, 2011 4:38 PM

All replies

  • Hi

     

    I ma trying to create a new member ( below is the Request Message) but somehow it is failing with the error "A Member code is required".

    It's a very simple model where I have an entity with the following attributes : Name , Code , Cost

     

    <EntityMembersCreateResponse xmlns="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09"><OperationResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Errors><Error><Code>310022</Code><Context><FullyQualifiedName /><Identifier i:type="MemberIdentifier"><Id>00000000-0000-0000-0000-000000000000</Id><Name i:nil="true" /><InternalId>0</InternalId><Code i:nil="true" /><MemberType>Leaf</MemberType></Identifier><Type>MemberCode</Type></Context><Description>A member code is required.</Description></Error><Error><Code>201</Code><Context i:nil="true" /><Description>A database error has occurred. Contact your system administrator.</Description></Error></Errors><RequestId>557b7462-908c-411d-b348-60d81df5bb6f</RequestId></OperationResult></EntityMembersCreateResponse>

     

    Here is my Request Message

     

    <ns0:EntityMembersCreateRequest xmlns:ns1="http://schemas.datacontract.org/2004/07/Microsoft.MasterDataServices.Services.DataContracts" xmlns:ns0="http://schemas.microsoft.com/sqlserver/masterdataservices/2009/09" xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ns0:Members>
        <ns0:EntityId xsi:type="ns0:Identifier">
          <ns0:Name>Models</ns0:Name>
        </ns0:EntityId>
        <ns0:MemberType>Leaf</ns0:MemberType>
        <ns0:Members>
          <ns0:Member>
            <ns0:Attributes>         
              <ns0:Attribute>
                <ns0:Identifier xsi:type="ns0:Identifier">
                  <ns0:Name>Cost</ns0:Name>
                </ns0:Identifier>
                <ns0:Value xsi:type="a:string" xmlns:a="http://www.w3.org/2001/XMLSchema">1500</ns0:Value>
              </ns0:Attribute>
            </ns0:Attributes>
            <MemberId>
              <Name>Elitebook</Name>
              <Code>8440P0</Code>
              <MemberType>Leaf</MemberType>
            </MemberId>
          </ns0:Member>
        </ns0:Members>
        <ns0:ModelId xsi:type="ns0:Identifier">
          <ns0:Name>Notebooks</ns0:Name>
        </ns0:ModelId>
        <ns0:VersionId xsi:type="ns0:Identifier">
          <ns0:Name>Version_1</ns0:Name>
        </ns0:VersionId>
      </ns0:Members>
    </ns0:EntityMembersCreateRequest>

     

    Any suggestions

    Hi Amit

    it looks like you forgot the namespace on the member name and code, and memberId (and also MemberType):

     <ns0:MemberId>
     <ns0:Name>Elitebook</ns0:Name>
     <ns0:Code>8440P0</ns0:Code>
     </ns0:MemberId>
     



    Xavier Averbouch - Avanade , FRANCE
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    Wednesday, February 2, 2011 4:38 PM
  • Thanks for pointing that error
    Thursday, February 3, 2011 6:36 AM