WS Clients: JAX-WS, JAX-RPC, Axis ignoring fixed attribute in XMLSchema type

S

Sascha Roth

Hi everyone,

I have a WSDL file with the following ComplexType:

<xs:complexType name="TestDataType">
<xs:all>
<xs:element name="elem1" type="xs:string"/>
<xs:element name="elem2" type="xs:string"/>
</xs:all>
<xs:attribute name="package" use="required" type="xs:string"
fixed="java.lang"/>
</xs:complexType>

I'm trying to generate a Web Service Client with NetBeans or Eclipse.
Both WS Clients just ignore the "use" and the "fixed" attribute of the
xs:attribute element. After looking into the generated sourcecode, it
seems that this attribute becomes 1) optional 2) either no default value
(Eclipse WebTools plugin) or it is just not working (NetBeans JAX-WS).

Literally speaking, it should be generating:
<TestDataType package="java.lang"/>

instead it generates:

<TestDataType/>

Can anyone confirm this as a bug?
Any other WS Library that I could use which doesn't ignore the fixed
attributes?

For the attribute I already tried with no type def.:
<xs:attribute name="package" use="required" fixed="java.lang"/>

Thanks for your help.

Best regards

Sascha

P.S.: What I also noticed is that XMLSpy (2008 SE) can't generate a
proper SOAP Message either. But if I just use the Schema "standalone" it
generates a proper XML sample file.
 
S

SergeyT

Have you read what is 'fixed' attribute for in the XML Schema
definitions? Packages are usually defined using namespaces.
 
S

Sascha Roth

Hi again,

I just want to report the solution (or better workaround) to the below
mentioned problem:

javax.xml.ws.Holder<de.h_da.fbi.xsd.TestDataType> testDataType = new
javax.xml.ws.Holder<de.h_da.fbi.xsd.TestDataType>();

testDataType.value = new TestDataType();
testDataType.value.setPackage(testDataType.value.getPackage()); //the
actual workaround - note that you don't have to set the attribute package.

Best,

Sascha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top