Re: How does the MSFT Web Service Proxy Generator figure out .NET object types?
psparago_at_yahoo.com
Date: 12/01/04
- Next message: Dan Rogers: "Re: Problem sending XML over SSL"
- Previous message: Dan Rogers: "RE: Need Help with 'Page can not be displayed' form my web service"
- In reply to: Dan Rogers: "RE: How does the MSFT Web Service Proxy Generator figure out .NET object types?"
- Next in thread: Dan Rogers: "Re: How does the MSFT Web Service Proxy Generator figure out .NET object types?"
- Reply: Dan Rogers: "Re: How does the MSFT Web Service Proxy Generator figure out .NET object types?"
- Messages sorted by: [ date ] [ thread ]
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
> >
> >
- Next message: Dan Rogers: "Re: Problem sending XML over SSL"
- Previous message: Dan Rogers: "RE: Need Help with 'Page can not be displayed' form my web service"
- In reply to: Dan Rogers: "RE: How does the MSFT Web Service Proxy Generator figure out .NET object types?"
- Next in thread: Dan Rogers: "Re: How does the MSFT Web Service Proxy Generator figure out .NET object types?"
- Reply: Dan Rogers: "Re: How does the MSFT Web Service Proxy Generator figure out .NET object types?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|