ProcessWebServicesDocument

I was just reading the updated iTunesU Admin Guide, and noticed that there is a new method called ProcessWebServicesDocument. It appears that this method allows sending Web Services Document without doing multipart file attachments - is my understanding correct?
If that's the case, I don't quite get what the second example on page 62 is doing and why. Here is an excerpt:
--begin quote--
iTunes U also provides a two-step process for uploading your document, using the raw XML data and the ProcessWebServicesDocument operation:
1. Request an authorization token from your new or updated transfer script. For details, see "Uploading Content Using iTunes U Web Services" in Chapter 5.
2. Invoke a POST of the raw XML data, using the authorization token from step 1, to the ProcessWebServicesDocument operation.
For example, type:
/usr/bin/curl --data-binary @/pathtofile.xml -s <url from step 2>
A ProcessWebServicesDocument request might look like the following:
(echo -n 'url=' && echo -n `/usr/bin/curl -s 'https://deimos.apple.com/WebObjects/Core.woa/API/ProcessWebServicesDocument/ex ample.edu.1.2.3?credentials=foo&identity=user&time=123456&signature=abc123abc123 &type=XMLControlFile'`) | curl -F file=@/Users/yourshortusername/SampleXML/yourXMLOperationFile.xml
--end quote--
It would appear that this is still doing a multipart upload, due to the "curl -F" at the end, rather than a raw POST which the first example would accomplish with the "--data-binary" argument. Can anyone explain what this complex shell command does, and what the real purpose of ProcessWebServicesDocument is?
Thanks,
Dave

