login about faq

I updated to today and have a strange regression. I've been using CkoXml to parse the errorXml property that comes out of the other Chilkat methods. This is my code:

CkoXml *foundXML = nil;
NSMutableString *errorString = [NSMutableString stringWithCapacity:10];
int raceLimiter = 1;
do {
    foundXML = [coreErrorXML SearchForTag:foundXML tag:@"error"];
        if (foundXML) {
            [errorString appendFormat:@"%@\n", foundXML.Content];
raceLimiter ++;
} while (foundXML && raceLimiter < 1000);

Under 9.3.1 (what I was using), I would get something like:

Failed. Failed to receive data on the TCP socket Failed to get initial SMTP response.. Failed to receive data on the TCP socket Failed to get initial SMTP response again.

Under, I am getting an empty string. Putting a logging line in, it appears that if(foundXML) is never true. The XML coming out of the method (in this case, the smtp method) looks similar so I don't think it's bad input.


asked Aug 21 '13 at 18:44

mark's gravatar image


Thanks. I understand the problem and I'll explain a workaround. However, first things first...

1) The error message that contains information about TCP sockets and SMTP must not have come from the XML object. I suspect you're mistakenly looking at the contents of the LastErrorText on a different object instance -- which would certainly be the MailMan object if it involves SMTP. The XML object has nothing to do with TCP sockets or SMTP...

2) Whenever a Chilkat object is passed as an argument, it should never be nil. The only exception to this case is with the XML Search* methods. The latest version (v9.4.1 at the time of this writing) does a check to see if the input argument is nil, and if so, then immediately fails (returns a failed status, or nil, etc.) without actually calling the underlying method. Because the outermost Objective-C layer is generated, this check happens cases where the argument is a pointer to a Chilkat object (to prevent a crash). However, the XML Search methods shouldn't have followed this behavior, and this is what needs to be fixed in Chilkat v9.4.1.

In any XML Search* method, the first argument indicates the node that is the root of the subtree to be searched. If nil is passed, the behavior is to search the entire XML document from the topmost root. As a workaround, instead of passing nil, one can pass [xml GetRoot] because the GetRoot method returns the root node of the XML document. Therefore, do this to get around the problem:

foundXML = [coreErrorXML SearchForTag:[coreErrorXML GetRoot] tag:@"error"];

answered Aug 22 '13 at 14:19

chilkat's gravatar image

chilkat ♦♦

Sadly, this did not fix the problem. I'm going to poke around on it some more, but I did as suggested and I'm still not getting results.

(Sep 05 '13 at 19:32) mark

Thanks. I'll test your workaround and report back.

Just to clarify, the output was from the mailman object. It had an (expected - I was running tests) error and I was parsing it for the 'human readable' version of the lasterrorxml (just the 'error' tags). I don't want to dump all of the error text, just some indication of what went wrong.


answered Aug 22 '13 at 15:28

mark's gravatar image


Thanks Mark! That explains it. Sorry I was confused..

(Aug 22 '13 at 15:31) chilkat ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Aug 21 '13 at 18:44

Seen: 1,174 times

Last updated: Sep 05 '13 at 19:32

powered by OSQA