Change Web Method Naming

Last post 07-06-2009 2:50 AM by ManofStil. 2 replies.

Sort Posts:

  • Change Web Method Naming

    06-30-2009, 8:25 AM
    • Member
      point Member
    • ManofStil
    • Member since 07-10-2007, 3:55 AM
    • Posts 6

     Hello,

    I've got the following web method definition:

    <System.Web.Services.WebMethod(MessageName:="Create_Record")> _
            Public Function CreateNewRecord(ByVal Parameter1 As MyClass) As String

     

    So far, so good.
    When I want to create the parameter class of type "MyClass", I have to call it as follows:

    Dim newrecord As New MyWebService.Create_RecordParameter1()

     

    My question is: I don't want to have the parameter name in my method name.
    I'd rather to have something like:

    Dim newrecord As New MyWebService.Parameter1()
    MyWebServiceClass.CreateRecord(newrecord)


     How do I define the FINAL name of a method/parameter for my web service?

    Thank you in advance
    Kind regards
    MoS

  • Re: Change Web Method Naming

    07-04-2009, 10:44 PM

    Which version of .NET are you running, and which version of Visual Studio? I can't reproduce this problem.

    John Saunders
  • Re: Change Web Method Naming

    07-06-2009, 2:50 AM
    Answer
    • Member
      point Member
    • ManofStil
    • Member since 07-10-2007, 3:55 AM
    • Posts 6

    I am runnning VS 2005 TFS and corresponding .NET 2.0.

    But I just figured it out friday afternoon.

    In my class file (it was generated from an xsd-file) I removed the following line of code from each class:

    System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True)

    Then a whole lot of my problems and strange behaviors in the project were solved - including this strange naming. Now my methods are named right as they should. :)

    Thank you for looking into this.
    Maybe this helps someone who's got similar troubles.

    kind regards
    MoS

Page 1 of 1 (3 items)