Parsing a WSDL with embedded xsdhttps://www.eclipse.org/forums/index.php/mv/msg/10369/31929/#msg_31929
taking is to take the xsd part and parse it as a seperate blob using
Eclipse XSD. This approach works for simple cases, but with the WSDL
below, where the targetNamespace of the file has a prefix called typens,
there is a complication parsing the xsd since it cannot resolve the
typens: prefix for the complex types. In fact I also have a problem with
the wsdl:arrayType but I'm not sure if that can be overcome.

Is there a way that I can set the targetNamespace of the document such
that I can overcome this problem.

I've been thinking about providing a convenience resource implementation for
handling WSDL. Attached are XSDWSDLResourceFactoryImpl and
XSDWSDLResourceImpl. If you register this factory against the "wsdl"
extension, it will create a resource that has all the WSDL contained schemas
in the getContents list. I've only test this a little bit...

Hayden Marchant wrote:

> I have a WSDL file that contains embedded XSD. The approach that I've been
> taking is to take the xsd part and parse it as a seperate blob using
> Eclipse XSD. This approach works for simple cases, but with the WSDL
> below, where the targetNamespace of the file has a prefix called typens,
> there is a complication parsing the xsd since it cannot resolve the
> typens: prefix for the complex types. In fact I also have a problem with
> the wsdl:arrayType but I'm not sure if that can be overcome.
>
> Is there a way that I can set the targetNamespace of the document such
> that I can overcome this problem.
>
> <wsdl:definitions xmlns:typens="http://soap.amazon.com"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> targetNamespace="http://soap.amazon.com" name="AmazonSearch">
> <wsdl:types>
> <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://soap.amazon.com">
> <xsd:complexType name="ProductLineArray">
> <xsd:complexContent>
> <xsd:restriction base="soapenc:Array">
> <xsd:attribute ref="soapenc:arrayType"
> wsdl:arrayType="typens:ProductLine[]" />
> </xsd:restriction>
> </xsd:complexContent>
> </xsd:complexType>
> <xsd:complexType name="ProductLine">
> <xsd:all>
> <xsd:element name="Mode" type="xsd:string" minOccurs="0" />
> <xsd:element name="ProductInfo" type="typens:ProductInfo" minOccurs="0"
> />
> </xsd:all>
> .......................

I've been thinking about providing a convenience resource implementation for
handling WSDL. Attached are XSDWSDLResourceFactoryImpl and
XSDWSDLResourceImpl. If you register this factory against the "wsdl"
extension, it will create a resource that has all the WSDL contained schemas
in the getContents list. I've only test this a little bit...

Hayden Marchant wrote:

> I have a WSDL file that contains embedded XSD. The approach that I've been
> taking is to take the xsd part and parse it as a seperate blob using
> Eclipse XSD. This approach works for simple cases, but with the WSDL
> below, where the targetNamespace of the file has a prefix called typens,
> there is a complication parsing the xsd since it cannot resolve the
> typens: prefix for the complex types. In fact I also have a problem with
> the wsdl:arrayType but I'm not sure if that can be overcome.
>
> Is there a way that I can set the targetNamespace of the document such
> that I can overcome this problem.
>
> <wsdl:definitions xmlns:typens="http://soap.amazon.com"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns="http://schemas.xmlsoap.org/wsdl/"
> targetNamespace="http://soap.amazon.com" name="AmazonSearch">
> <wsdl:types>
> <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://soap.amazon.com">
> <xsd:complexType name="ProductLineArray">
> <xsd:complexContent>
> <xsd:restriction base="soapenc:Array">
> <xsd:attribute ref="soapenc:arrayType"
> wsdl:arrayType="typens:ProductLine[]" />
> </xsd:restriction>
> </xsd:complexContent>
> </xsd:complexType>
> <xsd:complexType name="ProductLine">
> <xsd:all>
> <xsd:element name="Mode" type="xsd:string" minOccurs="0" />
> <xsd:element name="ProductInfo" type="typens:ProductInfo" minOccurs="0"
> />
> </xsd:all>
> .......................

--------------5BE33EF585AFEC61B91DDA83--]]>2003-10-21T19:09:47-00:00Re: Parsing a WSDL with embedded xsdhttps://www.eclipse.org/forums/index.php/mv/msg/10369/32777/#msg_32777
Thanks for this utility - nice to know how resource factories can be used.
This doesn't really solve our problem since there are lines in the xsd,
like:

<xsd:restriction base="soapenc:Array">

Now, we don't have any explicit import statement for that namespace. All
there is, is the XML Namespace declaration at the head of the WSDL. I
could hack in, and simulate an import statement in the xsd body and then
parse but I was wondering if there was a nicer way.

Thanks

Ed Merks wrote:

> Hayden,

> I've been thinking about providing a convenience resource implementation for
> handling WSDL. Attached are XSDWSDLResourceFactoryImpl and
> XSDWSDLResourceImpl. If you register this factory against the "wsdl"
> extension, it will create a resource that has all the WSDL contained schemas
> in the getContents list. I've only test this a little bit...

