Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6677241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:05:37+00:00 2026-05-26T04:05:37+00:00

It will be probably a simple problem, but I have been staring on this

  • 0

It will be probably a simple problem, but I have been staring on this for a while now and I can’t find it!

I have a SOAPRequest class like following:

@interface SoapRequest : NSObject

@property (retain, nonatomic) NSURL *endPoint;
@property (retain, nonatomic) NSString *soapAction;
@property (retain, nonatomic) NSString *userName;
@property (retain, nonatomic) NSString *passWord;
@property (retain, nonatomic) NSString *postData;
@property (retain, nonatomic) NSObject *handler;
@property SEL action;

+ (SoapRequest*) create: (NSObject*) target endPoint: (NSString*) endPoint action: (SEL) action soapAction: (NSString*) soapAction postData: (NSString*) postData;

- (id)sendSynchronous;
- (void) send;

@end

Implementation like following:

@synthesize endPoint = _endPoint, soapAction = _soapAction, userName = _userName, passWord = _passWord, postData = _postData, action = _action, handler = _handler;

+ (SoapRequest*) create: (NSObject*) target endPoint: (NSString*) endPoint action: (SEL) action soapAction: (NSString*) soapAction postData: (NSString*) postData
{
    SoapRequest *request = [[SoapRequest alloc] init];
    request.endPoint = [NSURL URLWithString:endPoint];
    request.soapAction = soapAction;
    request.handler = target;
    request.action = action;
    request.postData = postData;

    return [request autorelease];
}

And my send function:

- (void) send
{
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:self.endPoint];
    [request setDelegate:self];

    [request addRequestHeader:@"Content-Length" value: [NSString stringWithFormat:@"%d",[self.postData length]]];
    [request addRequestHeader:@"Content-Type" value:@"text/xml"];

    if(self.soapAction)
    {
        [request addRequestHeader:@"soapAction" value:self.soapAction];
    }

    [request appendPostData:[self.postData dataUsingEncoding:NSUTF8StringEncoding]];
    [request startAsynchronous];
}

I do have the default ASIHTTPRequest methods to listen for error or finish, my finish looks as following:

- (void)requestFinished:(ASIHTTPRequest *)request
{
    [self.handler performSelector:self.action];
}

The case is, it crashes when I want to make this class a delegate for the ASIHTTPRequest, [request setDelegate:self]. I figured it has something to do with the Autoreleasing in the first function. But I don’t have any idea how to fix it!

Edit:

This is how I init my SoapRequest:

- (SoapRequest*) DefinedEntities: (id) _target action: (SEL) _action
{

// some data inits

    SoapRequest *request = [SoapRequest create: _target endPoint:endPoint action:_action soapAction:soapAction postData:xmlString];
    [request send];

    return request;
}

And this i init as following:

Metadata *service = [[Metadata alloc] init];
[service DefinedEntities:self action:@selector(MetadataFinished:)];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:05:38+00:00Added an answer on May 26, 2026 at 4:05 am

    Retaining was indeed a good option, I found some typo’s in my code and figured out what i did wrong already.

    I had to do with the class in-between:

    - (SoapRequest*) DefinedEntities: (id) _target action: (SEL) _action
    {
    
    // some data inits
    
        SoapRequest *request = [SoapRequest create: _target endPoint:endPoint action:_action soapAction:soapAction postData:xmlString];
        [request send];
    
        return request;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This will probably be obvious but I can't find the best way. I want
This is probably a really simple problem, but I can't figure out how to
This is probably a really basic problem but I can't seem to find any
This is probably quite simple but I haven't yet been able to wrap my
This problem is probably very simple to solve but it is not clear to
I'm aware this is probably a very simple problem with a 1-line-of-code answer but
This will probably be a bot of a waffly question but ill try my
I'm looking at a new computer which will probably have vista on it. But
This is confusing me, so this question will probably be confusing. I have a
This is a big-picture question... but I also have details on the problem I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.