[jira] Updated: (AXIS2-2395) AxisMessage.getSchema() returns null when schema element is found in an imported schema

2007-06-11 Thread Deepal Jayasinghe (JIRA)

 [ 
https://issues.apache.org/jira/browse/AXIS2-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Deepal Jayasinghe updated AXIS2-2395:
-

Fix Version/s: 1.3
 Priority: Blocker  (was: Minor)
Affects Version/s: (was: 1.1.1)
   (was: 1.2)
   1.3

> AxisMessage.getSchema() returns null when schema element is found in an 
> imported schema
> ---
>
> Key: AXIS2-2395
> URL: https://issues.apache.org/jira/browse/AXIS2-2395
> Project: Axis 2.0 (Axis2)
>  Issue Type: Bug
>  Components: kernel
>Affects Versions: 1.3
> Environment: All
>Reporter: Jeff Faath
>Assignee: Deepal Jayasinghe
>Priority: Blocker
> Fix For: 1.3
>
>
> When calling getSchema() on an AxisMessage, 'null' is returned when the 
> schema element is found in an imported schema.  This is because the code does 
> not check imported schema.  I've devised a solution below which recursively 
> traverses any imported schema.  The original getSchema() method can be 
> replaced by the two methods below:
> public XmlSchemaElement getSchemaElement() {
>   AxisService service = (AxisService) getParent().getParent();
> ArrayList schemas = service.getSchema();
> for (int i = 0; i < schemas.size(); i++) {
>   XmlSchema schema = (XmlSchema) schemas.get(i);
>   return getSchemaElement(schema);
> }
> return null;
> }
> private XmlSchemaElement getSchemaElement(XmlSchema schema) {
>   XmlSchemaElement returnElement = null;
>   if (schema != null) {
> if (schema.getItems() != null) {
>   Iterator schemaItems = schema.getItems().getIterator();
>   while (schemaItems.hasNext()) {
> Object item = schemaItems.next();
> if (item instanceof XmlSchemaElement) {
>   XmlSchemaElement xmlSchemaElement = (XmlSchemaElement) item;
>   if (xmlSchemaElement.getQName().equals(this.elementQname)) {
> returnElement = xmlSchemaElement;
>   }
> }
>else if (item instanceof org.apache.ws.commons.schema.XmlSchemaImport) 
> {
>  returnElement = 
> getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaImport)item).getSchema());
>}
>else if (item instanceof 
> org.apache.ws.commons.schema.XmlSchemaInclude) {
>  returnElement = 
> getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaInclude)item).getSchema());
>}
>// We've found a matching element, no need to continue...
>if (returnElement != null)
>  break;
>}
>  }
>}
>return returnElement;
>  }

-- 
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]



[jira] Updated: (AXIS2-2395) AxisMessage.getSchema() returns null when schema element is found in an imported schema

