0

I'm trying to do a simple DLNA/UPnp app for windows phone 8. All I got now is a "device explorer" app, which it send a XML in broadcast in specific port over Udp and get responses from all DLNA devices.

What I want to do next is to send a request to one of this devices. It must be over Udp (to be UPnp compliant) and the request is an XML too. My problem is that when I send the broadcast message, I use this:

sendEvent = new SocketAsyncEventArgs();
sendEvent.RemoteEndPoint = new IPEndPoint(IPAddress.Parse("239.255.255.250"), 1900);
[...]

But in the request ( as I did understand well ), I must send it to an adress like:

http: //19...:2869/upnphost/udhisapi.dll?event=uuid:9f7f98d8-2e8e-495c-9126-02a9f8d8b253+urn:upnp-org:serviceId:ContentDirectory

that is supose to be listening.

I don't know how to achieve this in Windows phone, as I supose that WebClient goes over TCP. Any Ideas?

Thanks in advance

  • If you want to invoke an action on a device, you need to send a SOAP request over TCP. In general, your terminology is rather confused. Rather than learning about UPnP in sufficient detail to write your own stack, have you considered using an existing UPnP stack instead? – simonc Aug 26 '13 at 08:59

1 Answers1

0

Inferring from your URL line:

http ://19...:2869/upnphost/udhisapi.dll?event=uuid:9f7f98d8-2e8e-495c-9126-02a9f8d8b253+urn:upnp-org:serviceId:ContentDirectory

You're trying to subscribe the eventing of ContentDirectoryService in a Windows Media Server.

I understand the ABS_PATH in SUBSCRIBE ABS_PATH HTTP/1.1 is really confusing in many senerio, for some standard httpClient implementation usually accept URL only and parse into HOST and REL_PATH.

Not familiar with C#, but in this Is there a way to do a PUT with WebClient? there's a way to override WebClient.UploadString Method, so you can write your own method and path.

Community
  • 1
  • 1
yjzhang
  • 4,859
  • 3
  • 19
  • 21