Malformed XML error and Caching frustration

2 views
Skip to first unread message

kennyjay

unread,
May 27, 2008, 7:32:20 PM5/27/08
to Orkut Developer Forum
I'm using a dynamic url like this:

1) http://dev.gwidgets.com/gadgetserver1-c.php?bpc=1&gid=82&pid=os&site=orkut.com

loading that page in a browser, then view source, and then paste the
same xml in a static file here:

2) http://dev.gwidgets.com/apps/orkut/hello_world1-c.xml

Results upon trying to add an application:

1) for dynamic url, loads confirmation page, with app title,
however, when loading application, I get

"Malformed XML in file http://dev.gwidgets.com/gadgetserver1-c.php?bpc:
Premature end of file. At: (1,1)"

2) for static page, loads just fine.

As for CACHING:

1. Trying to debug this was maddening because Orkut seemed to cache
everything no matter what I tried. I tried both methods, &bpc=1 and
the new

<Optional feature="content-rewrite">
<Param name="include">NONE</Param>
</Optional>

Neither appeared to work reliably. Sometimes if I added a few extra
parameters, the title was cached and not the content, and visa versa.
The ONLY way I found to reliably get cached was to alter the name of
my php file, e.g., gadgetserver2.php for each test case.

What gives? This same xml is working fine in MySpace and hi5, but
Orkut has been just frustrating. Luckily the random javascript errors
appeared to have stopped.

Can anyone who has gone through this process successfully help out?

Thanks

Ken

kennyjay

unread,
May 27, 2008, 8:22:16 PM5/27/08
to Orkut Developer Forum
Just an addendum. I think I worked through the Malformed xml issue by
reformatting my php properly. However, now I get the same sort of
issue where the dynamic url returns a "No appropriate view could be
found for gadget: http://prod.gwidgets.com/gadgetserver_fixed.php?bpc.."
error. The static url appears to load the app ok.

The urls are:

dynamic: http://prod.gwidgets.com/gadgetserver_fixed.php?bpc=1&gid=82&pid=os&site=orkut.com
static: http://prod.gwidgets.com/apps/orkut/einstein_static.xml

They appear to return the same xml and the xml validates just fine on
w3c.org..


On May 27, 5:32 pm, kennyjay <kenneth.jen...@gmail.com> wrote:
> I'm using a dynamic url like this:
>
> 1)http://dev.gwidgets.com/gadgetserver1-c.php?bpc=1&gid=82&pid=os&site=...
>
> loading that page in a browser, then view source, and then paste the
> same xml in a static file here:
>
> 2) http://dev.gwidgets.com/apps/orkut/hello_world1-c.xml
>
> Results upon trying to add an application:
>
> 1) for dynamic url, loads confirmation page, with app title,
> however, when loading application, I get
>
> "Malformed XML in filehttp://dev.gwidgets.com/gadgetserver1-c.php?bpc:

Jason

unread,
Jun 2, 2008, 7:13:15 PM6/2/08
to Orkut Developer Forum
Hi Ken. I'm sorry for the late reply.