Very curious. Dave, I admit to being as confused as you. It looks as though the manual is saying ProcessWebServicesDocument goes with www-urlencoded ... then it looks like it's saying that ProcessWebServicesDocument and GetUploadURL are the same thing.
The real way to test it would be with code. I might play with it later tonight if Duncan does not snag this question first. If it does let you upload XML as www-urlencoded, I'm not sure it'd be buying that much, since you have to use multipart-MIME to upload content files ... and, to your code, a content file and an XML file are pretty much the same thing (a bag o' bytes).

Similar Messages

  • ProcessWebServicesDocument parsing error

    I'm trying to transfer a test document (just a document that uses the ShowTree action) to iTunes U. When I use curl and send to generated upload location, everything works fine. When I send to the ProcessWebServicesDocument portion of the API I receive an error from iTunes U in xml format.
    The XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <ITunesUDocument>
    <Version>1.1.1</Version>
    <ShowTree>
    <Handle>1278185</Handle>
    <KeyGroup>minimal</KeyGroup>
    </ShowTree>
    </ITunesUDocument>
    A) Curl to upload url
    request: curl -F file=@/Users/trek/Desktop/showtree.xml -s 'https://deimos2.apple.com/WebObjects/Files.woa/Upload/umich.edu/X_1586593881_43adc004.4516443d.451143ff/%22Admin%22%20%3Cadmin%40example.com%3E%20%28admin%29%20%5B0%5D/004868e5022eac8 779eeb7dcaa2ff2246fa2a7fbfda5bfed92ac69bab135996e6e076069b9'
    response: XML document of the section tree
    B) Curl to ProcessWebServicesDocument
    request: curl -F file=@/Users/trek/Desktop/showtree.xml -s 'https://deimos.apple.com/WebObjects/Core.woa/API/ProcessWebServicesDocument/um ich.edu?credentials=Administrator%40urn%3Amace%3Aumich.edu&identity=%22Admin%22%3Cadmin%40example.com%3E+%28admin%29%5B0%5D&time=1214833975&signature=5b74982f4879c9caef9fa94427c3586279c4b28f3449c2 813d0769fefd7e7d2c'
    response:
    <?xml version="1.0" encoding="UTF-8"?>
    <ITunesUResponse>
    <Version>1.1</Version>
    <error>Error on line -1: Premature end of file.</error>
    </ITunesUResponse>
    To further complicate matters I always get the "Error on line -1: Premature end of file" message, regardless of which url I send to, when sending the same xml file with a ruby library that successfully sends documents to web services of other companies.
    I created a tiny application on my computer to send these requests to and as far as I can tell the POST content of all four requests is identical.
    I've tried both locations with and without handles in the url and get the same results.
    Has anyone else used ProcessWebServicesDocument without seeing this?

    I figured it out. It wasn't clear to me from the documentation that using the upload url required the xml content to be sent as multipart data stored in an xml file and that the ProcessWebServicesDocument wanted the xml content sent as the entire plain text body of the POST request.
    The iTunes U group may want to consider making hthe different construction of the request bodies more noted or switch to a single (multipart or non-multipart body) method.
    I have it working now
    Trek

  • Uploading XML to ITunes U

    On page 140 of http://deimos.apple.com/rsrc/doc/iTunesUAdministrationGuide/iTunesUAdministratio nGuide.pdf
    it says
    To upload your document to an iTunes U server:
    1. Generate an authorization token from your new or updated transfer script. For details, see “Generating
    the Token Data” (page 41).
    2. Request an upload URL from iTunes U, using the authorization token from step 1. For example, type:
    /usr/bin/curl
    https://deimos.apple.com/WebObjects/Core.woa/API/GetUploadURL/example.edu.1.2.3?
    credentials=foo&identity=user&time=123456&signature=abc123abc123&type=XMLControl File
    The text example.edu.1.2.3 is the iTunes U value for the folder destination on the iTunes U site where
    you want to upload the document. It is recommended that you use the root folder of your site as the
    destination. An HTTP POST or GET performed on the finished URL returns another URL.
    3. Upload your document to iTunes U as an HTTP file-upload POST to the final URL created in step 2.
    I followed step one
    and got
    https://deimos2.apple.com/WebObjects/Files.woa/Upload/darden.virginia.edu/X_3628058717_94795d98.94795d99/%22Nick%20Skriloff%22%20%3Cskriloffn%40darden.virginia.edu%3E%20%28skriloffn%29 %20%5B42%5D/004bb0d75947497d1b3349ad554dca0526ea4ef6d14d22e5a292316bf723baed520c b73b07
    I created this XML document
    <?xml version=""1.0"" encoding=""UTF-8""?>
    <ITunesUDocument>
    <Version>1.1.4</Version>
    <ShowTree>
    <KeyGroup>maximal</KeyGroup>
    </ShowTree>
    </ITunesUDocument>
    When I do /usr/bin/curl -F file=@/pathtofile.xml -s <urlfrom_step2>
    I either get an error or nothing returns. Where do I see the output?

    Thanks for trying to help me.
    I am trying to accomplish page 140 and 141 of
    http://deimos.apple.com/rsrc/doc/iTunesUAdministrationGuide/iTunesUAdministratio nGuide.pdf
    The goal I understand I want to reach is to finish these 4 steps.
    1) Create a simple XML document to upload
    2) Generate an authorization token and request an upload URL
    3) The upload URL does not have "/Core.woa/API/ProcessWebServicesDocument/" in it so I need to replace it.
    String processUploadURL = results.Replace("/Files.woa/Upload/", "/Core.woa/API/ProcessWebServicesDocument/");
    4) Use Curl with the xml file and URL
    curl -F file=@/pathtofile.xml -s <urlfrom_step3>
    Step 1.
    <?xml version=""1.0"" encoding=""UTF-8""?>
    <ITunesUDocument>
    <Version>1.1.4</Version>
    <ShowTree>
    <KeyGroup>maximal</KeyGroup>
    </ShowTree>
    </ITunesUDocument>
    Step 2.
    https://deimos2.apple.com/WebObjects/Files.woa/Upload/darden.virginia.edu/X_3681077653_94795d98.94795d99/%22Nick%20Skriloff%22%20%3Cskriloffn%40darden.virginia.edu%3E%20%28skriloffn%29 %20%5B42%5D/004bbcdb98f8954f639626d863a4fd655ad5db8679711fd0569e1196c5fa52b8f9a7 0324e9
    Step 3
    https://deimos2.apple.com/WebObjects/Core.woa/API/ProcessWebServicesDocument/dar den.virginia.edu/X_3681077653_94795d98.94795d99/%22Nick%20Skriloff%22%20%3Cskriloffn%40darden.virginia.edu%3E%20%28skriloffn%29 %20%5B42%5D/004bbcdb98f8954f639626d863a4fd655ad5db8679711fd0569e1196c5fa52b8f9a7 0324e9
    Step 4
    curl -F file=c:\temp\itunes.xml https://deimos2.apple.com/WebObjects/Core.woa/API/ProcessWebServicesDocument/dar den.virginia.edu/X_3681077653_94795d98.94795d99/%22Nick%20Skriloff%22%20%3Cskriloffn%40darden.virginia.edu%3E%20%28skriloffn%29 %20%5B42%5D/004bbcdb98f8954f639626d863a4fd655ad5db8679711fd0569e1196c5fa52b8f9a7 0324e9
    Two questions
    1) Are my steps correct?
    2) When I mannually copy the output from step 4, I see
    curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
    error:14090086:SSL routines:SSL3GET_SERVERCERTIFICATE:certificate verify fail
    d
    More details here: http://curl.haxx.se/docs/sslcerts.html
    curl performs SSL certificate verification by default, using a "bundle"
    of Certificate Authority (CA) public keys (CA certs). If the default
    bundle file isn't adequate, you can specify an alternate file
    using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
    the bundle, the certificate verification probably failed due to a
    problem with the certificate (it might be expired, or the name might
    not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
    the -k (or --insecure) option.

Maybe you are looking for

  • IMovie Text

    Is there any way I can add highlighted text to a certain place in a clip. In a video I have someone is giving the finger and I wanted to write censored over it. blur the finger or put a small picture over it. Is any of this possible?

  • Tips for blue screen (BSOD) errors with Windows Vista and Intel Turbo Memory on T61/T61p

    Important note: The symptoms and solutions described below address only a small subset of the possible causes for blue screen errors, aka BSOD. This information can help address blue screen errors specifically related to Turbo Memory, but may not sol

  • What sort of functionality can I expect from Time Capsule in a Windows 7 environment?

    I'm looking to use time capsule as a backup for all of our families photos and such. What kind of functionality can I expect from Windows 7 and Time Capsule.

  • Problem in Select rights

    I have defined a role as: create role my_role; Then I granted the select on USER1.Table1 as: Grant select on User1.Table1 to my_role: Then I granted the role to User2 as: grant my_role to User2; Now I am able to execute the following query while I am

  • Probably a bug

    Hi, I'm writing this XML and XSL code and it's running perfectly on "XMLSPY" but when i use it on Oracle portal I receive the error the page could not be displayed plz fine the XML and XSL file hereunder: -----XML----- <?xml version="1.0" encoding="I