> Hayden Marchant wrote:

> > I have a WSDL file that contains embedded XSD. The approach that I've been
> > taking is to take the xsd part and parse it as a seperate blob using
> > Eclipse XSD. This approach works for simple cases, but with the WSDL
> > below, where the targetNamespace of the file has a prefix called typens,
> > there is a complication parsing the xsd since it cannot resolve the
> > typens: prefix for the complex types. In fact I also have a problem with
> > the wsdl:arrayType but I'm not sure if that can be overcome.
> >
> > Is there a way that I can set the targetNamespace of the document such
> > that I can overcome this problem.
> >
> > <wsdl:definitions xmlns:typens="http://soap.amazon.com"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > xmlns="http://schemas.xmlsoap.org/wsdl/"
> > targetNamespace="http://soap.amazon.com" name="AmazonSearch">
> > <wsdl:types>
> > <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > targetNamespace="http://soap.amazon.com">
> > <xsd:complexType name="ProductLineArray">
> > <xsd:complexContent>
> > <xsd:restriction base="soapenc:Array">
> > <xsd:attribute ref="soapenc:arrayType"
> > wsdl:arrayType="typens:ProductLine[]" />
> > </xsd:restriction>
> > </xsd:complexContent>
> > </xsd:complexType>
> > <xsd:complexType name="ProductLine">
> > <xsd:all>
> > <xsd:element name="Mode" type="xsd:string" minOccurs="0" />
> > <xsd:element name="ProductInfo" type="typens:ProductInfo" minOccurs="0"
> > />
> > </xsd:all>
> > .......................]]>Hayden Marchant2003-11-09T17:44:07-00:00Re: Parsing a WSDL with embedded xsdhttps://www.eclipse.org/forums/index.php/mv/msg/10369/580550/#msg_580550
Thanks for this utility - nice to know how resource factories can be used.
This doesn't really solve our problem since there are lines in the xsd,
like:

<xsd:restriction base="soapenc:Array">

Now, we don't have any explicit import statement for that namespace. All
there is, is the XML Namespace declaration at the head of the WSDL. I
could hack in, and simulate an import statement in the xsd body and then
parse but I was wondering if there was a nicer way.

Thanks

Ed Merks wrote:

> Hayden,

> I've been thinking about providing a convenience resource implementation for
> handling WSDL. Attached are XSDWSDLResourceFactoryImpl and
> XSDWSDLResourceImpl. If you register this factory against the "wsdl"
> extension, it will create a resource that has all the WSDL contained schemas
> in the getContents list. I've only test this a little bit...

> Hayden Marchant wrote:

> > I have a WSDL file that contains embedded XSD. The approach that I've been
> > taking is to take the xsd part and parse it as a seperate blob using
> > Eclipse XSD. This approach works for simple cases, but with the WSDL
> > below, where the targetNamespace of the file has a prefix called typens,
> > there is a complication parsing the xsd since it cannot resolve the
> > typens: prefix for the complex types. In fact I also have a problem with
> > the wsdl:arrayType but I'm not sure if that can be overcome.
> >
> > Is there a way that I can set the targetNamespace of the document such
> > that I can overcome this problem.
> >
> > <wsdl:definitions xmlns:typens="http://soap.amazon.com"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > xmlns="http://schemas.xmlsoap.org/wsdl/"
> > targetNamespace="http://soap.amazon.com" name="AmazonSearch">
> > <wsdl:types>
> > <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > targetNamespace="http://soap.amazon.com">
> > <xsd:complexType name="ProductLineArray">
> > <xsd:complexContent>
> > <xsd:restriction base="soapenc:Array">
> > <xsd:attribute ref="soapenc:arrayType"
> > wsdl:arrayType="typens:ProductLine[]" />
> > </xsd:restriction>
> > </xsd:complexContent>
> > </xsd:complexType>
> > <xsd:complexType name="ProductLine">
> > <xsd:all>
> > <xsd:element name="Mode" type="xsd:string" minOccurs="0" />
> > <xsd:element name="ProductInfo" type="typens:ProductInfo" minOccurs="0"
> > />
> > </xsd:all>
> > .......................]]>Hayden Marchant2003-11-09T17:44:07-00:00Re: Parsing a WSDL with embedded xsdhttps://www.eclipse.org/forums/index.php/mv/msg/10369/32868/#msg_32868
Originally posted by: merks.ca.ibm.com

Hayden,

Soap encoding arrays are bit of a hack. It's most certainly invalid to reference
a name in a namespace that isn't explicitly imported, so to make a valid model,
you'll have to do something. You could build the model first, and then use the
model to add the import...

Hayden Marchant wrote:

