Jim
 
We tend to use jSLP, it performs much better than the OpenSLP java API which
hasn't really been maintained. 
 
Matt
 

   _____  

From: rajesh K P [mailto:[email protected]] 
Sent: 19 September 2011 08:24
To: John Calcote
Cc: [email protected]
Subject: Re: [Openslp-users] Attribute values with comma's treated
differently between Java and C


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 <[email protected]
<mailto:[email protected]> > 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:[email protected]
<mailto:[email protected]> ]
Sent: Friday, September 16, 2011 12:42 PM
To: [email protected]
<mailto:[email protected]> 
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
<http://192.168.5.113:2268> 
"(Attribute=one,two,three)"
$ slptool findattrs service:foo:http://192.168.5.113:2268
<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
<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
<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 <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
<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 <http://p.sf.net/sfu/rim-devcon-copy2> 
_______________________________________________
Openslp-users mailing list
[email protected]
<mailto:[email protected]> 
https://lists.sourceforge.net/lists/listinfo/openslp-users
<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 <http://p.sf.net/sfu/rim-devcon-copy2> 
_______________________________________________
Openslp-users mailing list
[email protected]
<mailto:[email protected]> 
https://lists.sourceforge.net/lists/listinfo/openslp-users
<https://lists.sourceforge.net/lists/listinfo/openslp-users> 




This email, including any attachment, is a confidential communication
intended solely for the use of the individual or entity to whom it is
addressed. It contains information which is private and may be proprietary
or covered by legal professional privilege. If you have received this email
in error, please notify the sender upon receipt, and immediately delete it
from your system.

Anything contained in this email that is not connected with the businesses
of this company is neither endorsed by nor is the liability of this company.

Whilst we have taken reasonable precautions to ensure that any attachment to
this email has been swept for viruses, we cannot accept liability for any
damage sustained as a result of software viruses, and would advise that you
carry out your own virus checks before opening any attachment.

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/openslp-users

Reply via email to