Skip to main content

Module spec advertisement XML different in JXSE and JXTA-C

1 reply [Last post]
dbailey_17
Offline
Joined: 2009-05-08
Points: 0

I'm new here so Hello to all

I'm trying out JXTA as I intend to use it in my masters dissertation.. I have tried out the DiscoveryClient and DiscoveryServer in the JXSE tutorials, and they work fine. I then tried to implement a similar service using JXTA-C, taking ideas form the tutorials and whisp.c. I succeeded to some extent but the client is not finding the server's advertisements. I compared the XML of the advertisements and the JXTA-C one looks wrong, it's not even valid. Here are the XML snippets:

In java, using StructuredTextDocument doc = (StructuredTextDocument) mdadv.getDocument(MimeMediaType.XMLUTF8);

<?xml version="1.0" encoding="UTF-8"?></p>
<p>	urn:jxta:uuid-B6AC5ABE458241F9B310EE8383AA75BB2D39C24D603B4059B7A4FEC03D5AB7F306<br />
	JXTASPEC:JXTA-EX1<br />
	sun.com<br />
	<a href="http://www.jxta.org/Ex1" title="http://www.jxta.org/Ex1">http://www.jxta.org/Ex1</a><br />
	Version 1.0</p>
<p>		urn:jxta:uuid-9CCCDF5AD8154D3D87A391210404E59BE4B888209A2241A4A162A10916074A9504<br />
		JxtaUnicast<br />
		Pipe tutorial</p>
<p>

In C, using jxta_MSA_get_xml(msa, &xml);

<?xml version="1.0"?></p>
<p>	urn:jxta:uuid-6F3051538F4D4D93836426332DE68BB83BB3727BE4D74E5BB5E86FE2DF4AAEA806<br />
	JXTASPEC:JXTA-EX1<br />
	sun.com<br />
	<a href="http://www.jxta.org/Ex1" title="http://www.jxta.org/Ex1">http://www.jxta.org/Ex1</a><br />
	Version 1.0</p>
<p>	<?xml version="1.0"?></p>
<p>			urn:jxta:uuid-59616261646162614E50472050325033989DAAB3252745A8BBD686B1128C266A04<br />
			JxtaUnicast<br />
			Pipe tutorial</p>
<p>

The contents seem fine but the XML stucture looks wrong. Any ideas?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dbailey_17
Offline
Joined: 2009-05-08
Points: 0

Hello again, haven't followed this one up as I was busy with other things, but now back on JXTA. basically I'm still having the same issue.. I can't seem to find remote MSA advertisements that I publish. If I publish locally and then get all the local advertisements, I can see it..

I don't think the problem is the XML now.. the peer that is looking for remote ads isn't finding anything at all actually. I'm creating a discovery listener:

dl = jxta_listener_new((Jxta_listener_func) on_found_pipe_ad, NULL, 1, 5);
jxta_listener_start(dl);
status = discovery_service_add_discovery_listener(ds, (Jxta_discovery_listener *)dl);

and then searching:

discovery_service_get_remote_advertisements(ds, NULL, DISC_ADV, "Name", "*", 1, NULL);

I added code to make sure I am connected to an RDV as well but it did not help. I've checked out both the JXTA-C tutorial and tests code and I seem to be following correctly..