• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Cocoa newb - Bus Error from TCP Server
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Cocoa newb - Bus Error from TCP Server
      • From: Cameron Hayne <email@hidden>
  • Prev by Date: Re: How to do an HTTP POST in Cocoa
  • Next by Date: Re: Cocoa newb - Bus Error from TCP Server
  • Previous by thread: Re: How to do an HTTP POST in Cocoa
  • Next by thread: Re: Cocoa newb - Bus Error from TCP Server
  • Index(es):
    • Date
    • Thread