473,246 Members | 1,423 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,246 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 5345
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: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...

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.