Error "Invalid entry Id/Uri" for batch updates to google contacts - gdata

I'm attempting to perform a batch update of google contacts per https://developers.google.com/google-apps/contacts/v3/#batch_operations_for_contacts, but I'm getting an "Invalid entry Id/Uri" error. I'm posting the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gContact="http://schemas.google.com/contact/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" gd:etag=""RHwzfzVSLyt7I2A9XRVREk4DQQw."">
<entry gd:etag=""Q34zcDVSLit7I2A9XRVTFkkOTwE."">
<id>http://www.google.com/m8/feeds/contacts/emiliano.heyns%40iris-advies.com/base/376125d892c1b5a</id>
<batch:id>delete-cornel.straver#han.nl</batch:id>
<batch:operation type="delete"/>
</entry>
</feed>
to which I'm getting this response:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gd="http://schemas.google.com/g/2005" xmlns:gContact="http://schemas.google.com/contact/2008">
<id>https://www.google.com/m8/feeds/contacts/emiliano.heyns%40iris-advies.com/full/batch/1432240618884</id>
<updated>2015-05-21T20:36:58.884Z</updated>
<title>Batch Feed</title>
<entry>
<id>http://www.google.com/m8/feeds/contacts/emiliano.heyns%40iris-advies.com/base/376125d892c1b5a</id>
<updated>2015-05-21T20:36:58.884Z</updated>
<title>Error</title>
<content>Invalid entry Id/Uri</content>
<batch:id>delete-cornel.straver#han.nl</batch:id>
<batch:status code="400" reason="Invalid entry Id/Uri"/>
<batch:operation type="delete"/>
</entry>
</feed>
I know the etags and the ID are correct as I've gotten them by requesting the contacts feed; it's the response from that which I'm modyfying into the query above.

Related

QBO API V3 Sparse update request to reactivate entity in named list

According to the Accounting API docs named lists items are soft deleted, so it is possible to reactivate them with a sparse update where Active is set to true. This is working fine for Term, Account, PaymentMethod, and Department.
However we ran into issues when trying to sparse update Class and TaxCode. Here are the request/response we got in each case:
<?xml version="1.0" encoding="UTF-8"?>
<Class xmlns="http://schema.intuit.com/finance/v3" sparse="true">
<Id>5000000000000020362</Id>
<Name>Consultancy (deleted)</Name>
<SyncToken>1</SyncToken>
<Active>true</Active>
</Class>
Response from request to sparse update to reactivate class:
<?xml version="1.0" encoding="UTF-8"?>
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2016-12-29T10:36:51.732-08:00">
<Fault type="ValidationFault">
<Error code="6000" element="">
<Message>A business validation error has occurred while processing your request</Message>
<Detail>Business Validation Error: You cannot modify a list element that has been deleted.</Detail>
</Error>
</Fault>
</IntuitResponse>
Request to activate a tax code
<?xml version="1.0" encoding="UTF-8"?>
<TaxCode xmlns="http://schema.intuit.com/finance/v3" sparse="true">
<Id>4</Id>
<Name>California - Inactive</Name>
<SyncToken>1</SyncToken>
<Active>true</Active>
</TaxCode>
Response from request to sparse update to reactivate tax code:
<?xml version="1.0" encoding="UTF-8"?>
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2016-12-30T14:20:24.614-08:00">
<Fault type="ValidationFault">
<Error code="500" element="Operation">
<Message>Unsupported Operation</Message>
<Detail>Operation Update is not supported.</Detail>
</Error>
</Fault>
</IntuitResponse>
Any help would be much appreciated.
Thanks,
Fernando

Batch Operations API V3 - blank response

Here is a sample of a bacth operation request:
<?xml version='1.0' encoding='UTF-8'?>
<IntuitBatchRequest xmlns="http://schema.intuit.com/finance/v3" >
<BatchItem operation="sparse" bId="bid1">
<Invoice>
<Id>183</Id>
<SyncToken>4</SyncToken>
<SalesTermRef>5</SalesTermRef>
</Invoice>
</BatchItem>
</IntuitBatchRequest>
I get a blank response and the invoice is not updated.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-11-26T09:45:12.812-08:00"/>
Any ideas ?
Thanks

How to read some element name from XML using GData library?

I am making an app in which I am using SOAP web service, I am receiving this data -
<?xml version="1.0" encoding="UTF-8"?>
<User xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.myurl.com/">
<code>200</code>
<profile>
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<id>1</id>
<country>Afghanistan</country>
<isd_code>93</isd_code>
<timezone>+04:30</timezone>
<visible>false</visible>
</Table>
</NewDataSet>
</profile>
</User>
And I am using GData library to read this data. I am able to read <NewDataSet> element values but don't know how to read value of <code> tag. So please suggest me to do this.

Unable to Create Live Smooth Streaming Publishing Point Programatically

I'm trying to use the REST API for IIS Media Services to create a Live Publishing point programatically. For this, I'm sending a POST call to this URL:
http://127.0.0.1/services/smoothstreaming/publishingpoints.isml/settings
I've included two custom headers to the request:
Content-Type: application/atom+xml
Slug: /test.isml
And this is the body of the request:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<id>http://127.0.0.1/test.isml/settings</id>
<title>Test</title>
<updated>2012-07-12T19:13:25Z</updated>
<content type="application/xml">
<SmoothStreaming xmlns="http://schemas.microsoft.com/iis/media/2011/03/streaming/management">
<Settings>
<Title>Test</Title>
<SourceType>Push</SourceType>
<AutoStart>false</AutoStart>
<AutoRestartOnEncoderReconnect>false</AutoRestartOnEncoderReconnect>
<LookAheadChunks>2</LookAheadChunks>
<Archive enabled="false">
<Path useEventIdOnPath="false" />
</Archive>
<ClientConnections enabled="true">
<ClientManifestVersion>2.0</ClientManifestVersion>
</ClientConnections>
<ServerConnections enabled="false">
<SendEndOfStreamOnStop>false</SendEndOfStreamOnStop>
</ServerConnections>
</Settings>
</SmoothStreaming>
</content>
</entry>
IIS is giving me a 405/Bad Request error with this body:
<?xml version="1.0" encoding="UTF-8"?>
<SmoothStreaming xmlns="http://schemas.microsoft.com/iis/media/2011/03/streaming/management">
<Error>
<ErrorCode>0x80880026</ErrorCode>
<ErrorMessage>The resource contains one or more elements that contain invalid data. For information about valid resource representations, please see the documentation for the supported schemas.</ErrorMessage>
</Error>
</SmoothStreaming>
Anyone knows what I'm doing wrong here?
Ommiting the "Archive" and "ServerConnections" nodes fixed it. Not sure it there's anything wrong in them, or if they're only supposed to be included when enabled=true.

NSXMLParser error code 201

I have an xml data called
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfflineDealModel>
<DealUri>http://www.upto75.com/Therapy_Ayurveda/m/5505/Sale_Offer.html</DealUri>
<DealCode i:nil="true"/>
</OfflineDealModel>
When I am parsing this data I am getting the error code called 201 at the line <DealCode i:nil="true"/>.Kindly help me how to solve this.Let me know if you need any more details.
It seems to be your tag not closed properly.
<DealCode i:nil="true">
</DealCode>
you need to add xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
Just Try This :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfflineDealModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<DealUri>http://www.upto75.com/Therapy_Ayurveda/m/5505/Sale_Offer.html</DealUri>
<DealCode i:nil="true" />
</OfflineDealModel>
may be its work