URL encoded value for comma(,) is "%2C" (without double quotes). So I guess
it should Java slptool bug that it is not decoding the URL string before
displaying it.

Regards
-KPRajesh


On Sat, Sep 17, 2011 at 1:39 AM, John Calcote <john.calc...@gmail.com>wrote:

> I wasn't aware of it Jim - looks like you found a bug. Should be pretty
> easy
> to fix, though.
>
> -----Original Message-----
> From: Jim Marshall [mailto:jim.marsh...@wbemsolutions.com]
> Sent: Friday, September 16, 2011 12:42 PM
> To: openslp-users@lists.sourceforge.net
> Subject: [Openslp-users] Attribute values with comma's treated differently
> between Java and C
>
>
>      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&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
> http://p.sf.net/sfu/rim-devcon-copy2
> _______________________________________________
> Openslp-users mailing list
> Openslp-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openslp-users
>
>
>
> ------------------------------------------------------------------------------
> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
> http://p.sf.net/sfu/rim-devcon-copy2
> _______________________________________________
> Openslp-users mailing list
> Openslp-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openslp-users
>
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
Openslp-users mailing list
Openslp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openslp-users

Reply via email to