4. Januar 2014 15:24
$no = '11000';
$Result = Invoke-RestMethod -Method Get -UseDefaultCredential -Uri "https://localhost:7048/NAV/OData/CustomerCard('$no')"
$etag = $Result.entry.content.properties.ETag
$ifmatchheader = @{"If-Match"="W/""'$etag'"""}
Invoke-RestMethod -Method Delete -UseDefaultCredential -Uri "https://localhost:7048/NAV/OData/CustomerCard('$no')" -Headers $ifmatchheader
<!doctype html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Fiddler Echo Service</title></head><body style="font-family: arial,sans-serif;"><h1>Fiddler Echo Service</h1><br /><pre>DELETE /DynamicsNAV71/OData/Company('CRONUS%20AG')/CustomerCard('D00018') HTTP/1.1
Host: xxx.xxx.xxx.xx:7048
Content-Type: application/json;odata=verbose
User-Agent: Easy_Nav_Connector/1.0 CFNetwork/672.0.8 Darwin/13.0.0
Content-Length: 0
Connection: keep-alive
ifmatchheader: If-Match:"W/"'32%3BEgAAAAJ7%2F0QAMAAwADAAMQA4AAAAAAA%3D6%3B4949920%3B'""
Accept: application/json;odata=verbose
Accept-Language: en-us
no: D00018
Accept-Encoding: gzip, deflate
Etag: W/"'32%3BEgAAAAJ7%2F0QAMAAwADAAMQA4AAAAAAA%3D6%3B4949920%3B'"
</pre>This page returned a <b>HTTP/200</b> response <br /><hr /><ul><li>To configure Fiddler as a reverse proxy instead of seeing this page, see <a href='http://fiddler2.com/r/?REVERSEPROXY'>Reverse Proxy Setup</a><li>You can download the <a href="FiddlerRoot.cer">FiddlerRoot certificate</a></ul></body></html>
4. Januar 2014 16:54
Objektart Objekt-ID Objektname Servicename Veröffentlicht
Page 21 Debitorenkarte CustomerCard Ja
PS C:\Users\dago> $no = 'D00020';
$Result = Invoke-RestMethod -Method Get -UseDefaultCredential -Uri "http://localhost:7048/DynamicsNAV71/OData/CustomerCard('$no')"
$etag = $Result.entry.content.properties.ETag
$ifmatchheader = @{"If-Match"="W/""'$etag'"""}
Invoke-RestMethod -Method Delete -UseDefaultCredential -Uri "http://localhost:7048/DynamicsNAV71/OData/CustomerCard('$no')" -Headers $ifmatchheader
PS C:\Users\dago>
Invoke-RestMethod : <?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code
/><m:message xml:lang="en-US">Microsoft Dynamics NAV Data Services attempted to issue a client callback to show a confirmation dialog box: Deleting the
Customer 10000 will cause the Customer No. to be deleted for the associated Service Items. Do you want to continue? (Table 18 Customer). Client callbacks
are not supported on Microsoft Dynamics NAV Data Services.</m:message></m:error>
[..]
Invoke-RestMethod : <?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code
/><m:message xml:lang="en-US">Resource not found for the segment 'CustomerCard'.</m:message></m:error>
[..]
5. Januar 2014 16:37
ifmatchheader: If-Match:"W/"'32%3BEgAAAAJ7%2F0QAMAAwADAAMQA4AAAAAAA%3D6%3B4949920%3B'""
If-Match: W/"'32%3BEgAAAAJ7%2F0QAMAAwADAAMQA4AAAAAAA%3D6%3B4949920%3B'"