Results 1 to 3 of 3

Thread: Changing method signature results in an exception

  1. #1
    Join Date
    Oct 2005
    Location
    Belgium
    Posts
    213

    Default Changing method signature results in an exception

    First, download the code you can find here. It's a very basic sample I wrote a while ago on building webservices with spring.net.

    Run the sample, your service will start and you'll get a form. Close the application. So far so good.

    However, consider yourself doomed from this point on . The two methods in the service will now and forever, have a parameter of type RetrieveProductsRequest or SearchProductsRequest respectively.

    Code:
        public interface IProductService
        {
            RetrieveProductsResponse RetrieveProducts(RetrieveProductsRequest request);
            SearchProductsResponse SearchProducts(SearchProductsRequest request);
    
        }
    If you dare changing or removing them you'll get this exception:

    "The XML element 'SearchProductsResponse' from namespace ' ' references a method and a type. Change the method's message name using WebMethodAttribute or change the type's root element using the XmlRootAttribute."

    Which is odd.

    Adding more parameters to the methdos and removing them is no problem at all. Even adding new methods works fine, just these original two don't want to change.

    If anyone can shed some light on this....

  2. #2
    Join Date
    Oct 2005
    Location
    Toulouse, France
    Posts
    1,409

    Default

    Hi,

    This is a .NET Framework bug, not related to Spring.NET.
    Try it with a classic asmx file without Spring, you'll get the same error.

    The .NET Framework adds the suffix "Response" to the method name to create the WSDL operation name. So we'll have both operation (method) and type with the same name. That may be a reason.


    Better late than never,
    Bruno
    My english is as poor as my taylor is rich

  3. #3
    Join Date
    Oct 2005
    Location
    Belgium
    Posts
    213

    Default

    Thanks for the reply, I never ran into this issue at work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •