Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Auto generated asmx web service documentation omits base class attributes

Reply
Thread Tools

Auto generated asmx web service documentation omits base class attributes

 
 
Matt
Guest
Posts: n/a
 
      11-03-2004
I am working on a c# web service in VS 2003, .Net Framework version
1.1. My web method takes as input a complex data class derived from
another simple data class. Boiled down it looks like the following
code sample.

namespace MyService {
public class MyBaseClass {
public string s1;
public string s2;
}
public class MyDerivedClass : MyBaseClass {
public string s3;
public string s4;
}
public class Service1 : System.Web.Services.WebService {
[System.Web.Services.WebMethod]
public string DoSomething(MyDerivedClass mdc){
return mdc.s1 + mdc.s2 + mdc.s3 + mdc.s4;
}
}
}

My problem is that when I view the auto generated documentation for
the DoSomething web method at MyService/Service1.asmx?op=DoSomething
it does not render the attributes of the base class, MyBaseClass in
the sample SOAP request. Why aren't <s1> and <s2> represented in the
DoSomething request below?

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xmlnssd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<DoSomething xmlns="http://tempuri.org/">
<mdc>
<s3>string</s3>
<s4>string</s4>
</mdc>
</DoSomething>
</soap:Body>
</soap:Envelope>

I have spent the day mucking about with DefaultWsdlHelpGenerator.aspx
to see if it might just be a presentation issue but it seems that the
..asmx handler is not providing the details of the base class in the
service description collections that the help generator draws from the
Context object. Anyone have any simular experiences or insights on how
to fix this issue?

For reference the MyService/Service1.asmx?WSDL presentation is below.
It shows MyDerivedClass extending MyBaseClass just as it should.

<?xml version="1.0" encoding="utf-8" ?>
- <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://tempuri.org/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://tempuri.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <s:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/">
- <s:element name="DoSomething">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="mdc"
type="s0:MyDerivedClass" />
</s:sequence>
</s:complexType>
</s:element>
- <s:complexType name="MyDerivedClass">
- <s:complexContent mixed="false">
- <s:extension base="s0:MyBaseClass">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="s4" type="s:string" />
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>
- <s:complexType name="MyBaseClass">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="s2" type="s:string" />
</s:sequence>
</s:complexType>
- <s:element name="DoSomethingResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DoSomethingResult"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
- <message name="DoSomethingSoapIn">
<part name="parameters" element="s0oSomething" />
</message>
- <message name="DoSomethingSoapOut">
<part name="parameters" element="s0oSomethingResponse" />
</message>
- <portType name="Service1Soap">
- <operation name="DoSomething">
<input message="s0oSomethingSoapIn" />
<output message="s0oSomethingSoapOut" />
</operation>
</portType>
- <binding name="Service1Soap" type="s0:Service1Soap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
- <operation name="DoSomething">
<soapperation soapAction="http://tempuri.org/DoSomething"
style="document" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <service name="Service1">
- <port name="Service1Soap" binding="s0:Service1Soap">
<soap:address location="http://localhost/MyService/Service1.asmx" />
</port>
</service>
</definitions>
 
Reply With Quote
 
 
 
 
Dan Rogers
Guest
Posts: n/a
 
      11-11-2004
Hi,

Full reflection across complexTypes is not a feature of the automatic
documentation. In all cases, you'll only get the first element name for
return types or parameters that derive from complex types. The automatic
documentation tool only "spells out" native types.

Best regards,

Dan Rogers
Microsoft Corporation
--------------------
>From: (Matt)
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
>Subject: Auto generated asmx web service documentation omits base class

attributes
>Date: 2 Nov 2004 16:03:43 -0800
>Organization: http://groups.google.com
>Lines: 131
>Message-ID: < >
>NNTP-Posting-Host: 24.1.160.14
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1099440224 22081 127.0.0.1 (3 Nov 2004

00:03:44 GMT)
>X-Complaints-To: groups-
>NNTP-Posting-Date: Wed, 3 Nov 2004 00:03:44 +0000 (UTC)
>Path:

cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado .fastwebnet.it!tiscali!new
sfeed1.ip.tiscali.net!news.glorb.com!postnews1.goo gle.com!not-for-mail
>Xref: cpmsftngxa10.phx.gbl