> Ed,
>
> Thanks for this utility - nice to know how resource factories can be used.
> This doesn't really solve our problem since there are lines in the xsd,
> like:
>
> <xsd:restriction base="soapenc:Array">
>
> Now, we don't have any explicit import statement for that namespace. All
> there is, is the XML Namespace declaration at the head of the WSDL. I
> could hack in, and simulate an import statement in the xsd body and then
> parse but I was wondering if there was a nicer way.
>
> Thanks
>
> Ed Merks wrote:
>
> > Hayden,
>
> > I've been thinking about providing a convenience resource implementation for
> > handling WSDL. Attached are XSDWSDLResourceFactoryImpl and
> > XSDWSDLResourceImpl. If you register this factory against the "wsdl"
> > extension, it will create a resource that has all the WSDL contained schemas
> > in the getContents list. I've only test this a little bit...
>
> > Hayden Marchant wrote:
>
> > > I have a WSDL file that contains embedded XSD. The approach that I've been
> > > taking is to take the xsd part and parse it as a seperate blob using
> > > Eclipse XSD. This approach works for simple cases, but with the WSDL
> > > below, where the targetNamespace of the file has a prefix called typens,
> > > there is a complication parsing the xsd since it cannot resolve the
> > > typens: prefix for the complex types. In fact I also have a problem with
> > > the wsdl:arrayType but I'm not sure if that can be overcome.
> > >
> > > Is there a way that I can set the targetNamespace of the document such
> > > that I can overcome this problem.
> > >
> > > <wsdl:definitions xmlns:typens="http://soap.amazon.com"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > xmlns="http://schemas.xmlsoap.org/wsdl/"
> > > targetNamespace="http://soap.amazon.com" name="AmazonSearch">
> > > <wsdl:types>
> > > <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > targetNamespace="http://soap.amazon.com">
> > > <xsd:complexType name="ProductLineArray">
> > > <xsd:complexContent>
> > > <xsd:restriction base="soapenc:Array">
> > > <xsd:attribute ref="soapenc:arrayType"
> > > wsdl:arrayType="typens:ProductLine[]" />
> > > </xsd:restriction>
> > > </xsd:complexContent>
> > > </xsd:complexType>
> > > <xsd:complexType name="ProductLine">
> > > <xsd:all>
> > > <xsd:element name="Mode" type="xsd:string" minOccurs="0" />
> > > <xsd:element name="ProductInfo" type="typens:ProductInfo" minOccurs="0"
> > > />
> > > </xsd:all>
> > > .......................]]>2003-11-10T11:51:11-00:00Re: Parsing a WSDL with embedded xsdhttps://www.eclipse.org/forums/index.php/mv/msg/10369/580597/#msg_580597
Soap encoding arrays are bit of a hack. It's most certainly invalid to reference
a name in a namespace that isn't explicitly imported, so to make a valid model,
you'll have to do something. You could build the model first, and then use the
model to add the import...

Hayden Marchant wrote:

> Ed,
>
> Thanks for this utility - nice to know how resource factories can be used.
> This doesn't really solve our problem since there are lines in the xsd,
> like:
>
> <xsd:restriction base="soapenc:Array">
>
> Now, we don't have any explicit import statement for that namespace. All
> there is, is the XML Namespace declaration at the head of the WSDL. I
> could hack in, and simulate an import statement in the xsd body and then
> parse but I was wondering if there was a nicer way.
>
> Thanks
>
> Ed Merks wrote:
>
> > Hayden,
>
> > I've been thinking about providing a convenience resource implementation for
> > handling WSDL. Attached are XSDWSDLResourceFactoryImpl and
> > XSDWSDLResourceImpl. If you register this factory against the "wsdl"
> > extension, it will create a resource that has all the WSDL contained schemas
> > in the getContents list. I've only test this a little bit...
>
> > Hayden Marchant wrote:
>
> > > I have a WSDL file that contains embedded XSD. The approach that I've been
> > > taking is to take the xsd part and parse it as a seperate blob using
> > > Eclipse XSD. This approach works for simple cases, but with the WSDL
> > > below, where the targetNamespace of the file has a prefix called typens,
> > > there is a complication parsing the xsd since it cannot resolve the
> > > typens: prefix for the complex types. In fact I also have a problem with
> > > the wsdl:arrayType but I'm not sure if that can be overcome.
> > >
> > > Is there a way that I can set the targetNamespace of the document such
> > > that I can overcome this problem.
> > >
> > > <wsdl:definitions xmlns:typens="http://soap.amazon.com"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > xmlns="http://schemas.xmlsoap.org/wsdl/"
> > > targetNamespace="http://soap.amazon.com" name="AmazonSearch">
> > > <wsdl:types>
> > > <xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > targetNamespace="http://soap.amazon.com">
> > > <xsd:complexType name="ProductLineArray">
> > > <xsd:complexContent>
> > > <xsd:restriction base="soapenc:Array">
> > > <xsd:attribute ref="soapenc:arrayType"
> > > wsdl:arrayType="typens:ProductLine[]" />
> > > </xsd:restriction>
> > > </xsd:complexContent>
> > > </xsd:complexType>
> > > <xsd:complexType name="ProductLine">
> > > <xsd:all>
> > > <xsd:element name="Mode" type="xsd:string" minOccurs="0" />
> > > <xsd:element name="ProductInfo" type="typens:ProductInfo" minOccurs="0"
> > > />
> > > </xsd:all>
> > > .......................]]>Ed Merks2003-11-10T11:51:11-00:00