473,587 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Schema in WSDL File

I have been experimenting with .Net web services for a while and have a few
questions about the schema in the automatically generated WSDL file, and
whether its content can be manipulated programatically .

First of all, I created several very simple test methods in my web service:

<WebMethod()_
Public Function TestString(ByVa l test As String) As String
Return "The value passed was " + test
End Function

<WebMethod()_
Public Function TestInteger(ByV al test As Integer) As String
Return "The value passed was " + CStr(test)
End Function

When I look at the schema that was generated for these methods, I find the
following:

<s:element name="TestStrin g">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="test" type="s:string"
/>
</s:sequence>
</s:complexType>
</s:element>

<s:element name="TestInteg er">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="test" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>

My question is - why did it specify a minOccurs of 0 for TestString, making
the argument optional, but specified a minOccurs of 1 for TestInteger? If a
method takes an argument, why is it making it optional for strings? Is it
possible to specify that a minOccurs of 1 should be used somewhere in code?

Also, if you want to validate against a custom schema type, say for a social
security number, how would you incorporate that into the automatically
generated WSDL file/schema? I read the article about customizing the
generation of service descriptions at

http://msdn2.microsoft.com/en-us/library/f9hatst6.aspx

but am not clear if the functionality they demonstrate can be used to do
what I want to do.

If it turns out that I cannot get what I want out of the automatically
generated WSDL/schema file, how could I then substitute my own file without
it being overwritten by the one being generated automatically?

Thanks,
Steve C.
Oct 11 '06 #1
2 2026
"SteveChamp " <St********@dis cussions.micros oft.comwrote in message
news:ED******** *************** ***********@mic rosoft.com...
>I have been experimenting with .Net web services for a while and have a few
questions about the schema in the automatically generated WSDL file, and
whether its content can be manipulated programatically .

First of all, I created several very simple test methods in my web
service:

<WebMethod()_
Public Function TestString(ByVa l test As String) As String
Return "The value passed was " + test
End Function

<WebMethod()_
Public Function TestInteger(ByV al test As Integer) As String
Return "The value passed was " + CStr(test)
End Function

When I look at the schema that was generated for these methods, I find the
following:

<s:element name="TestStrin g">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="test" type="s:string"
/>
</s:sequence>
</s:complexType>
</s:element>

<s:element name="TestInteg er">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="test" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>

My question is - why did it specify a minOccurs of 0 for TestString,
making
the argument optional, but specified a minOccurs of 1 for TestInteger? If
a
method takes an argument, why is it making it optional for strings? Is it
possible to specify that a minOccurs of 1 should be used somewhere in
code?

Also, if you want to validate against a custom schema type, say for a
social
security number, how would you incorporate that into the automatically
generated WSDL file/schema? I read the article about customizing the
generation of service descriptions at

http://msdn2.microsoft.com/en-us/library/f9hatst6.aspx

but am not clear if the functionality they demonstrate can be used to do
what I want to do.

If it turns out that I cannot get what I want out of the automatically
generated WSDL/schema file, how could I then substitute my own file
without
it being overwritten by the one being generated automatically?
Steve,

The WSDL is only generated automatically if you allow it to be. If you use:

<webServices>
<protocols>
<remove name="Documenta tion"></remove>
</protocols>
</webServices>

in your web.config, then service.asmx?WS DL will not return a generated WSDL.
You can then host your WSDL wherever you like, or not at all.

As to the minOccurs="0", this is only a guess, but, as a reference type,
your string could be ommitted by returning null. In terms of XML Schema,
null is not a valid string. One way to represent it would be for it to be
absent entirely.

John
Oct 11 '06 #2
John,

Thanks very much for the info. I may end up having to build my own WSDL from
scratch.

Steve C.
Oct 11 '06 #3

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

Similar topics

2
7295
by: Ali | last post by:
I am having problem compiling schema contained in WSDL file when analyzing schema types contained in it (for example http://www.ebout.net/net/GoogleSearch.wsdl). Following code demonstrates my problem: using System.Diagnostics; using System.IO; using System.Xml; using System.Xml.Schema;
1
6394
by: billa1972 | last post by:
Hi, I am trying to hook into Yellow Freight's rating webservice. Below is the wsdl. When i try and create a proxy file with wsdl.exe i get the following errors, see below. Also, when i reference this wsdl in .NET it seems to do it fine, yet there are no objects to reference except RateQuoteBeanService. In the WSDL it looks like there should be getRateQuote, and QUOTEREQUEST, etc.
12
5284
by: Whoever | last post by:
Hi, I'm trying to return an XmlDocument or XmlNode converted from a typed dataset. public XmlNode whatever() { MyTypedDataSet ds = new MyTypedDataSet(); return new XmlDataDocument(ds); }
5
5388
by: Jeff | last post by:
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...
1
20714
by: drb | last post by:
Hi, Newbie question #2 - hope that's OK! I'm trying to create a WSDL file using one or more XSD schema files. While WSDL.exe doesn't seem to support the XSD "import" function, if I include a single huge XSD schema file on the command line input to WSDL.exe, I can essentially achieve the desired result. (So, first question: is it true that WSDL.exe does not support *any* kind of <wsdl:import ...> or <xsd:import...> function?)
0
1091
by: Jimmy L | last post by:
to validate a WSDL is a valid one do i just need 1) WSDL schema - http://schemas.xmlsoap.org/wsdl/ 2) WSDL document input these 2 document into a XML editor just like validate XML doc with DTD?
1
3174
by: =?Utf-8?B?RmlsaXBwbyBCZXR0aW5hZ2xpbw==?= | last post by:
I am trying to use a web service that publishes a WSDL with external schema (.XSD files), unfortunately the .NET wsdl.exe is not able to generate the proxy class for it. It seems that wsdl.exe do not support external schemas. What can I do? 1. I asked them to change the WSDL including the external schema no way… 2. Is there any other .NET tool that I can get for importing WSDL files with
1
5981
by: Christof Winter | last post by:
I am trying to use a webservice with SOAPpy: import SOAPpy intact_wsdl = "http://www.ebi.ac.uk/intact/binary-search-ws/binarysearch?wsdl" intact_serv = SOAPpy.WSDL.Proxy(intact_wsdl) The resulting error message is posted below. If I understand it right, XMLSchema.py complains about the imported XSD namespace being the same as the existing targetNamespace.
0
1375
by: mmaslar | last post by:
Can Visual Studio ('05 or '08) generate a WSDL file with an external Schema file? eg. Instead of placing the schema within the WSDL file, generate it in a separate XSD file? In other words... When I browse to the WSDL (http://localhost:4444/WebService1.asmx?wsdl) the schema is inline. I'd like it to be external. Any way of doing that? Yes I know the net result is the same, but this WSDL will become the "contract" for other systems -- and an...
0
7924
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7978
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.