473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Microsoft wsdl Utility fails when multiple <schema> tags reference same targetNamespace

We are using .Net and the wsdl Utility to generate proxies to consume
web services built using the BEA toolset.

The data architects on the BEA side create XML schemas with various
entities in separate files for ease of maintainability. These schemas
are all part of the same namespace.

When defining a web service that access more than one of these
entities, the wsdl file generated by BEA contains multiple schema
elements with the same targetNamespace attribute on them. This causes
the Microsoft wsdl Utility to fail with the following error message:

"A schema with the namespace 'http://data.offline.us.xxx.com' has
already been added."

where 'http://data.offline.us.xxx.com' is the namespace in the schema
files.

If the multiple schema statements are combined into one, the wsdl
utility generates proxies correctly.

Has anyone run into this behavior before? Our goal would be to coax
the Microsoft wsdl Utility to accept the wsdl so we can continue to use
the automated tools on the BEA side and avoid any manual editing of
wsdl to consume them on the .Net side.

Attached below is a sample. Thanks in advance -

Jeff Odell

Here is the example with the multiple schemas:

<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/"
xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://www.openuri.org/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://www.openuri.org/">
<types>
<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:data="http://data.offline.us.xxx.com"
elementFormDefault="qualified"
targetNamespace="http://www.openuri.org/">
<s:import namespace="http://data.offline.us.xxx.com"/>
<s:element name="putFlat1">
<s:complexType>
<s:sequence>
<s:element ref="data:SimpleFlat"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="putFlat1Response">
<s:complexType>
<s:sequence>
<s:element name="putFlat1Result" type="s:string"
minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="putFlat2">
<s:complexType>
<s:sequence>
<s:element ref="data:SimpleFlat2"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="putFlat2Response">
<s:complexType>
<s:sequence>
<s:element name="putFlat2Result" type="s:string"
minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<!-- first schema -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://data.offline.us.xxx.com"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="SimpleFlat">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string"/>
<xs:element name="LastName" type="xs:string"/>
<xs:element name="Date" type="xs:dateTime"/>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Activity">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="TimeSpent" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<!-- second schema -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://data.offline.us.xxx.com"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="SimpleFlat2">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string"/>
<xs:element name="LastName" type="xs:string"/>
<xs:element name="Date" type="xs:dateTime"/>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Activity">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="TimeSpent" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

</types>
<message name="putFlat1SoapIn">
<part name="parameters" element="s0:putFlat1"/>
</message>
<message name="putFlat1SoapOut">
<part name="parameters" element="s0:putFlat1Response"/>
</message>
<message name="putFlat2SoapIn">
<part name="parameters" element="s0:putFlat2"/>
</message>
<message name="putFlat2SoapOut">
<part name="parameters" element="s0:putFlat2Response"/>
</message>
<portType name="TwoFlatsSoap">
<operation name="putFlat1">
<input message="s0:putFlat1SoapIn"/>
<output message="s0:putFlat1SoapOut"/>
</operation>
<operation name="putFlat2">
<input message="s0:putFlat2SoapIn"/>
<output message="s0:putFlat2SoapOut"/>
</operation>
</portType>
<binding name="TwoFlatsSoap" type="s0:TwoFlatsSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<operation name="putFlat1">
<soap:operation soapAction="http://www.openuri.org/putFlat1"
style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="putFlat2">
<soap:operation soapAction="http://www.openuri.org/putFlat2"
style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TwoFlats">
<port name="TwoFlatsSoap" binding="s0:TwoFlatsSoap">
<soap:address
location="http://server:8501/EndPoints/TwoFlats.jws"/>
</port>
</service>
</definitions>

The schemas can be combined by removing the lines:

</xs:schema>
<!-- second schema -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://data.offline.us.xxx.com"
elementFormDefault="qualified" attributeFormDefault="unqualified">
This causes the utility to work.

Nov 23 '05 #1
5 5352
Rather than changing wsdl.exe
how about if, at build time, you use a stream editor (sed, perl, awk) to
combine the multiple companion schema files into one ?

-Dino
"Jeff" <jo****@tampabay.rr.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
We are using .Net and the wsdl Utility to generate proxies to consume
web services built using the BEA toolset.

The data architects on the BEA side create XML schemas with various
entities in separate files for ease of maintainability. These schemas
are all part of the same namespace.

When defining a web service that access more than one of these
entities, the wsdl file generated by BEA contains multiple schema
elements with the same targetNamespace attribute on them. This causes
the Microsoft wsdl Utility to fail with the following error message:

"A schema with the namespace 'http://data.offline.us.xxx.com' has
already been added."

where 'http://data.offline.us.xxx.com' is the namespace in the schema
files.

If the multiple schema statements are combined into one, the wsdl
utility generates proxies correctly.

Has anyone run into this behavior before? Our goal would be to coax
the Microsoft wsdl Utility to accept the wsdl so we can continue to use
the automated tools on the BEA side and avoid any manual editing of
wsdl to consume them on the .Net side.

Attached below is a sample. Thanks in advance -

Jeff Odell

Here is the example with the multiple schemas:

