Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.
This repository was archived by the owner on May 24, 2024. It is now read-only.

Unable to delete an entity in Bing spatial data service data source using __deleteEntity in the xml schema #8

Description

@Ashtouded

Repro steps:

  1. Create a data source on Bing spatial data services (SDS) and add few entities
  2. Create an xml file similar to following to delete an entity
<MainRoot>
  <xs:schema id="shopsBingSDSDataSource_dev" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="shopsBingSDSDataSource_dev" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="Shop">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="shopId" type="xs:string" />
                <xs:element name="shopLocation" msdata:DataType="Microsoft.SqlServer.Types.SqlGeography, Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" type="xs:anyType" minOccurs="0" />
                <xs:element name="__deleteEntity" type="xs:boolean" minOccurs="0" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
      <xs:unique name="Constraint1" msdata:PrimaryKey="true">
        <xs:selector xpath=".//Shop" />
        <xs:field xpath="shopId" />
      </xs:unique>
    </xs:element>
  </xs:schema>  
  <Offering>
    <shopId>8df24e6f-d877-45bd-9256-bc9933d1b154</shopId>
	<shopLocation>POINT (0 0)</shopLocation>    
	<__deleteEntity>true</__deleteEntity>
  </Offering>
</MainRoot>```

3. Use the below method from the toolkit to upload a job (Create a console application to test this. Take reference to the Bing SDS toolkit source code project)
`public async Task<DataflowJob> Upload(DataSource dataSource, LoadOperation loadOperation, bool setPublic, bool skipEmptyLocations)`

Expected: Job on Bing SDS should get created

Actual result: Exception thrown at Line 1440 in Datasource.cs
`var deleteInfo = (string)row[deleteIdx];`

Possible Solution: Use ToString() in above code as follows. This did not give me exception.
`var deleteInfo = row[deleteIdx].ToString();`


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions