You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org> on 2007/08/29 12:57:30 UTC
[jira] Commented: (AXIS2-2594) Using
attributeFormDefault="qualified" in a schema causes null attribute values
in Java objects
[ https://issues.apache.org/jira/browse/AXIS2-2594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523534 ]
Amila Chinthaka Suriarachchi commented on AXIS2-2594:
-----------------------------------------------------
can you try to code gen with a nightly build and see. I did an improvement to the xmlbeans serialization.
> Using attributeFormDefault="qualified" in a schema causes null attribute values in Java objects
> -----------------------------------------------------------------------------------------------
>
> Key: AXIS2-2594
> URL: https://issues.apache.org/jira/browse/AXIS2-2594
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.1.1
> Environment: Windows XP
> Java 1.6.0
> XMLBeans data binding
> Reporter: Paul Chisholm
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
>
> When the schema that appears in the wsdl:types section of a WSDL file specifies attributeFormDefault="qualified" then the the getter corresponding to an attribute returns null even though an attribute value is specified in the XML.
> Example:
> Schema is
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> attributeFormDefault="qualified"
> elementFormDefault="qualified"
> targetNamespace="http://quickstart.samples/xsd">
> <xs:element name="attribute">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="value" nillable="true" type="xs:string" />
> </xs:sequence>
> <xs:attribute name="status" type="xs:string" />
> </xs:complexType>
> </xs:element>
> <xs:element name="attributeResponse">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="value" nillable="true" type="xs:string" />
> </xs:sequence>
> <xs:attribute name="status" type="xs:string" />
> </xs:complexType>
> </xs:element>
> </xs:schema>
> Message/port definition is
> <wsdl:message name="attributeMessage">
> <wsdl:part name="part1" element="ns:attribute"/>
> </wsdl:message>
> <wsdl:message name="attributeResponseMessage">
> <wsdl:part name="part1" element="ns:attributeResponse"/>
> </wsdl:message>
> <wsdl:portType name="MyServicePortType">
> <wsdl:operation name="attribute">
> <wsdl:input message="axis2:attributeMessage"/>
> <wsdl:output message="axis2:attributeResponseMessage"/>
> </wsdl:operation>
> </wsdl:portType>
> Client code is
> public static void attribute(MyServiceStub stub){
> try{
> AttributeDocument reqDoc = AttributeDocument.Factory.newInstance();
> AttributeDocument.Attribute req = reqDoc.addNewAttribute();
> req.setStatus("OK");
> req.setValue("Testing");
> AttributeResponseDocument res = stub.attribute(reqDoc);
> System.err.println("Status="+res.getAttributeResponse().getStatus());
> System.err.println("Value="+res.getAttributeResponse().getValue());
> } catch(Exception e){
> e.printStackTrace();
> System.err.println("\n\n\n");
> }
> }
> Service code is
> public AttributeResponseDocument attribute(AttributeDocument param1) {
> String status = param1.getAttribute().getStatus();
> String value = param1.getAttribute().getValue();
> System.err.println();
> System.err.println("Status="+status);
> System.err.println("Value="+value);
> AttributeResponseDocument resDoc =
> AttributeResponseDocument.Factory.newInstance();
> AttributeResponseDocument.AttributeResponse res =
> resDoc.addNewAttributeResponse();
> res.setStatus(status);
> res.setValue(value);
> return resDoc;
> }
> When the client is run tracing of the element values displays as expected, but tracing of the attributes always shows null.
> If the schema is changed to attributeFormDefault="unqualified" the attribute values are displayed successfully.
--
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org