[ https://issues.apache.org/jira/browse/TUSCANY-1362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
haleh mahbod updated TUSCANY-1362: ---------------------------------- Fix Version/s: (was: Java-SCA-Next) Cpp-Next this defect belongs to CPP and was under Java-SCA-Next > Incorrect operation of code that checks whether schema is loaded before going > out on the net to retrieve it. > ------------------------------------------------------------------------------------------------------------- > > Key: TUSCANY-1362 > URL: https://issues.apache.org/jira/browse/TUSCANY-1362 > Project: Tuscany > Issue Type: Bug > Components: C++ SDO > Affects Versions: Java-SDO-M2 > Environment: All > Reporter: Simon Laws > Priority: Minor > Fix For: Cpp-Next > > > There is code in SDOSchemeSAX2Parse.cpp that decideds whether to go ahead and > parse the referenced file > SDOSchemaSAX2Parser* ParserErrorSetter::parseIfNot(const void* > location, bool loadImportNamespace, const void* base) > { > xmlChar*const absoluteUri = xmlBuildURI((xmlChar*)location, > (xmlChar*)base); > if (! absoluteUri) > SDO_THROW_EXCEPTION("parseIfNot", SDOFileNotFoundException, > (char*)location); > LocationParserMap::iterator iter = > parsedLocations.find(absoluteUri); > if (parsedLocations.end() == iter) > { > SDOSchemaSAX2Parser*const schemaParser = new > SDOSchemaSAX2Parser(*new SchemaInfo(), this, loadImportNamespace); > try { > if (0 == > schemaParser->parse((char*)absoluteUri)) > *** return parsedLocations[ absoluteUri ] = > schemaParser; > } > catch (SDORuntimeException e) > {} > schemaParser->free(absoluteUri); > return 0; > } > xmlFree(absoluteUri); > return iter->second; > } > Note the line marked ***. This adds the current URL being parse to the > parsedLocations list for future reference. The issue is that, in the case > where no schemaLocation is provided and loadImportNamespace is true, this > will not work if the schema was orginally loaded from the file system, for > example > /mydir/schema1.xsd - parsedLocation = "file:///mydir/schema1.xsd > targetNamespace="http://schemas.xmlsoap.org/wsdl/" > /mydir/schema2.xsd > <xs:import namespace = "http://schemas.xmlsoap.org/wsdl/" /> - doesn't hit > parsedLocation as it not the same URL as was originally used to load schema1 > A solution is to store both the provided location and the target namsepace in > parsedLocation -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]