microsoft.public.dotnet.framework.aspnet.webservic es:26358
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>I am working on a c# web service in VS 2003, .Net Framework version
>1.1. My web method takes as input a complex data class derived from
>another simple data class. Boiled down it looks like the following
>code sample.
>
>namespace MyService {
> public class MyBaseClass {
> public string s1;
> public string s2;
> }
> public class MyDerivedClass : MyBaseClass {
> public string s3;
> public string s4;
> }
> public class Service1 : System.Web.Services.WebService {
> [System.Web.Services.WebMethod]
> public string DoSomething(MyDerivedClass mdc){
> return mdc.s1 + mdc.s2 + mdc.s3 + mdc.s4;
> }
> }
>}
>
>My problem is that when I view the auto generated documentation for
>the DoSomething web method at MyService/Service1.asmx?op=DoSomething
>it does not render the attributes of the base class, MyBaseClass in
>the sample SOAP request. Why aren't <s1> and <s2> represented in the
>DoSomething request below?
>
><?xml version="1.0" encoding="utf-8"?>
><soap:Envelope xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
>xmlnssd="http://www.w3.org/2001/XMLSchema"
>xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <DoSomething xmlns="http://tempuri.org/">
> <mdc>
> <s3>string</s3>
> <s4>string</s4>
> </mdc>
> </DoSomething>
> </soap:Body>
></soap:Envelope>
>
>I have spent the day mucking about with DefaultWsdlHelpGenerator.aspx
>to see if it might just be a presentation issue but it seems that the
>.asmx handler is not providing the details of the base class in the
>service description collections that the help generator draws from the
>Context object. Anyone have any simular experiences or insights on how
>to fix this issue?
>
>For reference the MyService/Service1.asmx?WSDL presentation is below.
>It shows MyDerivedClass extending MyBaseClass just as it should.
>
> <?xml version="1.0" encoding="utf-8" ?>
>- <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
>xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>xmlns:s="http://www.w3.org/2001/XMLSchema"
>xmlns:s0="http://tempuri.org/"
>xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
>xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>targetNamespace="http://tempuri.org/"
>xmlns="http://schemas.xmlsoap.org/wsdl/">
>- <types>
>- <s:schema elementFormDefault="qualified"
>targetNamespace="http://tempuri.org/">
>- <s:element name="DoSomething">
>- <s:complexType>
>- <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="mdc"
>type="s0:MyDerivedClass" />
> </s:sequence>
> </s:complexType>
> </s:element>
>- <s:complexType name="MyDerivedClass">
>- <s:complexContent mixed="false">
>- <s:extension base="s0:MyBaseClass">
>- <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="s3" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="s4" type="s:string" />
> </s:sequence>
> </s:extension>
> </s:complexContent>
> </s:complexType>
>- <s:complexType name="MyBaseClass">
>- <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="s1" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="s2" type="s:string" />
> </s:sequence>
> </s:complexType>
>- <s:element name="DoSomethingResponse">
>- <s:complexType>
>- <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="DoSomethingResult"
>type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:schema>
> </types>
>- <message name="DoSomethingSoapIn">
> <part name="parameters" element="s0oSomething" />
> </message>
>- <message name="DoSomethingSoapOut">
> <part name="parameters" element="s0oSomethingResponse" />
> </message>
>- <portType name="Service1Soap">
>- <operation name="DoSomething">
> <input message="s0oSomethingSoapIn" />
> <output message="s0oSomethingSoapOut" />
> </operation>
> </portType>
>- <binding name="Service1Soap" type="s0:Service1Soap">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
>style="document" />
>- <operation name="DoSomething">
> <soapperation soapAction="http://tempuri.org/DoSomething"
>style="document" />
>- <input>
> <soap:body use="literal" />
> </input>
>- <output>
> <soap:body use="literal" />
> </output>
> </operation>
> </binding>
>- <service name="Service1">
>- <port name="Service1Soap" binding="s0:Service1Soap">
> <soap:address location="http://localhost/MyService/Service1.asmx" />
> </port>
> </service>
> </definitions>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fuji X-Pro 1 omits anti-aliasing filter David Dyer-Bennet Digital Photography 9 01-15-2012 06:22 AM
base class public type (non template and template base class) Hicham Mouline C++ 1 04-20-2009 03:28 PM
Can't authenticate to lists.asmx web service bparker ASP .Net Web Services 1 11-15-2006 03:20 PM
Access of base class' private base class: qualification required, why Alf P. Steinbach C++ 6 09-03-2005 04:03 PM
Format of compiler generated derived destructor when base has 'virtual ~base() throw():" qazmlp C++ 1 04-10-2005 03:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57