Cocoa newb - Bus Error from TCP Server
Cocoa newb - Bus Error from TCP Server
- Subject: Cocoa newb - Bus Error from TCP Server
- From: "Christopher Bland" <email@hidden>
- Date: Sat, 10 Jun 2006 12:53:52 GMT
Hello from a newb Cocoa developer and a newb to ObjC (but not programming). I've been trying to implement a SOAP server using the CocoaSOAP sample code on the Apple Developer site. Everything works fine except when sending 400/Bad Request messages. When this happens I receive a bus error on the server but my data gets passed to the client properly. Has anyone else seen this before?
Here's a snip of code (All variables are defined earlier in the code):
NSString *xml = [NSString stringWithFormat:@"<?xml version=\"1.0\"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"> <SOAP-ENV:Body> ...Stuff here... </SOAP-ENV:Body> </SOAP-ENV:Envelope>"];
error = nil;
doc = [[[NSXMLDocument alloc] initWithXMLString:xml options:NSXMLNodeOptionsNone error:&error] autorelease];
data = [doc XMLData];
CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 400, NULL, kCFHTTPVersion1_1); // Bad Request
CFHTTPMessageSetHeaderFieldValue(response, (CFStringRef)@"Content-Length", (CFStringRef)[NSString stringWithFormat:@"%d", [data length]]);
CFHTTPMessageSetBody(response, (CFDataRef)data);
[mess setResponse:response];
CFRelease(response);
printf("** Sent 400:Bad Request Message **\n");
return;
The server prints out my "** Sent 400:Bad Request" message and then gives the bus error on the return.
Has anyone else seen this or does anyone have any suggestions where to look? I've checked everything on the client, and it looks fine. It appears I'm creating the HTTP response correctly... I can provide more code if necessary.
Thanks for the help and consideration.
________________________________________________________________________
Try Juno Platinum for Free! Then, only $9.95/month!
Unlimited Internet Access with 1GB of Email Storage.
Visit http://www.juno.com/value to sign up today!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden