Okay how about this one....
I'm creating an SOAP request to... a SOAP server... (funny how that works) anyway the SOAP request does what it's set out to do (ask for 'status information' by 'subscribing' to the device).
In fact if I simply telnet to the device (on port 80) and past a properly formated http header/body type message my telnet session will be FILLED with the following... (it just keeps going and going) and that's exactly what it's supposed to do!
So I get my NSURLConnection all setup with all the proper settings -- and set it for async since it's a 'never ending connection' (till I choose to close it down) but instead of it 'never ending here is what I get...
First here is some of my code...
---------------
and now here is my log file...
My big question is why did the connection close after only that very first initial bit of xml?? Especially when a there are bunch of other xml messages that I need to read and act on -- but instead the connect simply closed... I'm almost positive that it's NSURLConnection that's doing the closing cause when I telnet in and past the soap request it wont quit till I kill the telnet process!!
This is basically a keep-alive connection I guess... I send out an properly formatted body that contains a soap request that it understands and it spews back xml data.
Under normal conditions, like when I request a 'device list' I just to a sync connection and send the soap body and back comes a single xml file will all the devices in it... but this is different... it's status update messages that will be never-ending (unless I turn off the device) or close the connection... it needs to be constantly read and sometimes reacted to....
Can anyone help?
Dave
I'm creating an SOAP request to... a SOAP server... (funny how that works) anyway the SOAP request does what it's set out to do (ask for 'status information' by 'subscribing' to the device).
In fact if I simply telnet to the device (on port 80) and past a properly formated http header/body type message my telnet session will be FILLED with the following... (it just keeps going and going) and that's exactly what it's supposed to do!
Code:
HTTP/1.1 200 OK
Content-Length: 215
Connection: Keep-Alive
WWW-Authenticate: Basic realm="/"
Content-Type: application/soap+xml; charset=utf-8
Cache-Control: no-cache
EXT: UCoS, UPnP/1.0, UDI/1.0
Last-Modified: Sat, 26 Jul 2008 15:33:1 GMT
<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Body><SubscriptionResponse><SID>uuid:20</SID><duration>0</duration></SubscriptionResponse></s:Body></s:Envelope>POST reuse HTTP/1.1
HOST:255.255.255.255:65535
CONTENT-TYPE:text/xml
CONTENT-LENGTH:119
Connection: Keep-Alive
<?xml version="1.0"?><Event seqnum="0" sid="uuid:20"><control>_5</control><action>0</action><node/><eventInfo/></Event>POST reuse HTTP/1.1
HOST:255.255.255.255:65535
CONTENT-TYPE:text/xml
CONTENT-LENGTH:121
Connection: Keep-Alive
<?xml version="1.0"?><Event seqnum="1" sid="uuid:20"><control>_0</control><action>120</action><node/><eventInfo/></Event>POST reuse HTTP/1.1
HOST:255.255.255.255:65535
CONTENT-TYPE:text/xml
CONTENT-LENGTH:119
Connection: Keep-Alive
<?xml version="1.0"?><Event seqnum="2" sid="uuid:20"><control>_8</control><action>0</action><node/><eventInfo/></Event>POST reuse HTTP/1.1
HOST:255.255.255.255:65535
CONTENT-TYPE:text/xml
CONTENT-LENGTH:136
Connection: Keep-Alive
So I get my NSURLConnection all setup with all the proper settings -- and set it for async since it's a 'never ending connection' (till I choose to close it down) but instead of it 'never ending here is what I get...
First here is some of my code...
Code:
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
NSLog(@"Yep... I did receive a response!");
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
NSString *sdata = [[NSString alloc] initWithData: data encoding:
NSLog(@"The data is: %@",sdata);
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
NSLog(@"got error %@", [error description]);
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSLog(@"connection closed done!");
}
and now here is my log file...
Code:
7/26/08 3:55:30 PM ISY-26[5943] Yep... I did receive a response!
7/26/08 3:55:30 PM ISY-26[5943] The data is: <?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Body><SubscriptionResponse><SID>uuid:25</SID><duration>0</duration></SubscriptionResponse></s:Body></s:Envelope>
7/26/08 3:55:30 PM ISY-26[5943] connection closed done!
My big question is why did the connection close after only that very first initial bit of xml?? Especially when a there are bunch of other xml messages that I need to read and act on -- but instead the connect simply closed... I'm almost positive that it's NSURLConnection that's doing the closing cause when I telnet in and past the soap request it wont quit till I kill the telnet process!!
This is basically a keep-alive connection I guess... I send out an properly formatted body that contains a soap request that it understands and it spews back xml data.
Under normal conditions, like when I request a 'device list' I just to a sync connection and send the soap body and back comes a single xml file will all the devices in it... but this is different... it's status update messages that will be never-ending (unless I turn off the device) or close the connection... it needs to be constantly read and sometimes reacted to....
Can anyone help?
Dave