Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOAPEngine dosent convert base class object to XML after 2 levels of inheritance #183

Closed
Vivekananda0099 opened this issue May 23, 2018 · 4 comments
Labels

Comments

@Vivekananda0099
Copy link

Vivekananda0099 commented May 23, 2018

My Class structure is as follows,

@interface ClassA : JSONModel
@property int ProductId;
@end

@interface ClassB : ClassA
@property NSString *ProductName;
@end

@interface ClassC : ClassB
@property NSString *ProductType;
@end

When i try to send an object of classC to web service i am noticing that the SOAPEngine is not converting the variable's of base class i.e. ClassA's to XML.

ClassC *c = [ClassC new];
c.ProductId = 11;
c.ProductName = @"ProductName";
c.ProductType = @"ProductType";
    
[soap setValue:c forKey:@"TrxLine"];
[soap transactionTest:^(NSInteger statusCode, NSDictionary *dict) 
{
    // ...
} failure:^(NSError *error)
{
    // ...
}];

In didBeforeSendingURLRequest, when i inspect the [request HTTPBody] the request XML is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Header />
 <soap:Body>
      <TransactionTest xmlns="http://semnox.com/">
         <TrxLine>
            <ProductType>ProductType</ProductType>
            <ProductName>ProductName</ProductName>
         </TrxLine>
      </TransactionTest>
   </soap:Body>
</soap:Envelope>

Since i have set the c.ProductId = 11; which is actually present in ClassA but SOAPEngine has not converted it to XML.

This works fine if object of ClassA or ClassB is send to web service.

Can anybody tell me why this is happening? and how i can resolve it?

@priore priore added the bug label May 23, 2018
@priore
Copy link
Owner

priore commented May 23, 2018

we have fixed.

thanks for your patience

@priore priore closed this as completed May 23, 2018
@Vivekananda0099
Copy link
Author

Vivekananda0099 commented May 23, 2018 via email

@priore
Copy link
Owner

priore commented May 23, 2018

You can download the last versions from GitHub, or integrate the pod management with Cocoapods.

@Vivekananda0099
Copy link
Author

Vivekananda0099 commented May 24, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants