By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,605 Members | 2,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,605 IT Pros & Developers. It's quick & easy.

How does the client of a webservice figure out a complex type

P: n/a
Hi,

I created a sinple web service that returns a dataSet.

Then I created a client program that uses this web service (that returns the
Dataset).

My question is, how did the client figure out to create a "DataSet" as the
return type from the webservice?

I looked in the wsdl.... there is no reference to DataSet, it just says the
type is "Schema".
Thanks
Nalaka
Nov 23 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hi,

The trick WebServices in .Net use is "send a hint in the XML instance
document".

When a DataSet is detected in the WebService generation part an
additional attribute with a 'hint for .Net only' is send allong.

This allows the (.Net) de-serializer to create the .Net native
'DataSet' type and populate it.

I.o.w. It's the toolkit you are using which is able to do this for
you, it has NOTHING to do with the official specs for WebServices.

Hope this helps,

Marvin Smit.

On Thu, 8 Sep 2005 08:30:52 -0700, "Nalaka" <na******@nospam.nospam>
wrote:
Hi,

I created a sinple web service that returns a dataSet.

Then I created a client program that uses this web service (that returns the
Dataset).

My question is, how did the client figure out to create a "DataSet" as the
return type from the webservice?

I looked in the wsdl.... there is no reference to DataSet, it just says the
type is "Schema".
Thanks
Nalaka


Nov 23 '05 #2

P: n/a
Thanks Marvin.....

Does that mean... to create the client code...
..Net not only gets the wsdl... it also invokes the webservice itself, to get
a instance, to look for .Net speific hints.
,
Nalaka

"Marvin Smit" <ma*********@gmail.com> wrote in message
news:ic********************************@4ax.com...
Hi,

The trick WebServices in .Net use is "send a hint in the XML instance
document".

When a DataSet is detected in the WebService generation part an
additional attribute with a 'hint for .Net only' is send allong.

This allows the (.Net) de-serializer to create the .Net native
'DataSet' type and populate it.

I.o.w. It's the toolkit you are using which is able to do this for
you, it has NOTHING to do with the official specs for WebServices.

Hope this helps,

Marvin Smit.

On Thu, 8 Sep 2005 08:30:52 -0700, "Nalaka" <na******@nospam.nospam>
wrote:
Hi,

I created a sinple web service that returns a dataSet.

Then I created a client program that uses this web service (that returns
the
Dataset).

My question is, how did the client figure out to create a "DataSet" as the
return type from the webservice?

I looked in the wsdl.... there is no reference to DataSet, it just says
the
type is "Schema".
Thanks
Nalaka

Nov 23 '05 #3

P: n/a
Hi Nalaka,

As for how webservice client figure out a complex type, it all depends on
the webservice client's programming platform( .NET , java .....). As for
webservice standard, the WSDL is the only service contract and provide type
definition, the webservice just generate clientside class according to the
schemas within the WSDL. As for complex xml types, the certain client will
generate the appropriate proxy classes for them, for example as the DataSet
you mentioned, the webservice expose it as a schema type since it's XML
standard and not platform specific, then the webservice clientside can
generate proper client proxy class to represent it. For .NET, the
clientside VS.NET(or wsdl.exe) will use DataSet class to represent it, in
JAVA, maybe some other class (could just be a XmlDocument class ...).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "Nalaka" <na******@nospam.nospam>
References: <#j**************@TK2MSFTNGP14.phx.gbl>
<ic********************************@4ax.com>
Subject: Re: How does the client of a webservice figure out a complex type
Date: Thu, 8 Sep 2005 13:19:04 -0700
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <OL**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP1
2.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1199 5
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Thanks Marvin.....

Does that mean... to create the client code...
..Net not only gets the wsdl... it also invokes the webservice itself, to
get
a instance, to look for .Net speific hints.
,
Nalaka

"Marvin Smit" <ma*********@gmail.com> wrote in message
news:ic********************************@4ax.com...
Hi,

The trick WebServices in .Net use is "send a hint in the XML instance
document".

When a DataSet is detected in the WebService generation part an
additional attribute with a 'hint for .Net only' is send allong.

This allows the (.Net) de-serializer to create the .Net native
'DataSet' type and populate it.

I.o.w. It's the toolkit you are using which is able to do this for
you, it has NOTHING to do with the official specs for WebServices.

Hope this helps,

Marvin Smit.

On Thu, 8 Sep 2005 08:30:52 -0700, "Nalaka" <na******@nospam.nospam>
wrote:
Hi,

I created a sinple web service that returns a dataSet.

Then I created a client program that uses this web service (that returns
the
Dataset).

My question is, how did the client figure out to create a "DataSet" as the
return type from the webservice?

