XMLRPC for image upload.

155 views
Skip to first unread message

jusung Kye

unread,
Dec 12, 2011, 12:59:03 AM12/12/11
to TypePad Developers Network
Hi guys~
I'm developing TypePad service.
I'm using XML-RPC for implementation of request.

I wonder that TypePad support image uploading through XML-RPC?
I've been trying using "metaWeblog.newMediaObject" method for image
uploading.
It seems working fine but the request response is strange.
I mean it should be url where the uploaded file was placed in. But
it's not.

TypePad support for this?
Anyone know this?

Any kind of answer would be appreciate to me.
Thanks.

Satoshi Tanimoto

unread,
Dec 13, 2011, 4:55:46 PM12/13/11
to TypePad Developers Network
Hi,
In my testing with the attached req.xml file, it seems working
fine.What do you see in the response? Could you possibly share a bit
ofyour code or http request/response you got?
Below are the request and response from what I just tried. Hope this
helps.(BLOGID, EMAIL, and PASSWORD in req.xml need to be replaced with
theactual values)
$ curl -X POST -H 'Content-Type: text/xml' -d @req.xml
-vhttp://www.typepad.com/services/xmlrpc* About to connect() to
www.typepad.com port 80 (#0)*   Trying 10.17.141.160... connected*
Connected to www.typepad.com (10.17.141.160) port 80 (#0)> POST
/services/xmlrpc HTTP/1.1> User-Agent: curl/7.21.4
(universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5>
Host: www.typepad.com> Accept: */*> Content-Type: text/xml>
Content-Length: 6343> Expect: 100-continue>* Done waiting for
100-continue* HTTP 1.0, assume close after body< HTTP/1.0 200 OK<
Date: Tue, 13 Dec 2011 21:26:59 GMT< Server: Apache< X-Webserver:
oak-tp-app017< Cache-Control: private< Pragma: no-cache< Vary: cookie<
Content-Length: 373< Content-Type: text/xml* HTTP/1.0 connection set
to keep alive!< Connection: keep-alive<* Connection #0 to host
www.typepad.com left intact* Closing connection #0<?xml
version="1.0"encoding="utf-8"?><methodResponse><params><param><value><struct><member><name>width</name><value><int>196</int></value></member><member><name>url</name><value><string>http://stanimoto.typepad.com/typepad-logo.png</string></value></member><member><name>height</name><value><int>50</int></value></member></struct></value></param></params></methodResponse>
Regards,
Satoshi Tanimoto
> --
> You received this message because you are subscribed to the TypePad Developers Network.
> To post to this group, send email to typepad-d...@googlegroups.com
> To unsubscribe from this group, send email to typepad-dev-net...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/typepad-dev-network?hl=en
req.xml

Satoshi Tanimoto

unread,
Dec 13, 2011, 9:03:37 PM12/13/11
to jusung Kye, TypePad Developers Network
Hi Jusung,

It looks like you're getting the blog content as response. If the
request is successful, you would get an xml content including image
url, width, and height. What url are you using?
http://www.typepad.com/services/xmlrpc is the right one to use.

Could you share the code to make the request or a raw HTTP POST data?
(Please make sure you replace your password with a dummy content.)
That'd be very helpful for my investigation.

Regards,

Satoshi Tanimoto

On Tue, Dec 13, 2011 at 5:08 PM, jusung Kye <kyej...@gmail.com> wrote:
> The uploading processing works fine.
>
> But response data is not same as what I expected.
>
> I expected simple url but it was complicate strings.
>
> I put it in below.
>
> Is there any way I can get image url after uploading processing?
>
> Satoshi thank for your time.
>
> Take care.
>
> Jusung
>
>
>
> [MY RESPONSE]
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" id="typepad-standard"
> xmlns:fb="http://www.facebook.com/2008/fbml">
>
> <head>
>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>
> <meta name="generator" content="http://www.typepad.com/" />
>
> <link rel="stylesheet"
> href="http://blogsytest.typepad.com/second_blogsy_typepad/styles.css?v=6"
> type="text/css" media="screen" />
>
> <link rel="stylesheet"
> href="http://static.typepad.com/.shared:v20111208.01-0-geef0387:typepad:en_us/themes/common/print.css"
> type="text/css" media="print" />
>
> <link rel="alternate" type="application/atom+xml" title="Posts on 'Second
> Blogsy TypePad' (Atom)"
> href="http://blogsytest.typepad.com/second_blogsy_typepad/atom.xml" />
>
> <link rel="alternate" type="application/rss+xml" title="Posts on 'Second
> Blogsy TypePad' (RSS 1.0)"
> href="http://blogsytest.typepad.com/second_blogsy_typepad/index.rdf" />
>
> <link rel="alternate" type="application/rss+xml" title="Posts on 'Second
> Blogsy TypePad' (RSS 2.0)"
> href="http://blogsytest.typepad.com/second_blogsy_typepad/rss.xml" />
>
> <script type="text/javascript">
>
> var TPApp = {};
>
> TPApp.app_uri = "http://www.typepad.com/";
>
> </script>
>
> <script type="text/javascript"
> src="http://static.typepad.com/.shared:v20111208.01-0-geef0387:typepad:en_us/js/yui/yahoo-dom-event.js,/js/app/thumbnail-gallery-min.js,/js/sixatrack-loader.js,/js/app/flyouts-min.js"></script>
>
> <script type="text/javascript">
>
> var _gaq = _gaq || [];
>
> _gaq.push(['t2._setAccount', 'UA-225723-36']);
>
> _gaq.push(['t2._setDomainName', 'none']);
>
> _gaq.push(['t2._setAllowLinker', true]);
>
>         _gaq.push(['t2._setCustomVar', 1, 'Blog',
> '6a014e8be467db970d01539237afe0970b', 3]);
>
>         _gaq.push(['t2._setCustomVar', 2, 'Page Type', 'index', 3]);
>
> _gaq.push(['t2._trackPageview']);
>
>
> (function() {
>
>  var ga = document.createElement('script'); ga.type = 'text/javascript';
> ga.async = true;
>
>  ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
> 'http://www') + '.google-analytics.com/ga.js';
>
>  var s = document.getElementsByTagName('script')[0];
> s.parentNode.insertBefore(ga, s);
>
> })();
>
> </script>
>
>
>
> <title>Second Blogsy TypePad</title>
>
> <link rel="openid.server"
> href="http://www.typepad.com/services/openid/server" />
>
> <link rel="EditURI" type="application/rsd+xml" title="RSD"
> href="http://www.typepad.com/services/rsd/6a014e8be467db970d01539237afe0970b"
> />
>
>
>
> </head>
>
>
> <body class="layout-two-column-right">
>
> <div id="container">
>
> <div id="container-inner" class="pkg">
>
> <!-- banner -->
>
> <div id="banner">
>
> <div id="banner-inner" class="pkg">
>
> <h1 id="banner-header"><a
> href="http://blogsytest.typepad.com/second_blogsy_typepad/"
> accesskey="1">Second Blogsy TypePad</a></h1>
>
> <h2 id="banner-description">
>
> </h2>
>
> </div>
>
> </div>
>
>
> <div id="nav">
>
> <div id="nav-inner">
>
> <ul class="nav-list pkg">
>
> <li class="nav-list-item"><a
> href="http://blogsytest.typepad.com/second_blogsy_typepad/">Home</a></li>
>
> <li class="nav-list-item"><a
> href="http://blogsytest.typepad.com/second_blogsy_typepad/archives.html">Archives</a></li>
>
> <li class="nav-list-item"><a
> href="http://profile.typepad.com/blogsytest">Profile</a></li>
>
> <li class="last-nav-list-item nav-list-item"><a
> href="http://blogsytest.typepad.com/second_blogsy_typepad/atom.xml">Subscribe</a></li>
>
> </ul>
>
> </div>
>
> </div>
>
>
>
> <div id="pagebody">
>
> <div id="pagebody-inner" class="pkg">
>
> <div id="alpha">
>
> <div id="alpha-inner" class="pkg">
>
> <!-- entry list sticky -->
>
>
>
>
> </div>
>
> </div>
>
> <div id="beta">
>
> <div id="beta-inner" class="pkg">
>
> <!-- sidebar -->
>
>
>
> <!-- Blog Search Module -->
>
> <div class="module-search module">
>
>     <h2 class="module-header">Search</h2>
>
>     <div class="module-content">
>
>         <form id="search-blog" method="get"
> action="http://blogsytest.typepad.com/.services/blog/6a014e8be467db970d01539237afe0970b/search">
>
>             <input type="search" name="filter.q" results="5" value="" />
>
>             <input type="submit" value="Search" />
>
>         </form>
>
>     </div>
>
> </div>
>
> <!-- END Blog Search Module -->
>
> <div class="module-miniprofile module">
>
> <div class="module-content">
>
> <div class="mp-container">
>
> <div class="mp-info pkg">
>
> <div class="mp-avatar">
>
> <a href="http://profile.typepad.com/blogsytest" title="Blogsy Test's
> Profile">
>
> <img src="http://up3.typepad.com/6a014e8be467db970d015391f14aab970b-50si"
> alt="Blogsy Test" width="50" height="50" />
>
> </a>
>
> </div>
>
> <div class="mp-details">
>
> <div class="mp-name">
>
> <a href="http://profile.typepad.com/blogsytest" title="Blogsy Test's
> Profile">Blogsy Test</a>
>
> </div>
>
> <div class="mp-follow">
>
> <iframe
> src="http://www.typepad.com/services/connect/profile_module?user_id=6p014e8be467db970d&amp;follow_only=1&amp;source_uri=http%3A%2F%2Fblogsytest.typepad.com%2Fsecond_blogsy_typepad%2F"
> width="100%" height="20" frameborder="0" scrolling="no"
> allowtransparency="true"></iframe>
>
> </div>
>
> </div>
>
> </div>
>
> <div class="mp-counts pkg">
>
> <div class="mp-following">
>
> <div class="mp-inner">
>
> <a href="http://profile.typepad.com/blogsytest/contacts">
>
> <span class="mp-count">1</span>
>
> <span>Following</span>
>
> </a>
>
> </div>
>
> </div>
>
> <div class=mp-followers>
>
> <div class="mp-inner">
>
> <a href="http://profile.typepad.com/blogsytest/followers">
>
> <span class="mp-count">0</span>
>
> <span>Followers</span>
>
> </a>
>
> </div>
>
> </div>
>
> </div>
>
> <div class="mp-connections">
>
> <span>
>
> <a href="http://profile.typepad.com/typepadeverything" title="The TypePad
> Team's Profile"><img
> src="http://up3.typepad.com/6a00d83451c82369e20120a4e574c1970b-20si"
> alt="The TypePad Team" width="20" height="20" /></a>
>
> </span>
>
> </div>
>
> </div>
>
> </div>
>
> </div>
>
> <div class="module-archives module">
>
> <h2 class="module-header"><a
> href="http://blogsytest.typepad.com/second_blogsy_typepad/archives.html">Archives</a></h2>
>
> <div class="module-content">
>
> <ul class="module-list">
>
> </ul>
>
> </div>
>
> </div>
>
>
> <div class="module-categories module">
>
> <h2 class="module-header"><a
> href="http://blogsytest.typepad.com/second_blogsy_typepad/archives.html">Categories</a></h2>
>
> <div class="module-content">
>
> <ul class="module-list">
>
> </ul>
>
> </div>
>
> </div>
>
> <div class="module-syndicate module">
>
> <div class="module-content">
>
> <a
> href="http://blogsytest.typepad.com/second_blogsy_typepad/atom.xml">Subscribe
> to this blog's feed</a>
>
> </div>
>
> </div>
>
> <!-- powered by -->
>
> <div class="module-powered module">
>
> <div class="module-content">
>
> <a href="http://www.typepad.com/" title="Blog">Blog</a> powered by <a
> href="http://www.typepad.com/" title="TypePad">TypePad</a>
>
> </div>
>
> </div>
>
>
>
>
>
> </div>
>
> </div>
>
> </div>
>
> </div>
>
> <!-- footer -->
>
> <div id="footer">
>
> <div id="footer-inner">
>
> <ul class="footer-list pkg">
>
> <li class="footer-list-item"><a
> href="http://blogsytest.typepad.com/second_blogsy_typepad/">Second Blogsy
> TypePad</a></li>
>
> <li class="last-footer-list-item footer-list-item"><a
> href="http://www.typepad.com/">Powered by TypePad</a></li>
>
> </ul>
>
> </div>
>
> </div>
>
>
> </div>
>
> </div>
>
>
> <script type="text/javascript">
>
> <!--
>
> var extra_happy = Math.floor(1000000000 * Math.random());
>
> document.write('<img
> src="http://www.typepad.com/t/stats?blog_id=95580784976500491&amp;user_id=&amp;page='
> + escape(location.href) + '&amp;referrer=' + escape(document.referrer) +
> '&amp;i=' + extra_happy + '" width="1" height="1" alt="" style="position:
> absolute; top: 0; left: 0;" />');
>
> // -->
>
> </script>
>
>
>
> <!-- Start Quantcast tag -->
>
> <script type="text/javascript"
> src="http://edge.quantserve.com/quant.js"></script>
>
> <script type="text/javascript">_qoptions = { tags:"typepad.core" };
> _qacct="p-fcYWUmj5YbYKM"; quantserve();</script>
>
> <noscript>
>
> <a href="http://www.quantcast.com/p-fcYWUmj5YbYKM" target="_blank"><img
> src="http://pixel.quantserve.com/pixel/p-fcYWUmj5YbYKM.gif?tags=typepad.core"
> style="display: none" border="0" height="1" width="1" alt="Quantcast"/></a>
>
> </noscript>
>
> <!-- End Quantcast tag -->
>
>
>
>
>
>
> <!-- Blogside Toolbar -->
>
> <script type="text/javascript">
>
>     var TPToolbar = {
>
>         src:
> "http://www.typepad.com/services/toolbar?blog_id=6a014e8be467db970d01539237afe0970b&asset_id=&atype=index&to=http%3A%2F%2Fblogsytest.typepad.com%2Fsecond_blogsy_typepad%2F&autofollowed=0",
>
>         asset_xid: "",
>
>
>
>         bookmarklet_uri:
> "http://static.typepad.com/.shared/js/qp/loader-combined-min.js"
>
>     };
>
>     var TYPEPAD___bookmarklet_domain = "http://www.typepad.com/";
>
> </script>
>
> <script type="text/javascript"
> src="/.shared/js/toolbar/blogside-toolbar-combined-min.js"></script>
>
> <!-- End Blogside Toolbar -->
>
> <!-- Begin comScore Tag -->
>
> <script>
>
> document.write(unescape("%3Cscript src='" + (document.location.protocol ==
> "https:" ? "https://sb" : "http://b") +
> ".scorecardresearch.com/beacon.js'%3E%3C/script%3E"));
>
> </script>
>
> <script>
>
> COMSCORE.beacon({
>
>   c1: 2,
>
>   c2: "6035669",
>
>   c3: "",
>
>   c4: "http://blogsytest.typepad.com/second_blogsy_typepad/",
>
>   c5: "",
>
>   c6: "",
>
>   c15: ""
>
> });
>
> </script>
>
> <noscript>
>
>   <img
> src="http://b.scorecardresearch.com/b?c1=2&c2=6035669&c3=&c4=http%3A%2F%2Fblogsytest.typepad.com%2Fsecond_blogsy_typepad%2F&c5=&c6=&c15=&cv=1.3&cj=1"
> style="display:none" width="0" height="0" alt="" />
>
> </noscript>
>
> <!-- End comScore Tag -->
>
> </body>
>
> </html>
>
> <!-- ph=1 -->

jusung Kye

unread,
Dec 13, 2011, 10:18:03 PM12/13/11
to Satoshi Tanimoto, TypePad Developers Network
Hi! Satoshi,
I really appreciate your time.
I figured out what was wrong.
I've been used correct server url for publish, update, delete, fetching categories and so on.
But I had used incorrect url for uploading. In some processing that was screwed.
So I fixed it. Now it's working well.

Your checking suggestion was really helpful to me.
Again I appreciate your time.
Thank you!

Regards,
Jusung.
Reply all
Reply to author
Forward
0 new messages