|
|
|
start date: Fri, 06 Jul 2007 12:34:39 -0400,
posted on: microsoft.public.dotnet.framework.aspnet.webservices
back
| Thread Index |
|
1
lucius am
|
|
2
John Saunders [MVP] john.saunders at trizetto.com
|
|
3
(Steven Cheng[MSFT])
|
|
4
lucius am
|
|
5
(Steven Cheng[MSFT])
|
|
6
(Steven Cheng[MSFT])
|
|
7
lucius am
|
|
8
(Steven Cheng[MSFT])
|
|
9
(Walter Wang [MSFT])
|
Include Verbose Description?
I have several WebMethods in my 2.0 system decorated like this:
[WebMethodAttribute(Description=".....
I have XML comments that describe the actual parameters.
I would like to copy those comments (or use them directly) so they are
visible like in the WebMethodAttribute. What is a good way to do that?
Thanks.
Date:Fri, 06 Jul 2007 12:34:39 -0400
Author:
|
Re: Include Verbose Description?
"lucius" <lucius@newsgroup.nospam> wrote in message
news:6krs83p5a6ni78ejj21hio09tu8epk53ja@4ax.com...
>
> I have several WebMethods in my 2.0 system decorated like this:
>
> [WebMethodAttribute(Description=".....
>
> I have XML comments that describe the actual parameters.
>
> I would like to copy those comments (or use them directly) so they are
> visible like in the WebMethodAttribute. What is a good way to do that?
I don't believe there's a way to do that. The Description property of the
WebMethodAttribute gets copied into the WSDL file when the WSDL is generated
from the code. Since the WSDL is generated through Reflection, and since
Reflection has no access to code comments, I think you're out of luck.
--
John Saunders [MVP]
P.S. There are things you can do to customize how the WSDL is generated.
They're complex, and I've never used them, nor known anyone who has.
Date:Fri, 6 Jul 2007 13:29:31 -0400
Author:
|
Re: Include Verbose Description?
Hi Lucius,
For the webservice webmethod "description" attribute, if you mean manually
copy some comments(xml or plain text) into it, I think it is doable. You
can directly add xml content into it and they'll be displayed in the
webservice's WSDL document(in the "portType" section). e.g.
the following description setting (contains some XML datdad) will result to
the sequential WSDL portType fragment
===============
[WebMethod(Description=@"
<comment><param1>param1</param1><param2>param2</param2></comment>
")]
public string HelloWorld()
{
return "Hello World";
}
===================
#note that the "description" property content is not displayed as part of
the WSDL document( but is escapted as CDATA like content)
==============
</wsdl:message>
- <wsdl ortType name="SecurityServiceSoap">
- <wsdl peration name="HelloWorld">
<wsdl ocumentation
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><comment><param1>param1</param
1><param2>param2</param2></comment></wsdl ocumentation>
<wsdl:input message="tns:HelloWorldSoapIn" />
<wsdl utput message="tns:HelloWorldSoapOut" />
</wsdl peration>
</wsdl ortType>
=======================
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Mon, 09 Jul 2007 07:54:14 GMT
Author:
|
Re: Include Verbose Description?
I do not want to do anything manual. I want to take the
developer-created comments automatically and expose them.
I do not mind changing my "///" comments to custom "comment"
Attributes or something, but I would need to see how to create that
Attribute class and how to get instances written into the WSDL at
build-time as CDATA or an equivalent.
Maybe something called "WebMethodCommentAttribute" with appropriate
de/serialization stuff so it can be shown in the WSDL?
Thanks.
On Mon, 09 Jul 2007 07:54:14 GMT, stcheng@online.microsoft.com (Steven
Cheng[MSFT]) wrote:
>Hi Lucius,
>
>For the webservice webmethod "description" attribute, if you mean manually
>copy some comments(xml or plain text) into it, I think it is doable. You
>can directly add xml content into it and they'll be displayed in the
>webservice's WSDL document(in the "portType" section). e.g.
>
>the following description setting (contains some XML datdad) will result to
>the sequential WSDL portType fragment
>===============
> [WebMethod(Description=@"
><comment><param1>param1</param1><param2>param2</param2></comment>
>")]
>
> public string HelloWorld()
> {
> return "Hello World";
> }
Date:Mon, 09 Jul 2007 10:46:33 -0400
Author:
|
Re: Include Verbose Description?
Thanks for your reply Lucius,
I haven't implemented such a functionality , I think it would hard to do it
automatically. Here is a MSDN reference which mentioned customize the
generation of the webservice service description, you can have a look:
#Walkthrough: Customizing the Generation of Service Descriptions and Proxy
Classes
http://msdn2.microsoft.com/en-us/library/x4s9z3yc.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Wed, 11 Jul 2007 03:44:53 GMT
Author:
|
Re: Include Verbose Description?
Hi Lucius,
Does the information in previous message help some? If there is anything
else we can help, please feel free to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Fri, 13 Jul 2007 07:09:57 GMT
Author:
|
Re: Include Verbose Description?
No, I did not understand everything that was happening there. Please
post a code sample showing the minimal code required to meet my needs
so I can work it into a comprehensive solution.
Thanks.
On Fri, 13 Jul 2007 07:09:57 GMT, stcheng@online.microsoft.com (Steven
Cheng[MSFT]) wrote:
>Hi Lucius,
>
>Does the information in previous message help some? If there is anything
>else we can help, please feel free to post here.
>
>Sincerely,
>
>Steven Cheng
>
>Microsoft MSDN Online Support Lead
>
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Tue, 17 Jul 2007 19:44:50 -0400
Author:
|
Re: Include Verbose Description?
Thanks for your followup Lucius,
Well, I have managed to create a simple test WSDL reflector class which
modify each webMethod's "description" programmatically:
<<<<<<<<<<<<<<<<<<<<<<<
public class WSDLReflector : SoapExtensionReflector
{
public override void ReflectMethod()
{
//no-op
}
public override void ReflectDescription()
{
// you can use your own code logic to generate the description to assigned
to the MethodInfo(which will be displayed in WSDL)
ReflectionContext.MethodAttribute.Description = "..........new
description";
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>
For how to configure and apply such custom Reflector class, you can refer
to the following articles which has complete guide:
#Modify a Web Service's WSDL Using a SoapExtensionReflector
http://blogs.msdn.com/kaevans/archive/2005/11/16/493496.aspx
#How to: Customize the Generation of Service Descriptions and Proxy Classes
http://msdn2.microsoft.com/en-us/library/f9hatst6.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Thu, 19 Jul 2007 11:22:25 GMT
Author:
|
Re: Include Verbose Description?
Hi Lucius,
Have you seen Steven's reply above? Please let us know if there's anything
else we can help. Thanks.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Mon, 23 Jul 2007 09:55:39 GMT
Author:
|
|
|