2007-06-08 Thread Aaron Gourley (JIRA)

 [ 
https://issues.apache.org/jira/browse/AXIS2-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aaron Gourley updated AXIS2-2395:
-

Affects Version/s: 1.2

> AxisMessage.getSchema() returns null when schema element is found in an 
> imported schema
> ---
>
> Key: AXIS2-2395
> URL: https://issues.apache.org/jira/browse/AXIS2-2395
> Project: Axis 2.0 (Axis2)
>  Issue Type: Bug
>  Components: kernel
>Affects Versions: 1.2, 1.1.1
> Environment: All
>Reporter: Jeff Faath
>Assignee: Deepal Jayasinghe
>Priority: Minor
>
> When calling getSchema() on an AxisMessage, 'null' is returned when the 
> schema element is found in an imported schema.  This is because the code does 
> not check imported schema.  I've devised a solution below which recursively 
> traverses any imported schema.  The original getSchema() method can be 
> replaced by the two methods below:
> public XmlSchemaElement getSchemaElement() {
>   AxisService service = (AxisService) getParent().getParent();
> ArrayList schemas = service.getSchema();
> for (int i = 0; i < schemas.size(); i++) {
>   XmlSchema schema = (XmlSchema) schemas.get(i);
>   return getSchemaElement(schema);
> }
> return null;
> }
> private XmlSchemaElement getSchemaElement(XmlSchema schema) {
>   XmlSchemaElement returnElement = null;
>   if (schema != null) {
> if (schema.getItems() != null) {
>   Iterator schemaItems = schema.getItems().getIterator();
>   while (schemaItems.hasNext()) {
> Object item = schemaItems.next();
> if (item instanceof XmlSchemaElement) {
>   XmlSchemaElement xmlSchemaElement = (XmlSchemaElement) item;
>   if (xmlSchemaElement.getQName().equals(this.elementQname)) {
> returnElement = xmlSchemaElement;
>   }
> }
>else if (item instanceof org.apache.ws.commons.schema.XmlSchemaImport) 
> {
>  returnElement = 
> getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaImport)item).getSchema());
>}
>else if (item instanceof 
> org.apache.ws.commons.schema.XmlSchemaInclude) {
>  returnElement = 
> getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaInclude)item).getSchema());
>}
>// We've found a matching element, no need to continue...
>if (returnElement != null)
>  break;
>}
>  }
>}
>return returnElement;
>  }

-- 
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]



[jira] Updated: (AXIS2-2395) AxisMessage.getSchema() returns null when schema element is found in an imported schema

2007-06-06 Thread Davanum Srinivas (JIRA)

 [ 
https://issues.apache.org/jira/browse/AXIS2-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Davanum Srinivas updated AXIS2-2395:


Assignee: Deepal Jayasinghe

> AxisMessage.getSchema() returns null when schema element is found in an 
> imported schema
> ---
>
> Key: AXIS2-2395
> URL: https://issues.apache.org/jira/browse/AXIS2-2395
> Project: Axis 2.0 (Axis2)
>  Issue Type: Bug
>  Components: kernel
>Affects Versions: 1.1.1
> Environment: All
>Reporter: Jeff Faath
>Assignee: Deepal Jayasinghe
>Priority: Minor
>
> When calling getSchema() on an AxisMessage, 'null' is returned when the 
> schema element is found in an imported schema.  This is because the code does 
> not check imported schema.  I've devised a solution below which recursively 
> traverses any imported schema.  The original getSchema() method can be 
> replaced by the two methods below:
> public XmlSchemaElement getSchemaElement() {
>   AxisService service = (AxisService) getParent().getParent();
> ArrayList schemas = service.getSchema();
> for (int i = 0; i < schemas.size(); i++) {
>   XmlSchema schema = (XmlSchema) schemas.get(i);
>   return getSchemaElement(schema);
> }
> return null;
> }
> private XmlSchemaElement getSchemaElement(XmlSchema schema) {
>   XmlSchemaElement returnElement = null;
>   if (schema != null) {
> if (schema.getItems() != null) {
>   Iterator schemaItems = schema.getItems().getIterator();
>   while (schemaItems.hasNext()) {
> Object item = schemaItems.next();
> if (item instanceof XmlSchemaElement) {
>   XmlSchemaElement xmlSchemaElement = (XmlSchemaElement) item;
>   if (xmlSchemaElement.getQName().equals(this.elementQname)) {
> returnElement = xmlSchemaElement;
>   }
> }
>else if (item instanceof org.apache.ws.commons.schema.XmlSchemaImport) 
> {
>  returnElement = 
> getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaImport)item).getSchema());
>}
>else if (item instanceof 
> org.apache.ws.commons.schema.XmlSchemaInclude) {
>  returnElement = 
> getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaInclude)item).getSchema());
>}
>// We've found a matching element, no need to continue...
>if (returnElement != null)
>  break;
>}
>  }
>}
>return returnElement;
>  }

-- 
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]



[jira] Updated: (AXIS2-2395) AxisMessage.getSchema() returns null when schema element is found in an imported schema