I looked in the wsdl.... there is no reference to DataSet, it just says
the
type is "Schema".
Thanks
Nalaka


Nov 23 '05 #4

P: n/a
Hi,
.Net not only gets the wsdl... it also invokes the webservice itself, to get
a instance, to look for .Net speific hints.
That's the proxy that is generated (Web Reference) on the client side
using the WSDL. The proxy (baseclass) contains code to 'check for
these hints'.

Hope this helps,

Marvin Smit.

On Thu, 8 Sep 2005 13:19:04 -0700, "Nalaka" <na******@nospam.nospam>
wrote:
Thanks Marvin.....

Does that mean... to create the client code...
.Net not only gets the wsdl... it also invokes the webservice itself, to get
a instance, to look for .Net speific hints.
,
Nalaka

"Marvin Smit" <ma*********@gmail.com> wrote in message
news:ic********************************@4ax.com.. .
Hi,

The trick WebServices in .Net use is "send a hint in the XML instance
document".

When a DataSet is detected in the WebService generation part an
additional attribute with a 'hint for .Net only' is send allong.

This allows the (.Net) de-serializer to create the .Net native
'DataSet' type and populate it.

I.o.w. It's the toolkit you are using which is able to do this for
you, it has NOTHING to do with the official specs for WebServices.

Hope this helps,

Marvin Smit.

On Thu, 8 Sep 2005 08:30:52 -0700, "Nalaka" <na******@nospam.nospam>
wrote:
Hi,

I created a sinple web service that returns a dataSet.

Then I created a client program that uses this web service (that returns
the
Dataset).

My question is, how did the client figure out to create a "DataSet" as the
return type from the webservice?

I looked in the wsdl.... there is no reference to DataSet, it just says
the
type is "Schema".
Thanks
Nalaka

Nov 23 '05 #5

P: n/a
Hi,
Sorry to be bugging again on the same issue.

if the wsdl does not contain any reference (to DataSet), how does the clinet
code generator know, that this schema is a DataSet?
Even before I call the webservice (at design time), client code (proxy) that
was generated for me by .Net, knew that the return data type is DataSet.

hmmm... or may be it did not???..... just let me assign the return to any
type (an compile ok)... and then (if I am wrong) at runtime generate an
error?

I am not sure if I explained my confusion properly....

,
Nalaka


"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:u$**************@TK2MSFTNGXA01.phx.gbl...
Hi Nalaka,

As for how webservice client figure out a complex type, it all depends on
the webservice client's programming platform( .NET , java .....). As for
webservice standard, the WSDL is the only service contract and provide
type
definition, the webservice just generate clientside class according to the
schemas within the WSDL. As for complex xml types, the certain client will
generate the appropriate proxy classes for them, for example as the
DataSet
you mentioned, the webservice expose it as a schema type since it's XML
standard and not platform specific, then the webservice clientside can
generate proper client proxy class to represent it. For .NET, the
clientside VS.NET(or wsdl.exe) will use DataSet class to represent it, in
JAVA, maybe some other class (could just be a XmlDocument class ...).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "Nalaka" <na******@nospam.nospam>
References: <#j**************@TK2MSFTNGP14.phx.gbl>
<ic********************************@4ax.com>
Subject: Re: How does the client of a webservice figure out a complex type
Date: Thu, 8 Sep 2005 13:19:04 -0700
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <OL**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP1
2.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1199 5
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Thanks Marvin.....

Does that mean... to create the client code...
Net not only gets the wsdl... it also invokes the webservice itself, to
get
a instance, to look for .Net speific hints.
,
Nalaka

"Marvin Smit" <ma*********@gmail.com> wrote in message
news:ic********************************@4ax.com...
Hi,

The trick WebServices in .Net use is "send a hint in the XML instance
document".

When a DataSet is detected in the WebService generation part an
additional attribute with a 'hint for .Net only' is send allong.

This allows the (.Net) de-serializer to create the .Net native
'DataSet' type and populate it.

I.o.w. It's the toolkit you are using which is able to do this for
you, it has NOTHING to do with the official specs for WebServices.

Hope this helps,

Marvin Smit.

On Thu, 8 Sep 2005 08:30:52 -0700, "Nalaka" <na******@nospam.nospam>
wrote:
Hi,

I created a sinple web service that returns a dataSet.

Then I created a client program that uses this web service (that returns
the
Dataset).

My question is, how did the client figure out to create a "DataSet" as
the
return type from the webservice?

I looked in the wsdl.... there is no reference to DataSet, it just says
the
type is "Schema".
Thanks
Nalaka


Nov 23 '05 #6

P: n/a
Hi,