Are you setting the content-type header in your PHP script to
application/xml or text/xml? Also, you shouldn't append &bpc=1 to your
application's URI. Instead, append it to the address bar after you've
added the application (e.g. http://sandbox.orkut.com/Application.aspx?appId=...&uid=...&bpc=1).

We were experiencing several issues with our content re-writing
mechanism and have temporarily disabled it in the sandbox. Please let
me know if you're still seeing the caching issues that you reported
earlier.

- Jason

On May 27, 5:22 pm, kennyjay <kenneth.jen...@gmail.com> wrote:
> Just an addendum. I think I worked through the Malformed xml issue by
> reformatting my php properly. However, now I get the same sort of
> issue where the dynamic url returns a "No appropriate view could be
> found for gadget:http://prod.gwidgets.com/gadgetserver_fixed.php?bpc.."
> error. The static url appears to load the app ok.
>
> The urls are:
>
> dynamic: http://prod.gwidgets.com/gadgetserver_fixed.php?bpc=1&gid=82&pid=os&s...

kennyjay

unread,
Jun 3, 2008, 10:53:34 AM6/3/08
to Orkut Developer Forum
Hi Jason

What I found in the end was that a url such as ours was not handled
properly by Orkut. Our original url was:

http://prod.gwidgets.com/gadgetserver.php?gid=81&site=orkut.com&pid=os&bpc=1

Orkut rendered it's iframe as:

http://42ls3815uh72t4hun5udfcs327esfmeo.sandbox.orkut.gmodules.com/gadgets/ifr?url=http://prod.gwidgets.com/gadgetserver.php?gid=81&site=orkut.com&pid=os&bpc=1&parent=http://sandbox.orkut.com&lang=en-US&country=US&synd=orkut-sandbox&view=canvas&mid=3&libs=dynamic-height%3Aviews&h=600&st=AFinprThbNsKP1SXVl73pYB1erxY3uLpDh-XL4ndEqHDimbQ1X1kT6PP8840gMxLGu3yYjOuOs9NvnaMePW5upgbMAhJ4Ei68MhtoJkf82A7ovkzwmHpgLE#gadgetId=857432495391&gadgetOwner=16880368914307770790&gadgetViewer=16880368914307770790&view-params=

We have changed it to (and this works fine with no further caching
issues:

http://prod.gwidgets.com/apps/os/orkut/en/81.php?bpc=1

For some reason it appeared that Orkut choked on our url that had
several query string parameters specified. We went to more of a
directory based structure and now parse the information (os, orkut,
etc.) from the path instead of the query string.

Have we missed something obvious here? In your iframe url, you embed
our url, which as an additional "?" etc. Was I confusing your url
parsing?

Regards

Ken

On Jun 2, 5:13 pm, Jason <apija...@google.com> wrote:
> Hi Ken. I'm sorry for the late reply.
>
> Are you setting the content-type header in your PHP script to
> application/xml or text/xml? Also, you shouldn't append &bpc=1 to your
> application's URI. Instead, append it to the address bar after you've
> added the application (e.g.http://sandbox.orkut.com/Application.aspx?appId=...&uid=...&bpc=1).
> > > Ken- Hide quoted text -
>
> - Show quoted text -

Jason

unread,
Jun 5, 2008, 2:21:40 PM6/5/08
to Orkut Developer Forum
Hi Ken. Yes, I think that's exactly what happened -- most of the time,
the application specification is a literal XML file. Since the
specification's URL is passed as a query string parameter to the orkut
proxy, the URL can't have any parameters of its own. In this case,
changing to a path-based argument scheme was a good choice.

As I said above, adding bpc=1 to your PHP script's URL has no effect,
so you should remove it:

http://prod.gwidgets.com/apps/os/orkut/en/81.php

Instead, append &bpc=1 to the URL in the address bar:

http://sandbox.orkut.com/Application.aspx?appId=...&uid=...&bpc=1

This will effectively bypass the cache and reload your spec from your
server.

- Jason

On Jun 3, 7:53 am, kennyjay <kenneth.jen...@gmail.com> wrote:
> Hi Jason
>
> What I found in the end was that a url such as ours was not handled
> properly by Orkut. Our original url was:
>
> http://prod.gwidgets.com/gadgetserver.php?gid=81&site=orkut.com&pid=o...
>
> Orkut rendered it's iframe as:
>
> http://42ls3815uh72t4hun5udfcs327esfmeo.sandbox.orkut.gmodules.com/ga...

kennyjay

unread,
Jun 6, 2008, 9:58:31 AM6/6/08
to Orkut Developer Forum
Thanks Jason,

Hi5 and MySpace both support query string params very well. I thought
it was safe to assume that it would work here. Is this something you
will support in the future?

Regards

Ken
> > > - Show quoted text -- Hide quoted text -

Jason

unread,
Jun 6, 2008, 4:30:13 PM6/6/08
to Orkut Developer Forum
Hi Ken. I wouldn't count on any fixes right around the corner. I
recommend parsing by path from here on out since that should work
reliably across containers.

- Jason

Luke

unread,
Jun 15, 2008, 9:48:50 PM6/15/08
to Orkut Developer Forum
Hi Ken,

If you use apache you can use mod_rewrite to create a rewrite rule in
your .htaccess to satisfy the need for a static url and that translate
into a dynamic script.

example .htaccess file:

RewriteEngine On
RewriteRule ^orkut.xml DYNAMIC_SCRIPT

Then you simply give your orkut gadget url as url to http://gwidgets.com/orkut.xml
and mod_rewrite will turn that into the dynamic url

regards,
Luke

On Jun 6, 6:58 am, kennyjay <kenneth.jen...@gmail.com> wrote:
> > > > me know if you're still seeing thecachingissues that you reported
Reply all
Reply to author
Forward
0 new messages