|
|
|
Forum Member
Group: Forum Members
Last Login: 5/16/2008 11:19:58 AM
Posts: 34,
Visits: 4
|
|
I wasn't entirely sure if we could issue POST statements for the ClipPosts as there was no form or sample in the docs. None the less, with this code:
function ngtoolkitClip(link, page) { var which = link || page; var postidXMLHttpRequest = new XMLHttpRequest(); postidXMLHttpRequest.open('POST',"http://services.newsgator.com/ngws/svc/PostItem.asmx/GetPostId"); postidXMLHttpRequest.setRequestHeader('X-NGAPIToken','6CE7A0D1DDF64CAA85D775B19B5714C6'); postidXMLHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); postidXMLHttpRequest.onreadystatechange= function () { if (postidXMLHttpRequest.readyState==4) { var response = postidXMLHttpRequest.responseText; var match = response.match("<string xmlns=\"http:\/\/services.newsgator.com/ngws/svc/PostItem.asmx\">([^`]*?)<\/string>"); var clipXMLHttpRequest = new XMLHttpRequest(); clipXMLHttpRequest.open('POST',"http://services.newsgator.com/ngws/svc/PostItem.asmx/ClipPosts"); clipXMLHttpRequest.setRequestHeader('X-NGAPIToken','6CE7A0D1DDF64CAA85D775B19B5714C6'); clipXMLHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); clipXMLHttpRequest.onreadystatechange= function () { if (clipXMLHttpRequest.readyState==4) { var response = clipXMLHttpRequest.responseText; alert(match[1]); alert(response);
} } clipXMLHttpRequest.send("postId=" + match[1] + "&folderId=0"); } } postidXMLHttpRequest.send("url=" + link); }
response comes back as
ClipPosts Web Service method name is not valid
Any ideas on what I'm doing wrong?
|
|
|
|
|
Rockstar
Group: Forum Members
Last Login: 3/27/2007 8:15:46 AM
Posts: 173,
Visits: 19
|
|
| Yeah, that's the trouble, ASP.NET won't marshal the array argument in a POST. This one has to go up as SOAP, unless I deploy a simpler version that clips only one post at a time, but that will take some time to get out to production.
|
|
|
|