<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/"
xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://www.openuri.org/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://www.openuri.org/">
<types>
<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:data="http://data.offline.us.xxx.com"
elementFormDefault="qualified"
targetNamespace="http://www.openuri.org/">
<s:import namespace="http://data.offline.us.xxx.com"/>
<s:element name="putFlat1">
<s:complexType>
<s:sequence>
<s:element ref="data:SimpleFlat"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="putFlat1Response">
<s:complexType>
<s:sequence>
<s:element name="putFlat1Result" type="s:string"
minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="putFlat2">
<s:complexType>
<s:sequence>
<s:element ref="data:SimpleFlat2"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="putFlat2Response">
<s:complexType>
<s:sequence>
<s:element name="putFlat2Result" type="s:string"
minOccurs="0"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<!-- first schema -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://data.offline.us.xxx.com"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="SimpleFlat">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string"/>
<xs:element name="LastName" type="xs:string"/>
<xs:element name="Date" type="xs:dateTime"/>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Activity">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="TimeSpent" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<!-- second schema -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://data.offline.us.xxx.com"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="SimpleFlat2">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string"/>
<xs:element name="LastName" type="xs:string"/>
<xs:element name="Date" type="xs:dateTime"/>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Activity">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="TimeSpent" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

</types>
<message name="putFlat1SoapIn">
<part name="parameters" element="s0:putFlat1"/>
</message>
<message name="putFlat1SoapOut">
<part name="parameters" element="s0:putFlat1Response"/>
</message>
<message name="putFlat2SoapIn">
<part name="parameters" element="s0:putFlat2"/>
</message>
<message name="putFlat2SoapOut">
<part name="parameters" element="s0:putFlat2Response"/>
</message>
<portType name="TwoFlatsSoap">
<operation name="putFlat1">
<input message="s0:putFlat1SoapIn"/>
<output message="s0:putFlat1SoapOut"/>
</operation>
<operation name="putFlat2">
<input message="s0:putFlat2SoapIn"/>
<output message="s0:putFlat2SoapOut"/>
</operation>
</portType>
<binding name="TwoFlatsSoap" type="s0:TwoFlatsSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<operation name="putFlat1">
<soap:operation soapAction="http://www.openuri.org/putFlat1"
style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="putFlat2">
<soap:operation soapAction="http://www.openuri.org/putFlat2"
style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TwoFlats">
<port name="TwoFlatsSoap" binding="s0:TwoFlatsSoap">
<soap:address
location="http://server:8501/EndPoints/TwoFlats.jws"/>
</port>
</service>
</definitions>

The schemas can be combined by removing the lines:

</xs:schema>
<!-- second schema -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://data.offline.us.xxx.com"
elementFormDefault="qualified" attributeFormDefault="unqualified">
This causes the utility to work.

Nov 23 '05 #2
Well, we thought about that and could introduce that into our process.
However we were hoping not to have to write and maintain that step. It
may be as simple as creating the proper XSLT transform, but we then
have to monitor the urls where we get the .wsdl, pull them as they
change and maintain a local copy with the fixes in them.

Not out of the question but we were hoping to get the vendors to tell
us where we might be able to get full interoperability without going
through those steps

Nov 23 '05 #3
Give this tool a try
http://www.gotdotnet.com/Workspaces/...f-94f705ca861e

Regards
Erymuzuan Mustapa

Jeff wrote:
Well, we thought about that and could introduce that into our process.
However we were hoping not to have to write and maintain that step. It
may be as simple as creating the proper XSLT transform, but we then
have to monitor the urls where we get the .wsdl, pull them as they
change and maintain a local copy with the fixes in them.

Not out of the question but we were hoping to get the vendors to tell
us where we might be able to get full interoperability without going
through those steps

Nov 23 '05 #4
I've been unable to make this link work this morning - is this project
still active?

Thank you - Jeff Odell

Nov 23 '05 #5
After further review, it appears that the practice of breaking up the Schema
in this way may fall outside the letter of the law for XML Schema.
Jeff, did you try using the appropriate includes, rather than using
duplicate schemas declarations?
This would give you the flexibility you want, but wouldn't go outside the
XML spec.

-D

"Jeff" <jo****@tampabay.rr.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I've been unable to make this link work this morning - is this project
still active?

Thank you - Jeff Odell

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Lintner | last post by:
Hi, I woult like to switch from DTD to XML-Schema and am looking for an equivalent to external ENTITY for composition of an xml file from modules --- my.dtd -- <?xml version="1.0"...
2
by: Wayne Shook | last post by:
I'm using the .NET IDE and I have an XML file that I'm trying to validate against an XML schema on my local drive. the noNamespaceSchemaLocation attribute has been modified to what I think is...
2
by: Brad Quinn | last post by:
Lets say I have an XmlNode that validates against some schema. I also have a class that was generated by the xsd tool using said schema. What is the best way to get from an XmlNode to an...
0
by: Andrea N. | last post by:
I'm new to .NET XML classes, so here my dilemma I really like the XMLDataDocument concept of synchronizing automatically XMLDocument and DataSet with a common schema. Can I automatically...
1
by: Mike Strieder | last post by:
How can i get the text of the System.Type e.g. "base64Binary" from the .Net type "byte" I can not found any Function to give back this Schematype as string. thx for your help
4
by: Sindarian | last post by:
This just seems like the most basic thing, but I can't find a simple description of this process anywhere and in here, everone is talking about going the other way :( I had .NET create an XML...
3
by: kevin | last post by:
Is that even possible? I am creating a web service in .NET to expose some already created .NET programs to other groups. One group is writing the client in PERL, and thus wishes the wsdl schema...
5
by: markus.meier | last post by:
Hi, I'm searching a tool to generate XML files based on an existing XML schema file. Does somebody know a free tool that supports this feature? Thanks Markus
1
by: =?Utf-8?B?TWFuaXNoIEJhZm5h?= | last post by:
Hi, I am getting following error while validating xml file with schema using ReaderSettings in .NET 2.0 "Line: 0 - Position: 0 - The root element of a W3C XML Schema should be <schemaand its...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.