try tracing what goes over the wire when you do a call through the
proxy. Take notice of the "return value" on the wire havnig an
attribute with a hint for the client side proxy this is a DataSet.

Hope this helps,

Marvin Smit.

On Fri, 9 Sep 2005 16:23:15 -0700, "Nalaka" <na******@nospam.nospam>
wrote:
Hi,
Sorry to be bugging again on the same issue.

if the wsdl does not contain any reference (to DataSet), how does the clinet
code generator know, that this schema is a DataSet?
Even before I call the webservice (at design time), client code (proxy) that
was generated for me by .Net, knew that the return data type is DataSet.

hmmm... or may be it did not???..... just let me assign the return to any
type (an compile ok)... and then (if I am wrong) at runtime generate an
error?

I am not sure if I explained my confusion properly....

,
Nalaka


"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:u$**************@TK2MSFTNGXA01.phx.gbl...
Hi Nalaka,

As for how webservice client figure out a complex type, it all depends on
the webservice client's programming platform( .NET , java .....). As for
webservice standard, the WSDL is the only service contract and provide
type
definition, the webservice just generate clientside class according to the
schemas within the WSDL. As for complex xml types, the certain client will
generate the appropriate proxy classes for them, for example as the
DataSet
you mentioned, the webservice expose it as a schema type since it's XML
standard and not platform specific, then the webservice clientside can
generate proper client proxy class to represent it. For .NET, the
clientside VS.NET(or wsdl.exe) will use DataSet class to represent it, in
JAVA, maybe some other class (could just be a XmlDocument class ...).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "Nalaka" <na******@nospam.nospam>
References: <#j**************@TK2MSFTNGP14.phx.gbl>
<ic********************************@4ax.com>
Subject: Re: How does the client of a webservice figure out a complex type
Date: Thu, 8 Sep 2005 13:19:04 -0700
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <OL**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP1
2.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1199 5
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Thanks Marvin.....

Does that mean... to create the client code...
Net not only gets the wsdl... it also invokes the webservice itself, to
get
a instance, to look for .Net speific hints.
,
Nalaka

"Marvin Smit" <ma*********@gmail.com> wrote in message
news:ic********************************@4ax.com...
Hi,

The trick WebServices in .Net use is "send a hint in the XML instance
document".

When a DataSet is detected in the WebService generation part an
additional attribute with a 'hint for .Net only' is send allong.

This allows the (.Net) de-serializer to create the .Net native
'DataSet' type and populate it.

I.o.w. It's the toolkit you are using which is able to do this for
you, it has NOTHING to do with the official specs for WebServices.

Hope this helps,

Marvin Smit.

On Thu, 8 Sep 2005 08:30:52 -0700, "Nalaka" <na******@nospam.nospam>
wrote:

Hi,

I created a sinple web service that returns a dataSet.

Then I created a client program that uses this web service (that returns
the
Dataset).

My question is, how did the client figure out to create a "DataSet" as
the
return type from the webservice?

I looked in the wsdl.... there is no reference to DataSet, it just says
the
type is "Schema".
Thanks
Nalaka


Nov 23 '05 #7

P: n/a
Hi Nalaka,

As Marvin has mentioned, the webservice's response message of the DataSet
service will contains some flag to indicate the result element be a
DataSet, here is a simple webservice(which return dataset)'s response SOAP
message:
==========
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetDataSetResponse
xmlns="http://tempuri.org/"><GetDataSetResult><xs:schema id="ds" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element name="ds"
msdata:IsDataSet="true" msdata:Locale="zh-CN"><xs:complexType><xs:choice
maxOccurs="unbounded"><xs:element
name="dt"><xs:complexType><xs:sequence><xs:element name="id" type="xs:long"
minOccurs="0" /><xs:element name="name" type="xs:string" minOccurs="0"
/></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType><
/xs:element></xs:schema><diffgr:diffgram
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><ds xmlns=""><dt
diffgr:id="dt1" msdata:rowOrder="0"
diffgr:hasChanges="inserted"><id>1</id><name>Name_1</name></dt><dt
diffgr:id="dt2" msdata:rowOrder="1"
diffgr:hasChanges="inserted"><id>2</id><name>Name_2</name></dt><dt
diffgr:id="dt3" msdata:rowOrder="2"
diffgr:hasChanges="inserted"><id>3</id><name>Name_3</name></dt><dt
diffgr:id="dt4" msdata:rowOrder="3"
diffgr:hasChanges="inserted"><id>4</id><name>Name_4</name></dt><dt
diffgr:id="dt5" msdata:rowOrder="4"
diffgr:hasChanges="inserted"><id>5</id><name>Name_5</name></dt></ds></diffgr
:diffgram></GetDataSetResult></GetDataSetResponse></soap:Body></soap:Envelop
e>
==============

