4thline/cling — Issue #14: SaxParser does not work?
Author: snappyrain
Created: 2011-11-02 07:43:50+00:00
State: open

Hi , Christ
I'm using cling-core-1.0.5 / cling-support-1.0.5/ teleal-common-1.0.13.
My wireless router supports UPNP, and I can get below result from requesting this URL 192.168.1.1:1900/igd.xml:

1
0

urn:schemas-upnp-org:device:InternetGatewayDevice:1

http://192.168.1.1:80
Wireless N Router MW300R
MERCURY
http://www.mercurycom.com.cn
MW300R 3.0
MW300R
3.0
uuid:upnp-InternetGatewayDevice-192168115678900001
123456789001

urn:schemas-upnp-org:service:Layer3Forwarding:1
urn:upnp-org:serviceId:L3Forwarding1
/l3f
/l3f
/l3f.xml

urn:schemas-upnp-org:device:WANDevice:1
WAN Device
MERCURY
http://www.mercurycom.com.cn
WAN Device
WAN Device
1

12345678900001
uuid:upnp-WANDevice-192168115678900001
123456789001

urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1

urn:upnp-org:serviceId:WANCommonInterfaceConfig
/ifc
/ifc
/ifc.xml

urn:schemas-upnp-org:device:WANConnectionDevice:1
WAN Connection Device
MERCURY
http://www.mercurycom.com.cn
WAN Connection Device
WAN Connection Device
1

12345678900001
uuid:upnp-WANConnectionDevice-192168115678900001
123456789001

urn:schemas-upnp-org:service:WANIPConnection:1
urn:upnp-org:serviceId:WANIPConnection
/ipc
/ipc
/ipc.xml

When I debug into the source code, I find the "descriptorXml" in "
public D describe(D undescribedDevice, String descriptorXml) throws DescriptorBindingException, ValidationException "
shows like below [Please notice the spaces]

1
0

urn:schemas-upnp-org:device:InternetGatewayDevice:1
http://192.168.1.1:80
Wireless N Router MW300R
MERCURY
http://www.mercurycom.com.cn
MW300R 3.0
MW300R
3.0
uuid:upnp-InternetGatewayDevice-192168115678900001
123456789001

urn:schemas-upnp-org:service:Layer3Forwarding:1
urn:upnp-org:serviceId:L3Forwarding1
/l3f
/l3f
/l3f.xml

urn:schemas-upnp-org:device:WANDevice:1
WAN Device
MERCURY
http://www.mercurycom.com.cn
WAN Device
WAN Device
1

12345678900001
uuid:upnp-WANDevice-192168115678900001
123456789001

urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1
urn:upnp-org:serviceId:WANCommonInterfaceConfig
/ifc
/ifc
/ifc.xml

urn:schemas-upnp-org:device:WANConnectionDevice:1
WAN Connection Device
MERCURY
http://www.mercurycom.com.cn
WAN Connection Device
WAN Connection Device
1

12345678900001
uuid:upnp-WANConnectionDevice-192168115678900001
123456789001

urn:schemas-upnp-org:service:WANIPConnection:1
urn:upnp-org:serviceId:WANIPConnection
/ipc
/ipc
/ipc.xml

the workbench show these warning and cannot find the router's InternetGatewayDevice:

WARNING - 22:47:51:484 - cling-11 : cling.protocol.RetrieveRemoteDescriptors.describe :
Could not hydrate device or its services from descriptor: (RemoteDevice)
Identity: (RemoteDeviceIdentity)
UDN: uuid:upnp-InternetGatewayDevice-192168115678900001,
Descriptor: http://192.168.1.1:1900/igd.xml,
Root: true

WARNING - 22:52:00:484 - cling-12 :
cling.protocol.RetrieveRemoteDescriptors.describe :
Cause was: org.teleal.cling.binding.xml.DescriptorBindingException: Invalid URLBase: no protocol:

so I cannot get the WANIPConnection to map the port.

christ's reply:
Looks like Cling stumbles on the empty URLBase element, it shouldn't. The spec says it can be empty. Please file a bug report on http://github.com/4thline/cling/

see http://mailinglists.945824.n3.nabble.com/SaxParser-does-not-work-tp3471043p3471051.html