XmlSchemaElement elements in schema obtained from ServiceClient have incorrect
(null) SchemaType
------------------------------------------------------------------------------------------------
Key: AXIS2-4013
URL: https://issues.apache.org/jira/browse/AXIS2-4013
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Affects Versions: 1.4
Environment: OS: Windows XP
IDE: IBM Rational Application Developer 7.0.0.6
Java: 1.5
Server: Websphere App Server 6.1.17
Reporter: Darin DeFer
I am trying to prototype stubless WS invokation. The WSDLs in our web services
contain multiple namespaces. The schema produced by ServiceClient contains a
null SchemaType for XmlSchemaElements for all but one NameSpace. It appears
that the multiple namespaces prevent the schema generator from properly
identifying all complex types. We can't use Axis2 to generate dynamic payloads
if we can't drill down all the simpleTypes. I cannot find a workaround for
this - seems there's no way to get the details for the impacted elements.
The following is logged when attempting to traverse schema all the way down to
simple schema elements.
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O ServiceClient has been
created.
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O We have our operation:
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Operation URI:
http://cc.stmt.v003.adapter.osa.common.bac
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Operation Local Part:
retrieveTransactionHistory
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Message direction: in
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Message part name: parameters
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Message element QName:
{http://cc.stmt.v003.adapter.osa.common.bac}retrieveTransactionHistory
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Our target input message is:
{http://cc.stmt.v003.adapter.osa.common.bac}retrieveTransactionHistory
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Message direction: out
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Message part name: parameters
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Message element QName:
{http://cc.stmt.v003.adapter.osa.common.bac}retrieveTransactionHistoryResponse
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Our target ouput message is:
{http://cc.stmt.v003.adapter.osa.common.bac}retrieveTransactionHistoryResponse
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Class Name:
org.apache.ws.commons.schema.XmlSchemaElement
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Name:
retrieveTransactionHistory
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element SourceURI: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Schema Type: [EMAIL
PROTECTED]
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Schema Type Name:
null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Type: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element QName:
{http://cc.stmt.v003.adapter.osa.common.bac}retrieveTransactionHistory
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element RefName: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Input Element is a complex
type.
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Class Name:
org.apache.ws.commons.schema.XmlSchemaElement
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Name: inData
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element SourceURI: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Schema Type: [EMAIL
PROTECTED]
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Schema Type Name:
{http://cc.stmt.v003.adapter.osa.common.bac}RetrieveTransactionHistoryIn
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Type: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element QName: inData
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element RefName: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Input Element is a complex
type.
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Class Name:
org.apache.ws.commons.schema.XmlSchemaElement
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Name:
arrangementIdentifier
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element SourceURI: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Schema Type: null
<===This is incorrect - the ProductArrangementIdentifier is a complexType
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Schema Type Name:
{http://v001.cbl.osa.common.bac}ProductArrangementIdentifier
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element Type: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element QName:
arrangementIdentifier
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Element RefName: null
[9/5/08 12:47:51:201 CDT] 00000022 SystemOut O Input Element is a foreign
complex type. Dig deeper
The code that is generating the logging statement above:
private void traverseStructure(XmlSchemaElement inputElement, ArrayList
schemas, AxisService service ) {
System.out.println("\n");
System.out.println("Class Name: " +
inputElement.getClass().getName() );
System.out.println("Element Name: " + inputElement.getName());
System.out.println("Element SourceURI: " +
inputElement.getSourceURI());
System.out.println("Element Schema Type: " +
inputElement.getSchemaType() );
System.out.println("Element Schema Type Name: " +
inputElement.getSchemaTypeName() );
System.out.println("Element Type: " +
inputElement.getElementType() );
System.out.println("Element QName: " + inputElement.getQName()
);
System.out.println("Element RefName: " +
inputElement.getRefName() );
if (inputElement.getSchemaType() instanceof
XmlSchemaComplexType)
{ // Complex type in parent
object's schema
System.out.println("Input Element is a complex type.");
XmlSchemaComplexType schemaComplexType =
(XmlSchemaComplexType) inputElement.getSchemaType();
XmlSchemaSequence schemaSequence = (XmlSchemaSequence)
schemaComplexType.getParticle();
XmlSchemaObjectCollection items =
schemaSequence.getItems();
for (int j = 0; j < items.getCount(); j++) {
XmlSchemaElement element = (XmlSchemaElement)
items.getItem(j);
traverseStructure(element, schemas, service);
}
}
else if (inputElement.getSchemaType() == null)
{ // Complex type in a different
schema
System.out.println("Input Element is a foreign complex
type. Dig deeper" );
}
else {
// Simple type
System.out.println("Input Element is a simple type. -
translate format and add input element" );
}
--
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]