• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Is overloading a WebMethod OK?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Is overloading a WebMethod OK?

    Could do with overloading one of the methods on a .NET service i'm currently writing. I can define a seperate MessageName:="xxx" attribute for the methods but then .NET 3.5 throws "Service 'Durbs.WebService' does not conform to WS-I Basic Profile v1.1. Please examine each of the normative statement violations below..."

    I can sort this by changing:

    <System.Web.Services.WebServiceBinding(ConformsTo: =WsiProfiles.BasicProfile1_1)>

    to

    <System.Web.Services.WebServiceBinding(ConformsTo: =WsiProfiles.None)>

    And all seems happy when consumed via the browser and SoapUi.

    But, it still shows warnings in the browser about this BasicProfile1_1 non-conformance

    Is this going to cause me any problems with any particular consumers? Is there a reason why that WsiProfiles thing prohibits it? Can't see anything wrong with doing it (and i'm sure earllier .NET didnt complain), but for all I know, this is a big no-no in Java or something?
    Last edited by Durbs; 15 March 2010, 15:18.

    #2
    S'ok, sacked it off.

    Turns out SoapUI moans too (Duplicate operation names in portType) during a WSI compliance test as .NET sticks duplicate entries in the WSDL file for PortType on an overloaded method. Method itself works fine though in both its forms.

    I'll have 2 seperate methods, less hassle.

    Comment


      #3
      Just to confirm, you cannot overload a web method.

      This is a limitation of the WS-I/WSDL spec, rather than a .net issue.

      TM

      Comment


        #4
        Just goes to prove:

        Those who do not know CORBA are doomed to re-implement it...badly.
        Insanity: repeating the same actions, but expecting different results.
        threadeds website, and here's my blog.

        Comment


          #5
          Originally posted by threaded View Post
          Just goes to prove:

          Those who do not know CORBA are doomed to re-implement it...badly.
          If only someone had implemented CORBA badly before they wrote the standards, we might not need to have another go.
          While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

          Comment


            #6
            You can sort of overload by specifying the MessageName property:

            Link (about half way down the page)

            It doesn't help much in that you still have to consume the name specified in MessageName, but might make you feel better!

            Comment

            Working...
            X