You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Simon Laws (JIRA)" <tu...@ws.apache.org> on 2007/06/20 16:00:25 UTC
[jira] Created: (TUSCANY-1362) Incorrect operation of code that
checks whether schema is loaded before going out on the net to retrieve it.
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
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Updated: (TUSCANY-1362) Incorrect operation of code that
checks whether schema is loaded before going out on the net to retrieve it.
Posted by "haleh mahbod (JIRA)" <tu...@ws.apache.org>.
[ 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Issue Comment Edited: (TUSCANY-1362) Incorrect operation of
code that checks whether schema is loaded before going out on the net to
retrieve it.
Posted by "Pete Robbins (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506691 ]
Pete Robbins edited comment on TUSCANY-1362 at 6/20/07 2:57 PM:
----------------------------------------------------------------
I think you need to leave this method asis as it handles <include> as well as <import>
I would look at startInclude (line 572) and put logic in above line 587:
if (import)
{
if (namespace in already imported list)
return;
else
add namespace to imported list;
}
That should do the trick!
<edit> Just looked at the code and I'm not sure why the list of parsed locations is held on the ParserErrorSetter??? It may have been convenient but doesn't seem right to me. Anyho.. a simple "importedNamespaceList" added alongside this would be ok I think. I can't see the need for the complicated hashmap etc that's used for the locations. Keep It Simple!!!
Cheers
was:
I think you need to leave this method asis as it handles <include> as well as <import>
I would look at startInclude (line 572) and put logic in above line 587:
if (import)
{
if (namespace in already imported list)
return;
else
add namespace to imported list;
}
That should do the trick!
> 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
>
> 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
[jira] Commented: (TUSCANY-1362) Incorrect operation of code that
checks whether schema is loaded before going out on the net to retrieve it.
Posted by "Pete Robbins (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-1362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506691 ]
Pete Robbins commented on TUSCANY-1362:
---------------------------------------
I think you need to leave this method asis as it handles <include> as well as <import>
I would look at startInclude (line 572) and put logic in above line 587:
if (import)
{
if (namespace in already imported list)
return;
else
add namespace to imported list;
}
That should do the trick!
> 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
>
> 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org