Re: XSD schema support in WSIF - problem not solved.
Aleksander Slominski <[email protected]> Thu, 03 Feb 2005 01:01:53 -0500
| Newsgroups | gmane.comp.apache.webservices.wsif.devel |
|---|---|
| Message-ID | <[email protected]> |
kiran wrote:
>I am using the following code to read the WSDL which have the XSD
>schema type in it. When I print the ExtensibilityEleemnt, it is coming
>as UnknownExtensibilityElement.
>
>
actually after i hecked code now i remmeber how schema support was
implemented in WSIF - it is very very rudemntary and schema parsing is
used only to figure out mappings - code deals with
UnknownExtensibilityElement see org.apache.wsif.schema.Parser for
details and in particular:
/**
* Get all the schemas defined in the Definition object
*/
private static void getTypesSchemas(Definition def, List schemas,
WSDLLocator loc) throws WSIFException {
Types types = def.getTypes();
if (types != null) {
Iterator extEleIt = types.getExtensibilityElements().iterator();
while (extEleIt.hasNext()) {
UnknownExtensibilityElement typesElement =
(UnknownExtensibilityElement) extEleIt.next();
Element schemaEl = typesElement.getElement();
if (QNameUtils.matches(schema2001, schemaEl)
|| QNameUtils.matches(schema2000, schemaEl)
|| QNameUtils.matches(schema1999, schemaEl)) {
Schema sc = new Schema(schemaEl);
schemas.add(sc);
String docBase = def.getDocumentBaseURI();
if (docBase != null && loc != null) {
String[] importsAndIncludes =
sc.getImportsAndIncludes();
for (int i=0; i<importsAndIncludes.length; i++) {
String sl = importsAndIncludes[i];
getImportedSchemas(docBase, sl, loc, schemas);
}
}
}
}
}
Map imports = def.getImports();
....
HTH,
alek
>I changed the xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema".
>But no effect.
>---------------------------------------------------------------------------------------------------------------------------
>def = WSIFUtils.readWSDL(null, wsdlLocation);
>Types types = def.getTypes();
>if(types != null){
> List extensibilityElements = types.getExtensibilityElements();
> if (extensibilityElements != null){
> Iterator extensibilityElementIterator = extensibilityElements.iterator();
> while (extensibilityElementIterator.hasNext()){
> ExtensibilityElement ext =
>(ExtensibilityElement)extensibilityElementIterator.next();
> System.out.println("Extensibility element: " +
>ext.getClass().getName() + "\tQName="
> + ext.getElementType());
> }
> }else
> System.out.println("No Extensibility elements");
>}
>---------------------------------------------------------------------------------------------------------------------------
>
>On Wed, 02 Feb 2005 13:28:07 -0500, Aleksander Slominski
><[email protected]> wrote:
>
>
>>Jeff Greif wrote:
>>
>>
>>
>>>WSIF definitely supports <schema> in the <types> section of the WSDL
>>>document, without any special additions. Probably something else in the
>>>wsdl is causing the UnknownExtensibilityElement problem. Perhaps you can
>>>tell by looking at the wsdls for the WSIF samples, or by providing some more
>>>details to this list.
>>>
>>>
>>>
>>>
>>Kiran,
>>
>>i am a bit suspicious of "http://www.w3.org/1999/XMLSchema"
>>
>>i think it should be "http://www.w3.org/2001/XMLSchema" ...
>>
>>HTH,
>>
>>alek
>>
>>
>>
>>>----- Original Message -----
>>>From: "kiran" <[email protected]>
>>>To: <[email protected]>
>>>Sent: Wednesday, February 02, 2005 5:26 AM
>>>Subject: XSD schema support in WSIF
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Hi All,
>>>>
>>>>Is WSIF support the XSD types?
>>>>I want to read(create also) the following WSDL, also need to read the
>>>>associated XSD types and elements.
>>>>How can I achive this?
>>>>When I try reading tehis, I get UnknownExtensionsibilityElement- Is
>>>>there are ExtensibilityElement avaialbale for XSD schema?
>>>>--------------------------A part of the WSDL-------------
>>>><definitions .....>
>>>><!-- type defs -->
>>>><types>
>>>> <xsd:schema
>>>> targetNamespace="http://wsiftypes.addressbook.service.ejb/"
>>>> xmlns:xsd="http://www.w3.org/1999/XMLSchema">
>>>> <xsd:complexType name="phone">
>>>> <xsd:sequence>
>>>> <xsd:element name="areaCode" type="xsd:int"/>
>>>> <xsd:element name="exchange" type="xsd:string"/>
>>>> <xsd:element name="number" type="xsd:string"/>
>>>> </xsd:sequence>
>>>> </xsd:complexType>
>>>>
>>>> <xsd:complexType name="address">
>>>> <xsd:sequence>
>>>> <xsd:element name="streetNum" type="xsd:int"/>
>>>> <xsd:element name="streetName" type="xsd:string"/>
>>>> <xsd:element name="city" type="xsd:string"/>
>>>> <xsd:element name="state" type="xsd:string"/>
>>>> <xsd:element name="zip" type="xsd:int"/>
>>>> <xsd:element name="phoneNumber" type="typens:phone"/>
>>>> </xsd:sequence>
>>>> </xsd:complexType>
>>>> </xsd:schema>
>>>> </types>
>>>>
>>>> <!-- message declns -->
>>>> <message name="AddEntryWholeNameRequestMessage">
>>>> <part name="name" type="xsd:string"/>
>>>> <part name="address" type="typens:address"/>
>>>> </message>
>>>>
>>>> <message name="AddEntryFirstAndLastNamesRequestMessage">
>>>> <part name="firstName" type="xsd:string"/>
>>>> <part name="lastName" type="xsd:string"/>
>>>> <part name="address" type="typens:address"/>
>>>> </message>
>>>>...
>>>>------------------------------
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>--
>>The best way to predict the future is to invent it - Alan Kay
>>
>>
>>
>>
>
>
>
>
--
The best way to predict the future is to invent it - Alan Kay