List parameters of the Web Service

Discussion in 'ASP .Net Web Services' started by hulkko123@yahoo.com, Feb 13, 2006.

  1. Guest

    Hello,

    Is it possible to list parameters and their types when you are using
    [WebMethod (Description ()] tag or any else tag?

    I couldn't find any lineseparator characters to Description attribute
    when I was trying
    to list parameters in hardcoded way. All parameters came is one big
    line.

    So, how should I list Web Methods parameteters if I like to show them
    to user?
    Such situations are e.g. when user or programmer pressed F5 or ctrl-F5
    in Visua Studio
    when the Web Service project is open and (s)he want to test Web
    Service.

    Any ideas?

    Cheers!
    , Feb 13, 2006
    #1
    1. Advertising

  2. Josh Twist Guest

    Hello,

    I'm not sure I understand your question... If your WebMethod has
    parameters - you'd be able to see them right there in the code?

    [WebMethod]
    public string SayHello(string name)
    {
    return "Hello" + name;
    }

    They's also be visible in the WSDL and help page generated by ASP.NET
    (browse to your .asmx page to see the help page, click Service
    Description to see the WSDL).

    Josh
    http://www.thejoyofcode.com/
    Josh Twist, Feb 13, 2006
    #2
    1. Advertising

  3. Simon Hart Guest

    If you mean when navigating to the .ASMX page using a browser, then append
    ?wsdl on the end.

    Simon Hart.

    <> wrote in message
    news:...
    > Hello,
    >
    > Is it possible to list parameters and their types when you are using
    > [WebMethod (Description ()] tag or any else tag?
    >
    > I couldn't find any lineseparator characters to Description attribute
    > when I was trying
    > to list parameters in hardcoded way. All parameters came is one big
    > line.
    >
    > So, how should I list Web Methods parameteters if I like to show them
    > to user?
    > Such situations are e.g. when user or programmer pressed F5 or ctrl-F5
    > in Visua Studio
    > when the Web Service project is open and (s)he want to test Web
    > Service.
    >
    > Any ideas?
    >
    > Cheers!
    >
    Simon Hart, Feb 13, 2006
    #3
  4. Guest

    "Problem" occurs usually when we have multisuplier projects.
    Documents are usually not yet updated and we have to use other vendors
    Web service methods.
    It would help a lot if we would know what kind of parameter Web Service
    methods excatly wants.
    That would also help application programmers when they call these
    methods.
    Every method of course checks it parameters before it's executes so,
    knowing what kind of parameter
    a Service wants would help a lot (less error calls).
    E.g. information considering parameters could be format, length, sets
    that are valid etc. and that would help a lot.
    Something like this:

    [WebMethod]
    [Attribute Param1 = "[0-9]{5}"]
    [Attribute Param2 = "[A-Z]{10}"]
    [Attribute Param3 = "(ABC)|(DEF)|(GHI)"]
    public string WSMethod(string param1, string param2, string param3 ...
    )
    {
    // Logic coded here
    }

    I don't know the syntax for this Attribute but that is the actual
    question.

    Cheers!
    , Feb 13, 2006
    #4
  5. Guest

    Yep, that shows the wsdl but if there is business kind of rules for
    parameter values
    wsdl doesn't seems to help.. or are there any ways to do it using wsdl?

    Cheers!
    , Feb 13, 2006
    #5
  6. Simon Hart Guest

    Sorry I don't follow, business rules? do you mean documentation for
    parameters, if so I don't know of any way. Web services are supposed to be
    self describing.

    Simon Hart.

    <> wrote in message
    news:...
    > Yep, that shows the wsdl but if there is business kind of rules for
    > parameter values
    > wsdl doesn't seems to help.. or are there any ways to do it using wsdl?
    >
    > Cheers!
    >
    Simon Hart, Feb 13, 2006
    #6
  7. Guest Guest

    So what is "self descriping"? That is the main question. That is missing
    often.
    Think about e.g. Identity number of the person in Air field.
    Clerk is behind desk and a foreign passanger comes.
    Clerk needs to know the format of the foreign passanger.
    Ok, application tells to that clerk the rigth format but the programmer
    of that application must know the excat format of the Identity number that
    belongs to passanger depending his/hers nationality.

    How can a programmer validate it? (S)he must just know it precisely. Like I
    said
    in multivendor projects documentation is quite often poor so a "self
    descriping"
    Web Service would offer the right format by showing the format that it
    expects.

    What I mean is that it would be nice that C# Web Service would show to
    programmer
    what kind (format) parameters is wants. This is how we cut down Web Service
    calls that has
    parameters in wrong format.

    In e.g VS.NET by pressing F5 it would be nive if we could inform the excat
    format of parameters that
    that Service wants, not only name of the parameter.

    Am I makíng myself more clear now?

    Cheers!



    "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message
    news:...
    > Sorry I don't follow, business rules? do you mean documentation for
    > parameters, if so I don't know of any way. Web services are supposed to be
    > self describing.
    >
    > Simon Hart.
    >
    > <> wrote in message
    > news:...
    >> Yep, that shows the wsdl but if there is business kind of rules for
    >> parameter values
    >> wsdl doesn't seems to help.. or are there any ways to do it using wsdl?
    >>
    >> Cheers!
    >>

    >
    >
    Guest, Feb 14, 2006
    #7
  8. Josh Twist Guest

    The WSDL is how Web Services are self describing. The WSDL contains
    information that can be read by other computers including:

    The endpoint (url) of the web service
    The names of methods available in the service
    The names of parameters
    and... information about the type of parameters and return types

    It's important to note that Web Services do not share Type they share
    contract (or schema) - what that means is that the WSDL contains a
    representation of your Types that can be understood by any programming
    language that can interpret WSDL. It's what makes web services
    interoperable.

    Josh
    http://www.thejoyofcode.com/
    Josh Twist, Feb 14, 2006
    #8
  9. Simon Hart Guest

    OK. So I take it you have maybe a string field or a predefined type and it
    has to be in a particular format.

    One way you could offer help to the programmer by the means of in-line
    documentation:

    /// <summary>

    /// Posts the current transaction data currently held in local stack
    relevant to the passed

    /// terminal ID.

    /// </summary>

    /// <param name="termID">The terminal identifier, not be greater than 10
    bytes</param>

    [WebMethod (Description="Posts the passed terminal identifier data into
    Equator")]

    public void Post(string termID)

    {

    }



    Something like the above will work through intellisense.

    Simon.

    <> wrote in message
    news:dstav7$tk3$...
    > So what is "self descriping"? That is the main question. That is missing
    > often.
    > Think about e.g. Identity number of the person in Air field.
    > Clerk is behind desk and a foreign passanger comes.
    > Clerk needs to know the format of the foreign passanger.
    > Ok, application tells to that clerk the rigth format but the programmer
    > of that application must know the excat format of the Identity number that
    > belongs to passanger depending his/hers nationality.
    >
    > How can a programmer validate it? (S)he must just know it precisely. Like
    > I said
    > in multivendor projects documentation is quite often poor so a "self
    > descriping"
    > Web Service would offer the right format by showing the format that it
    > expects.
    >
    > What I mean is that it would be nice that C# Web Service would show to
    > programmer
    > what kind (format) parameters is wants. This is how we cut down Web
    > Service calls that has
    > parameters in wrong format.
    >
    > In e.g VS.NET by pressing F5 it would be nive if we could inform the
    > excat format of parameters that
    > that Service wants, not only name of the parameter.
    >
    > Am I makíng myself more clear now?
    >
    > Cheers!
    >
    >
    >
    > "Simon Hart" <srhartone@[no spam]yahoo.com> wrote in message
    > news:...
    >> Sorry I don't follow, business rules? do you mean documentation for
    >> parameters, if so I don't know of any way. Web services are supposed to
    >> be self describing.
    >>
    >> Simon Hart.
    >>
    >> <> wrote in message
    >> news:...
    >>> Yep, that shows the wsdl but if there is business kind of rules for
    >>> parameter values
    >>> wsdl doesn't seems to help.. or are there any ways to do it using wsdl?
    >>>
    >>> Cheers!
    >>>

    >>
    >>

    >
    >
    Simon Hart, Feb 15, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hocho888
    Replies:
    1
    Views:
    601
  2. Michael Averstegge
    Replies:
    0
    Views:
    4,191
    Michael Averstegge
    Jan 10, 2006
  3. Not Me
    Replies:
    1
    Views:
    3,164
    Not Me
    Jun 5, 2007
  4. Isaias Formacio Serna

    Web Service that calls an external Web Service

    Isaias Formacio Serna, Jan 28, 2004, in forum: ASP .Net Security
    Replies:
    5
    Views:
    233
  5. Leo Violette
    Replies:
    0
    Views:
    993
    Leo Violette
    Apr 17, 2009
Loading...

Share This Page