Blogs

Showing 0 results.

Forums

« Back to Digital Signs API Forum

DMP add asset from URL - HTTP 500 error

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi,
 
I'm trying to upload an image (PNG) file from URL to the DMP via HTTP POST.  However, I'm getting an internal server error whenever I try to do so.  I've tried posting the XML payload in both escaped and unescaped format, and I get the same error.  However, the return payload is quite sparse and doesn't contain much information to identify the cause of the error.  Is there any way I can obtain some additional information on how to resolve this issue?
 
Below is the return payload the server:
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:result
xmlns:ns2="http://www.cisco.com/dms/xml/ns/dsmCommonService"
xmlns:ns3="http://www.cisco.com/dms/xml/ns/historyManagement"><status>failure</status><code>Internal
Server Error</code></ns2:result>
 
Below are the URLs used and the form data being posted:
 
HTTP POST 
Endpoint URL: /xTAS-core/services/content/assets/
Content type: "multipart/form-data"
 
Form Data (unescaped):

--ou812--------------8c405ee4e38917c
Content-Disposition: form-data; name="data";

<n1:asset

xmlns:n1="http://www.cisco.com/dms/xml/ns/dsm/contentManagement"><title>FireRedImage</title><fileName>http://172.16.7.105:90/DeviceServices/images/fire-red.png</fileName><description>Fire
Alert Red
Image</description><fileType>IMAGES</fileType><estimatedDuration><Hours>0</Hours><Minutes>2</Minutes><Seconds>30</Seconds></estimatedDuration><categoryIdList><id>9</id></categoryIdList><assetOwner>superuser</assetOwner><storageType>url</storageType><downloadurl>true</downloadurl></n1:asset>

--ou812--------------8c405ee4e38917c--
 
Form Data (escaped):

--ou812--------------8c405ee4e38917c
Content-Disposition: form-data; name="data";

XML=%3Cn1%3Aasset%20xmlns%3An1%3D%22http%3A%2F%2Fwww.cisco.com%2Fdms%2Fxml%2Fns%2Fdsm%2FcontentManagement%22%3E%3Ctitle%3EFireRedImage%3C%2Ftitle%3E%3CfileName%3Ehttp%3A%2F%2F172.16.7.105%3A90%2FDeviceServices%2Fimages%2Ffire-red.png%3C%2FfileName%3E%3Cdescription%3EFire%20Alert%20Red%20Image%3C%2Fdescription%3E%3CfileType%3EIMAGES%3C%2FfileType%3E%3CestimatedDuration%3E%3CHours%3E0%3C%2FHours%3E%3CMinutes%3E2%3C%2FMinutes%3E%3CSeconds%3E30%3C%2FSeconds%3E%3C%2FestimatedDuration%3E%3CcategoryIdList%3E%3Cid%3E9%3C%2Fid%3E%3C%2FcategoryIdList%3E%3CassetOwner%3Esuperuser%3C%2FassetOwner%3E%3CstorageType%3Eurl%3C%2FstorageType%3E%3Cdownloadurl%3Etrue%3C%2Fdownloadurl%3E%3C%2Fn1%3Aasset%3E

--ou812--------------8c405ee4e38917c--

Thanks,
Elaine
 

RE: DMP add asset from URL - HTTP 500 error
playlists dmp asset dmm
Answer
1/11/11 3:18 AM as a reply to Elaine David.

I'm trying to upload an image (PNG) file from URL to the DMP via HTTP POST.

 
You cannot upload an Asset to the DMP directly using an HTTP POST.
 
One possible way to display an Asset on the DMP is to display it within a Playlist. To do this via APIs, you must upload the Asset to the DMM, create a Playlist that contains the Asset, and then publish the Playlist to the DMP.
 
 
-Hashir




I'm trying to upload an image (PNG) file from URL to the DMP via HTTP POST.



 
You cannot upload an Asset to the DMP directly using an HTTP POST.
 
One possible way to display an Asset on the DMP is to display it within a Playlist. To do this via APIs, you must upload the Asset to the DMM, create a Playlist that contains the Asset, and then publish the Playlist to the DMP.
 
 
-Hashir

 
Perhaps I should have made that distinction clear, but I am in fact trying to upload the asset to the DMM using the documented API (/xTAS-core/services/content/assets/content/assets/).  Please refer to my original post (endpoint URL):
 
HTTP POST 
Endpoint URL: /xTAS-core/services/content/assets/
Content type: "multipart/form-data"
 
This is the API that is throwing the HTTP 500 error.
 
-Elaine
 

Your XML data looks fine. Have you been able to use the HTML page provided in the documentation to do this upload (pasted below for convenience)?
 

 
 

<html>
<body>
<form action="http://____YOUR_HOSTNAME____:8080/xTAS-core/services/content/assets/" enctype="multipart/form-data" method="POST">
data:
<textarea cols="40" rows="20" name="data"></textarea>
<br/>
<input type="submit" value="Upload"/>
</form>
</body>
</html>

 
 

I was sending the HTTP POST out programatically through the .NET HTTP APIs.  I found the issue with the form boundary field and I can create the asset successfully now.  Thanks for your help!
 

Elaine,
 
Can you please share your sample code which
sends HTTP POST to DMM to create an asset? I was trying to do similar
things but failed.
 
Thanks
Eddie
 
I was sending the HTTP POST out programatically through the .NET HTTP APIs.  I found the issue with the form boundary field and I can create the asset successfully now.  Thanks for your help!
 

I am running into the same issue but not sure what the "Boundary" issue is. Can someone shed some light?

Collateral


No files available