You can find the

xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"

namespace which used to provide MS specific type information. So .NET
webservice client proxy can use these info to correcdtly deserialize the
XML element into the proper type instance. For any other platform, java,
perl... they'll have their own rule on deserializing such response.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
From: Marvin Smit <ma*********@gmail.com>
Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: Re: How does the client of a webservice figure out a complex type
Date: Sat, 10 Sep 2005 14:04:19 +0200
Message-ID: <hr********************************@4ax.com>
References: <#j**************@TK2MSFTNGP14.phx.gbl>
<ic********************************@4ax.com>
<OL**************@TK2MSFTNGP12.phx.gbl>
<u$**************@TK2MSFTNGXA01.phx.gbl>
<eo**************@TK2MSFTNGP09.phx.gbl>
X-Newsreader: Forte Free Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: ab***@chello.nl
Organization: chello.nl
Lines: 145
NNTP-Posting-Host: 62.194.138.116 (62.194.138.116)
NNTP-Posting-Date: Sat, 10 Sep 2005 14:04:27 +0200
X-Trace: 531be4322cbcb9b672fd129497
Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
ne.de!tiscali!newsfeed1.ip.tiscali.net!border2.nnt p.ams.giganews.com!border1
..nntp.ams.giganews.com!nntp.giganews.com!amsnews1 1.chello.com!amsnews14.chel
lo.com!news.chello.nl.POSTED!not-for-mail
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:7852
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi,

try tracing what goes over the wire when you do a call through the
proxy. Take notice of the "return value" on the wire havnig an
attribute with a hint for the client side proxy this is a DataSet.

Hope this helps,

Marvin Smit.

On Fri, 9 Sep 2005 16:23:15 -0700, "Nalaka" <na******@nospam.nospam>
wrote:
Hi,
Sorry to be bugging again on the same issue.

if the wsdl does not contain any reference (to DataSet), how does the clinetcode generator know, that this schema is a DataSet?
Even before I call the webservice (at design time), client code (proxy) thatwas generated for me by .Net, knew that the return data type is DataSet.

hmmm... or may be it did not???..... just let me assign the return to any
type (an compile ok)... and then (if I am wrong) at runtime generate an
error?

I am not sure if I explained my confusion properly....

,
Nalaka


"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:u$**************@TK2MSFTNGXA01.phx.gbl...
Hi Nalaka,

As for how webservice client figure out a complex type, it all depends on
the webservice client's programming platform( .NET , java .....). As for
webservice standard, the WSDL is the only service contract and provide
type
definition, the webservice just generate clientside class according to the schemas within the WSDL. As for complex xml types, the certain client will generate the appropriate proxy classes for them, for example as the
DataSet
you mentioned, the webservice expose it as a schema type since it's XML
standard and not platform specific, then the webservice clientside can
generate proper client proxy class to represent it. For .NET, the
clientside VS.NET(or wsdl.exe) will use DataSet class to represent it, in
JAVA, maybe some other class (could just be a XmlDocument class ...).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "Nalaka" <na******@nospam.nospam>
References: <#j**************@TK2MSFTNGP14.phx.gbl>
<ic********************************@4ax.com>
Subject: Re: How does the client of a webservice figure out a complex type Date: Thu, 8 Sep 2005 13:19:04 -0700
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <OL**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP1 2.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1199 5
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Thanks Marvin.....

Does that mean... to create the client code...
Net not only gets the wsdl... it also invokes the webservice itself, to
get
a instance, to look for .Net speific hints.
,
Nalaka

"Marvin Smit" <ma*********@gmail.com> wrote in message
news:ic********************************@4ax.com...
Hi,

The trick WebServices in .Net use is "send a hint in the XML instance
document".

When a DataSet is detected in the WebService generation part an
additional attribute with a 'hint for .Net only' is send allong.

This allows the (.Net) de-serializer to create the .Net native
'DataSet' type and populate it.

I.o.w. It's the toolkit you are using which is able to do this for
you, it has NOTHING to do with the official specs for WebServices.

Hope this helps,

Marvin Smit.

On Thu, 8 Sep 2005 08:30:52 -0700, "Nalaka" <na******@nospam.nospam>
wrote:

Hi,

I created a sinple web service that returns a dataSet.

Then I created a client program that uses this web service (that returns
the
Dataset).

My question is, how did the client figure out to create a "DataSet" as
the
return type from the webservice?

I looked in the wsdl.... there is no reference to DataSet, it just says
the
type is "Schema".
Thanks
Nalaka



Nov 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.