Please help!!!!!

Discussion in 'ASP .Net Web Services' started by imonline, Nov 24, 2006.

  1. imonline

    imonline Guest

    Hi,
    I want to create a web method which would return different
    values on different time. Like when i submit an input and if there is
    any problem in it it should return exception xml otherwise normal
    xml...


    How do i implement this? Please let me know. Any help is
    highly appreciated!!


    Thanks,
    Nis
     
    imonline, Nov 24, 2006
    #1
    1. Advertising

  2. imonline

    Scott M. Guest

    VB.NET

    <WebMethod> Public Function checkStatus(X As Object) As String

    If X (your logic here) Then
    'Everything is good
    Return "<Result>No problems</Result>"
    Else
    'Something is bad
    Return "<Result>Problems Encountered</Result>"
    End If

    End Function

    C#

    [WebMethod] Public String checkStatus(Object X)
    {
    if (X [your logic here])
    {
    //Everything is good
    return "<Result>No problems</Result>"
    }
    else
    {
    //Something is bad
    return "<Result>Problems Encountered</Result>"
    }
    }



    "imonline" <> wrote in message
    news:...
    > Hi,
    > I want to create a web method which would return different
    > values on different time. Like when i submit an input and if there is
    > any problem in it it should return exception xml otherwise normal
    > xml...
    >
    >
    > How do i implement this? Please let me know. Any help is
    > highly appreciated!!
    >
    >
    > Thanks,
    > Nis
    >
     
    Scott M., Nov 25, 2006
    #2
    1. Advertising

  3. imonline

    imonline Guest

    Hi Scott,
    Thanks for the reply. I have got an alternative.


    thanks,
    Nis
    Scott M. wrote:
    > VB.NET
    >
    > <WebMethod> Public Function checkStatus(X As Object) As String
    >
    > If X (your logic here) Then
    > 'Everything is good
    > Return "<Result>No problems</Result>"
    > Else
    > 'Something is bad
    > Return "<Result>Problems Encountered</Result>"
    > End If
    >
    > End Function
    >
    > C#
    >
    > [WebMethod] Public String checkStatus(Object X)
    > {
    > if (X [your logic here])
    > {
    > //Everything is good
    > return "<Result>No problems</Result>"
    > }
    > else
    > {
    > //Something is bad
    > return "<Result>Problems Encountered</Result>"
    > }
    > }
    >
    >
    >
    > "imonline" <> wrote in message
    > news:...
    > > Hi,
    > > I want to create a web method which would return different
    > > values on different time. Like when i submit an input and if there is
    > > any problem in it it should return exception xml otherwise normal
    > > xml...
    > >
    > >
    > > How do i implement this? Please let me know. Any help is
    > > highly appreciated!!
    > >
    > >
    > > Thanks,
    > > Nis
    > >
     
    imonline, Nov 25, 2006
    #3
    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. JC
    Replies:
    4
    Views:
    7,980
    Jeff C
    Jul 8, 2004
  2. Replies:
    4
    Views:
    525
    Chris Uppal
    May 5, 2005
  3. KK
    Replies:
    2
    Views:
    598
    Big Brian
    Oct 14, 2003
  4. MuZZy
    Replies:
    7
    Views:
    1,770
    Mike Hewson
    Jan 7, 2005
  5. mera
    Replies:
    7
    Views:
    1,114
Loading...

Share This Page