Hi,
I have a server set with XmlRpc++ on WinXP and it works perfectly, except for one exception. When the client sends a struct inside the xml with one of the fields having an empty value (as in <name>name</name><value><string/><value/>), the server is unable to retrieve the other fields of the struct inside the XmlRpcValue - if I test it with params.hasMember(), it returns false, even though they were on the xml sent. Is this a known bug, is there a way to make this work?
Thanks for answering.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have just solved this same bug by modifying the source-code as follows:
bool XmlRpcValue::fromXml(std::string const& valueXml, int* offset)
...
else if (typeTag == STRUCT_TAG)
result = structFromXml(valueXml, offset);
else if (typeTag == "<string/>") { // tco's hack
_type = TypeString;
_value.asString = new std::string;
result = true;
}
else if (typeTag == VALUE_ETAG) // Watch for empty/blank strings with no <string>tag
{
*offset = afterValueOffset; // back up & try again
result = stringFromXml(valueXml, offset);
}
(I've emailed this to the original author, Chris Morley, not sure if he's planning a new release. I'll leave it to someone who knows their way around open source software to put this bugfix into the CVS repository).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have a server set with XmlRpc++ on WinXP and it works perfectly, except for one exception. When the client sends a struct inside the xml with one of the fields having an empty value (as in <name>name</name><value><string/><value/>), the server is unable to retrieve the other fields of the struct inside the XmlRpcValue - if I test it with params.hasMember(), it returns false, even though they were on the xml sent. Is this a known bug, is there a way to make this work?
Thanks for answering.
I have just solved this same bug by modifying the source-code as follows:
bool XmlRpcValue::fromXml(std::string const& valueXml, int* offset)
...
else if (typeTag == STRUCT_TAG)
result = structFromXml(valueXml, offset);
else if (typeTag == "<string/>") { // tco's hack
_type = TypeString;
_value.asString = new std::string;
result = true;
}
else if (typeTag == VALUE_ETAG) // Watch for empty/blank strings with no <string>tag
{
*offset = afterValueOffset; // back up & try again
result = stringFromXml(valueXml, offset);
}
(I've emailed this to the original author, Chris Morley, not sure if he's planning a new release. I'll leave it to someone who knows their way around open source software to put this bugfix into the CVS repository).