by Viper
2. November 2009 11:49
In my earlier post, How to publish google wave robot capabilities,
I talked about capabilities.xml file that each robot publishes to declare what event(s) it can handle. And one
of the nodes in the XML file was profile. The original specification was that robots could provide
their profile information in that node. It looks like that this specification was changed. Now this profile
node is ignored in capabilities.xml. Wave client sends a separate request to /wave/robot/profile url
to your robot. And it expects a JSON response for that request. That JSON response has the following
format and structure.
{
"profileUrl": "http://www.byteblocks.com",
"imageUrl": "http://wave.byteblocks.com/byteblocksavatar.gif",
"name": "StockBlocks",
"javaClass": "com.google.wave.api.ParticipantProfile"
}
Specifying google wave robot profile information
In your .Net implementation of the robot, it is very easy to provide the profile information. You can add
ParticipantProfile attribute to your ASHX handler class. And you are all set to go. You
can see from the following code snippet how easy it is do so.
[WebService(Namespace = "http://byteblocks.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ParticipantProfile(Name = "StockBlocks",
ImageUrl = "https://wave.google.com/a/wavesandbox.com/static/images/profiles/rusty.png",
ProfileUrl = "http://www.byteblocks.com")]
public class Stocky : EventDrivenRobotBase
{.....}
The API will take care of sending the appropriate response to wave client.
Update version
If you want to update existing profile of your robot, then you will need to change version of it as well.
The client caches the profiles of robots. Unless it sees that there is a newer version available, it
will keep using older profile.