2007-03-26 Thread Jeff Faath (JIRA)

 [ 
https://issues.apache.org/jira/browse/AXIS2-2395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jeff Faath updated AXIS2-2395:
--

Component/s: kernel
Description: 
When calling getSchema() on an AxisMessage, 'null' is returned when the schema 
element is found in an imported schema.  This is because the code does not 
check imported schema.  I've devised a solution below which recursively 
traverses any imported schema.  The original getSchema() method can be replaced 
by the two methods below:

public XmlSchemaElement getSchemaElement() {
  AxisService service = (AxisService) getParent().getParent();
ArrayList schemas = service.getSchema();
for (int i = 0; i < schemas.size(); i++) {
  XmlSchema schema = (XmlSchema) schemas.get(i);
  return getSchemaElement(schema);
}
return null;
}

private XmlSchemaElement getSchemaElement(XmlSchema schema) {
  XmlSchemaElement returnElement = null;
  if (schema != null) {
if (schema.getItems() != null) {
  Iterator schemaItems = schema.getItems().getIterator();
  while (schemaItems.hasNext()) {
Object item = schemaItems.next();
if (item instanceof XmlSchemaElement) {
  XmlSchemaElement xmlSchemaElement = (XmlSchemaElement) item;
  if (xmlSchemaElement.getQName().equals(this.elementQname)) {
returnElement = xmlSchemaElement;
  }
}
   else if (item instanceof org.apache.ws.commons.schema.XmlSchemaImport) {
 returnElement = 
getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaImport)item).getSchema());
   }
   else if (item instanceof org.apache.ws.commons.schema.XmlSchemaInclude) {
 returnElement = 
getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaInclude)item).getSchema());
   }
   // We've found a matching element, no need to continue...
   if (returnElement != null)
 break;
   }
 }
   }
   return returnElement;
 }


  was:
When calling getSchema() on an AxisMessage, 'null' is returned when the schema 
element is found in an imported schema.  This is because the code does not 
check imported schema.  I've devised a solution below which recursively 
traverses any imported schema.  The original getSchema() method can be replaced 
by the two methods below:

public XmlSchemaElement getSchemaElement() {
AxisService service = (AxisService) getParent().getParent();
ArrayList schemas = service.getSchema();
for (int i = 0; i < schemas.size(); i++) {
XmlSchema schema = (XmlSchema) schemas.get(i);
return getSchemaElement(schema);
}
return null;
}

private XmlSchemaElement getSchemaElement(XmlSchema schema) {
XmlSchemaElement returnElement = null;
if (schema != null) {
if (schema.getItems() != null) {
Iterator schemaItems = schema.getItems().getIterator();
while (schemaItems.hasNext()) {
Object item = schemaItems.next();
if (item instanceof XmlSchemaElement) {
XmlSchemaElement xmlSchemaElement = 
(XmlSchemaElement) item;
if 
(xmlSchemaElement.getQName().equals(this.elementQname)) {
returnElement = xmlSchemaElement;
}
}
else if (item instanceof 
org.apache.ws.commons.schema.XmlSchemaImport) {
returnElement = 
getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaImport)item).getSchema());
}
else if (item instanceof 
org.apache.ws.commons.schema.XmlSchemaInclude) {
returnElement = 
getSchemaElement(((org.apache.ws.commons.schema.XmlSchemaInclude)item).getSchema());
}
// We've found a matching element, no need to 
continue...
if (returnElement != null)
break;
}
}
}
return returnElement;
}



> AxisMessage.getSchema() returns null when schema element is found in an 
> imported schema
> ---
>
> Key: AXIS2-2395
> URL: https://issues.apache.org/jira/browse/AXIS2-2395
> Project: Axis 2.0 (Axis2)
>  Issue Type: Bug
>  Components: kernel
>Affects Versions: 1.1.1
> Environment: All
>Reporter: Jeff Faath
>Priority: Minor
>
> When calling getSchema() on an AxisMessage, 'null' is returned when the 
> schema element is found in an imported schema.  This is because the code does 
> not check imported schema.  I've devised a solution below which recursively 
> traverses