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

Ajith Harshana Ranabahu resolved WSCOMMONS-143.
-----------------------------------------------

    Resolution: Fixed

This capability is now added with the new change - you can attach a DOM 
attribute node in XMLSchemas metainfo map to achieve this. I will make sure 
that there are documents that explains this in the next release

> adding user defined type to an attribute node
> ---------------------------------------------
>
>                 Key: WSCOMMONS-143
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-143
>             Project: WS-Commons
>          Issue Type: Test
>          Components: XmlSchema
>         Environment: windows xp, java
>            Reporter: Pradeep Patel
>            Priority: Trivial
>
> hi,
>  i am generating an wsdl file dynamically. for that i am creating an xml 
> schema for types. For array data types i want to use SOAP-ENCODIG 
> "http://schemas.xmlsoap.org/soap/encoding/";.
> I want to create schema structure like this:-
> <xsd:complexType name="_SE_S.field_ArrayOfint">
>     <xsd:complexContent >
>         <xsd:restriction base="SOAP-ENC:Array" >
>             <xsd:sequence >
>                 <xsd:element name="item" type="xsd:int" minOccurs="10" 
> maxOccurs="10"/>
>             </xsd:sequence>
>             <xsd:attribute ref="SOAP-ENC:arrayType" 
> wsdl:arrayType="xsd:int[]"/>
>         </xsd:restriction>
>     </xsd:complexContent>
> </xsd:complexType>
> but here i am not able to create new type as "wsdl:arrayType".
> This is the sample code form my applicaton:-
> XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace);
>               
> XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema);
> XmlSchemaComplexContent complexContent = new XmlSchemaComplexContent();
> XmlSchemaComplexContentRestriction complexRestr = new 
> XmlSchemaComplexContentRestriction();
> XmlSchemaSequence sequence = new XmlSchemaSequence();
>                               
> QName schemaTypeName = new QName(schemaTargetNameSpace, name, 
> schema_namespace_prefix);
> XmlSchemaAttribute attrRestr = new XmlSchemaAttribute();
> QName schemaRefName = new QName(SOAP_ENCODING_NAMESPACE, "arrayType", 
> SOAP_ENC_PREFIX);
> attrRestr.setRefName(schemaRefName);
>             
> QName restrBaseTypeName = new QName(SOAP_ENCODING_NAMESPACE, "Array", 
> SOAP_ENC_PREFIX);
> complexRestr.setBaseTypeName(restrBaseTypeName);
> complexRestr.setParticle(sequence);
> complexRestr.getAttributes().add(attrRestr);
>             
> complexContent.setContent(complexRestr);//erstriction added
>             
> complexType.setContentModel(complexContent);//complexContent added
> complexType.setName(name);
> complexType.setMixed(true); // for .NET support
>               
> XmlSchemaElement seqContent = new XmlSchemaElement();
> seqContent.setName("item");
> seqContent.setSchemaTypeName(seqSchemaTypeName);
> seqContent.setMaxOccurs(Long.MAX_VALUE);
> seqContent.setMinOccurs(0);
>             
> sequence.getItems().add(seqContent);
> xmlSchema.getItems().add(complexType);
> xmlSchema.getSchemaTypes().add(schemaTypeName, complexType);
> can you please help me generate the schema?
> also can you please refer any user guides which contains the sample codes and 
> api definitions to create xml schema?

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

Reply via email to