Question

I have found here Upload file via Soap message in detail. But i have another issue if there is large file in Soap then it creates memory issues cause of file loads in memory for sending via Soap message.

I read about MTOM (Message Transmission Optimisation Mechanism). "When you use MTOM/XOP to optimise a SOAP message, the XOP processing serialises it into a MIME Multipart/Related message. The XOP processing extracts the base64Binary data from the SOAP message and packages it as separate binary attachments within the MIME message, in a similar manner to e-mail attachments"

I have found how to use this approach in java here Soap with Attachments and MTOM in Java

Now i have two questions :-

  1. By using MTOM/XOP approach in iOS we can reduce Or solve the issue of memory as explaind above.
  2. In programming How we can use MTOM/XOP approach in iOS.

Any help will be appriciated.Thanks in advance.

No correct solution

OTHER TIPS

I have done same request using the Rest Kit.Rest kit allows to send attachment in MTOM Specification.

First thing you need is to download Restkit.

Following is the code snippet for the MTOM using the RestKit.

abv.h 
    #import "RestKit/RestKit.h"
    RKObjectManager *man;
    RKObjectLoader *loader;   

abc.m

     RKLogConfigureByName("RestKit/Network", RKLogLevelTrace);
    //Start Progress bar
    RKParams * params = [[RKParams alloc] init];
    UIImage *image=[UIImage imageNamed:@"zbar-samples.png"];
    RKObjectManager *man;
    NSData * fileData=UIImageJPEGRepresentation(image,0.7);


    [params setValue:@"1234" forParam:@"encryptedToken"];
    [params setValue:modelObj.docNameTobeSent
            forParam:@"documentName"];
    RKParamsAttachment * attachments = [params setData:fileData forParam:@"file"];
    [attachments setMIMEType:@"image/jpeg"];
    [attachments setFileName:[NSString stringWithFormat:@"%@.jpeg",modelObj.name]];
    self.man = [RKObjectManager objectManagerWithBaseURL:YOUR URL];
    self.loader = [self.man loadObjectsAtResourcePathUsingPOSTRPC:@"upload.form"    objectMapping:nil PostParams:params delegate:self];



     - (void)objectLoader:(RKObjectLoader*)objectLoader didFailWithError:(NSError*)error
    {
    //Handle fail error
    //stop Progress bar
    }

    - (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects
    {
            NSLog(@"%@",@"didLoadObjects");
    }
    - (void)objectLoaderDidFinishLoading:(RKObjectLoader*)objectLoader
    {
        NSLog(@"%@",@"objectLoaderDidFinishLoading");
    //stop Progress bar
    }
    - (void)objectLoaderDidLoadUnexpectedResponse:(RKObjectLoader*)objectLoader
    {
        NSLog(@"%@",@"objectLoaderDidLoadUnexpectedResponse");
    //stop Progress bar
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top