Ricardo,
Issue 1: where did the imported file
(http://glite.org/wsdl/services/org.glite.data.catalog) come from? Was this
generated by Java2WSDL or is this a file you defined? What type of file is
it? (I gather that it isn't a schema.) If your WSDL references elements or
types defined in this file, then you definitely need to import the
definitions, but the top level element of this file must be <schema>.
Issue 2:
Somewhere in your schema (or WSDL) you reference the soap-enc:string type
rather than the xsd:string type. Normally Axis should only generate a
soap-enc:string type when using RPC/encoded ("rpc" style"). Make sure that
you've specified that you want to use either "wrapped" style or "document"
style. If Axis generated a soap-enc:string type and you are generating
"wrapped" or "document", then you should log this as a bug.
Issue 3:
Per the WS-I BP, a fault message part (always doc/literal) must reference an
element definition, not a type definition. You must define an element of
type CatalogException:
<xs:element name="CatalogException" type="impl:CatalogException"/>
And your message definition must reference this element rather than the
complex type.
Note that Axis doesn't really support rpc/literal, so you must use
doc/literal to be WS-I compliant. Therefore all of your message parts must
reference element definitions rather than type definitions.
Anne
-----Original Message-----
From: Ricardo Rocha [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 24, 2004 6:08 AM
To: [EMAIL PROTECTED]
Subject: java2wsdl and wsi conformance
Hi all.
I'm using the Java2WSDL tool to generate my WSDL from Java Interfaces.
On these interfaces i have my own complex objects defined (beans), and
i'm throwing exceptions.
I'm now trying to get it to be WSI conformant, but still have some
issues. Started trying with the Java2WSDL utility coming with Axis 1.1,
move to the 1.2beta, and right now i'm using a nightly build from
yesterday (23rd august). Good progress on the way (especially with array
definition inside the xml schema) :)
So current issues (i'm giving you all the failure messages given by the
wsi-test-tools toolkit):
* first issue: imports inside schema definition
Assertion: WSI2102
Result: failed
Failure Message: An XML schema import element references something other
than an XML schema definition: the referenced element does not have
"schema" from XML namespace "http://www.w3.org/2001/XMLSchema" as root
element.
Failure Detail Message
http://glite.org/wsdl/services/org.glite.data.catalog
Element Location:
lineNumber=5
This is triggered by this:
<schema
targetNamespace="http://glite.org/wsdl/services/org.glite.data.catalog.servi
ce.meta"
xmlns="http://www.w3.org/2001/XMLSchema">
<import
namespace="http://glite.org/wsdl/services/org.glite.data.catalog"/>
It passes this test fine if i comment out this part, and i guess it
would even work.
* second issue: something with string
Assertion: WSI2417
Result: failed
Failure Message: A QName reference that is referring to a schema
component, uses a namespace not defined in the targetNamespace attribute
on the xs:schema element, or in the namespace attribute on an xs:import
element within the xs:schema element.
Failure Detail Message
{http://schemas.xmlsoap.org/soap/encoding/}string
Element Location:
lineNumber=2
I'm pretty much lost here... Don't have a clue why this comes up!
* third issue: Soap Binding Fault
Assertion: WSI2113
Result: failed
Failure Message: The soapbind:header, soapbind:headerfault or
soapbind:fault elements refer to wsd:part element(s) that are not
defined using only the "element" attribute.
Failure Detail Message
{http://glite.org/wsdl/services/org.glite.data.catalog.service.meta}Attribut
eMetadataCatalogSoapBinding:fault
Element Location:
lineNumber=276
I'm not sure also why this fails... The way it goes in the WSDL is the
following:
- a complexType is defined for the exception (currently the Java
Exception has nothing inside, so this type is empty also). Some
exceptions extend the base exception.
<complexType name="CatalogException">
<sequence/>
</complexType>
<complexType name="AuthorizationException">
<complexContent>
<extension base="tns1:CatalogException">
<sequence/>
</extension>
</complexContent>
</complexType>
- each operation has a wsdl:fault throwing an exception:
<wsdl:operation name="remove" parameterOrder="entryid">
<wsdl:input message="impl:removeRequest" name="removeRequest"/>
<wsdl:output message="impl:removeResponse" name="removeResponse"/>
<wsdl:fault message="impl:CatalogException"
name="CatalogException"/>
</wsdl:operation>
- and in the binding:
<wsdl:fault name="CatalogException">
<wsdlsoap:fault name="CatalogException" use="literal"/>
</wsdl:fault>
I guess i can have a complexType as a fault, so i don't understand this
"only the element attribute" error.
I hope i can get some help in here... By the way, if anyone is
interested i have written an ant task that uses the wsi-test-tools stuff
to validate the wsdl that is generated. It also gives some nice html
reports. I guess it could be interesting to make this WSI conformance
test part of the Java2WSDL generation.
Thanks in advance,
Ricardo Rocha