Re: How does the MSFT Web Service Proxy Generator figure out .NET object types?

psparago_at_yahoo.com
Date: 12/01/04


Date: 1 Dec 2004 12:11:50 -0800

Hi Dan,

Thank you for the speedy response.

Say for example, I have the following Web Method:

[WebMethod]
public void datasetTest(out System.Data.DataSet dataset) {
try {
dataset = new System.Data.DataSet();
} catch(Exception e) {
throw e;
}
}

The relevant portion of the WSDL looks like this:

<s:element name="datasetTest">
<s:complexType />
</s:element>
<s:element name="datasetTestResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="dataset">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>

However, when I generate a Web Reference for the Web Method above, I
get the following proxy implementation:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute
("http://tempuri.org/datasetTest",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return:
System.Xml.Serialization.XmlElementAttribute("dataset")]
public System.Data.DataSet datasetTest() {
object[] results = this.Invoke("datasetTest", new
object[0]);
return ((System.Data.DataSet)(results[0]));
}

As you can see, a proxy method gets generated that returns a
System.Data.DataSet .NET object.

My question is, How did Visual Studio's proxy generator know that the
'out' argument (which somehow became the result, but that's another
story) was actually a System.Data.DataSet object?

Thanks for the help,

peter

Dan Rogers wrote:
> Hi,
>
> The WSDL is all that the proxy generator (actually XSD.exe) uses.
I'd need
> more specifics on your exact situation to help you. An xsd:any does
not
> imply anything, btw, and there is no inspection of the methods by the
proxy
> generator at run time.
>
> I hope this helps
>
> Dan Rogers
> Microsoft Corporation
> --------------------
> >From: psparago@yahoo.com
> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
> >Subject: How does the MSFT Web Service Proxy Generator figure out
.NET
> object types?
> >Date: 1 Dec 2004 06:47:44 -0800
> >Organization: http://groups.google.com
> >Lines: 20
> >Message-ID: <1101912464.407643.174430@z14g2000cwz.googlegroups.com>
> >NNTP-Posting-Host: 12.111.59.169
> >Mime-Version: 1.0
> >Content-Type: text/plain; charset="iso-8859-1"
> >X-Trace: posting.google.com 1101912468 7557 127.0.0.1 (1 Dec 2004
14:47:48
> GMT)
> >X-Complaints-To: groups-abuse@google.com
> >NNTP-Posting-Date: Wed, 1 Dec 2004 14:47:48 +0000 (UTC)
> >User-Agent: G2/0.2
> >Complaints-To: groups-abuse@google.com
> >Injection-Info: z14g2000cwz.googlegroups.com;
posting-host=12.111.59.169;
> > posting-account=byt0Hg0AAABMapNM6_oUq_6QF2tFk30s
> >Path:
>
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwi
>
x.com!newsfeed.cwix.com!prodigy.com!news.glorb.com!postnews.google.com!z14g2
> 000cwz.googlegroups.com!not-for-mail
> >Xref: cpmsftngxa10.phx.gbl
> microsoft.public.dotnet.framework.aspnet.webservices:26934
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
> >
> >Hi,
> >
> >I'm probably missing something obvious, but I'd like to know how the
> >Web Service Proxy Generator in .NET 2003 figures out from a WSDL the
> >correct type of a .NET object method parameter or result when there
is
> >no information about the type in the WSDL? Does it call each method
and
> >interrogate the response XML?
> >
> >I can understand that an xsd:any reference tells the WSDL consumer
that
> >a particular particle is expected to be determined at run time and
an
> ><element type='xsd:schema'> says an XML Schema will be returned in
the
> >response message to describe the object, but the schema itself is
not
> >referenced in the WSDL. Yet, the proxy knows the correct type! I
hate
> >MSFT magic!
> >
> >Does anyone know? Am I just being dense?
> >
> >thanks
> >peter
> >
> >



Relevant Pages

  • Re: Please help me Run web services from information stored in a datab
    ... Or do you really want to get the WSDL from the server, ... generate proxy code on-the-fly for that WSDL-data? ... To give you an idea what string will be stored in the databse, ... > Once I have the string that describes where I can find the Web Service, ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • RE: Soap Response
    ... Try refreshing the proxy. ... Thread-Topic: Soap Response ... webservice as per the following code in the proxy class: ... Public Function process3ParmRequest(ByVal inputHeader As String, ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: Web Service returning xs:choice as return type in C++ .NET
    ... as for the .NET wsdl generated proxy class's ... return type problem you mentioned, I've done some research on the .NET's ...
    (microsoft.public.dotnet.general)
  • Query on typing SoapService methods : Prev: Confused WS, SOA
    ... SoapReceiver, does now allow me to query Myservice.ashx?wsdl to return ... on another machine to create some proxy code classes. ... my wsdl on my initial attempts so far seems to have generated ... Which in the (VS Add Web Reference) proxy generated becomes ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: WSDL web reference problem
    ... Finally got to the bottom of the difference, the WSDL is right (apart from ... you can create the client proxies for them and compare the two ... | proxies to see whether they're identical. ... | single webservice proxy for the two ones and just change the client ...
    (microsoft.public.dotnet.framework.aspnet.webservices)