Message body
Hi,
I was doing some testing with SLP (java API 1.0, SLP 1.2.1). I wrote a
fairly simple program which registers a dummy service with one
attribute, this attribute is a comma delineated string.
When I use slptool (or a C program) to register it works as expected:
$ slptool.bat register service:foo:http://192.168.5.113:2268
"(Attribute=one,two,three)"
$ slptool findattrs service:foo:http://192.168.5.113:2268
(Attribute=one,two,three)
Now doing the same thing with the Java API results in the following:
$ slptool findattrs service:foo:http://192.168.5.113:2268
(Atrribute=one\2ctwo\2cthree)
Notice the ',' have been converted to '\2c'. The issue can be duplicated
with the "Register" Java example.
What I believe is happening is that the Java API is calling
ServiceLocationAttribute.escapeString before sending the data over the
wire (RFC 2165 section 17.1.1) but the server is not un-escaping it
and/or the client is also not un-escaping the value. The resulting
registration is not valid for clients that need to examine the attributes.
Is this a known issue? Is there a work-around?
Thank you
C:\test>java -classpath ".;slp.jar;log4j.jar"
com.solers.slp.test.Register service:foo:http://192.168.5.113:2268
one,two,three
Sep 16, 2011 2:34:41 PM com.solers.slp.ServiceLocationEnumerationImpl
transmitDatagram
INFO: Sending: ServiceRequest: Type: service:directory-agent Filter:
Sep 16, 2011 2:34:44 PM com.solers.slp.ServiceLocationEnumerationImpl
transmitDatagram
INFO: Sending: ServiceRequest: Type: service:directory-agent Filter:
Sep 16, 2011 2:34:47 PM com.solers.slp.ServiceLocationEnumerationImpl
transmitDatagram
INFO: Sending: ServiceRequest: Type: service:directory-agent Filter:
Sep 16, 2011 2:34:47 PM com.solers.slp.NetworkManager saMessage
INFO: Sending: ServiceRegistration: URL:
service:foo:http://192.168.5.113:2268 Attributes:
Attribute1=(java.lang.String)one\2ctwo\2cthree
Sep 16, 2011 2:34:47 PM com.solers.slp.NetworkManager saMessage
INFO: Sent registration to slpd.
C:\tests>slptool findattrs service:foo:http://192.168.5.113:2268
(Attribute1=one\2ctwo\2cthree)
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Openslp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openslp-users