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

Discussion in 'Java' started by Sascha Roth, Jun 7, 2009.

  1. Sascha Roth

    Sascha Roth Guest

    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.
    Sascha Roth, Jun 7, 2009
    #1
    1. Advertising

  2. Sascha Roth

    SergeyT Guest

    Have you read what is 'fixed' attribute for in the XML Schema
    definitions? Packages are usually defined using namespaces.
    SergeyT, Jun 8, 2009
    #2
    1. Advertising

  3. Sascha Roth

    Sascha Roth Guest

    Re: WS Clients: JAX-WS, JAX-RPC, Axis ignoring fixed attribute inXML Schema type

    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


    Sascha Roth wrote:
    > 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.
    >
    Sascha Roth, Jul 3, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MarathonMan

    JAX-RPC, Apache Axis

    MarathonMan, Apr 9, 2004, in forum: Java
    Replies:
    1
    Views:
    3,440
    Christophe Vanfleteren
    Apr 10, 2004
  2. jmc
    Replies:
    1
    Views:
    590
    Grzegorz Trafny
    Oct 28, 2004
  3. Karl Uppiano

    Migrating JAX-RPC to JAX-WS

    Karl Uppiano, Dec 15, 2006, in forum: Java
    Replies:
    1
    Views:
    532
    Karl Uppiano
    Dec 15, 2006
  4. Karl Uppiano
    Replies:
    3
    Views:
    644
    Karl Uppiano
    Dec 19, 2006
  5. Replies:
    0
    Views:
    722
Loading...

Share This Page