Please help me Run web services from information stored in a datab

Discussion in 'ASP .Net Web Services' started by Alsi, Nov 3, 2005.

  1. Alsi

    Alsi Guest

    Hi Everyone,

    I have used "Add Web Reference" for consuming different web services.

    But currently I am trying to generate a generic Proxy Web Service that
    will be created and populated dynamically from the entries in the database
    which is my project work in a college.And I am really new in web programming,
    so any help from you all will be highly appreciated.
    Thank you
    Alsi, Nov 3, 2005
    #1
    1. Advertising

  2. I can't fully understand your question.
    Do you want to create a web service, that gets information from
    a database and publishes the information to the consumer?

    What do you mean by "generic"? Do you want the webservice
    to work generally with all tables and resultsets? Normally
    webservices are strictly typed, which means that you specify
    the types you want to return. Of course though, it's possible to
    create your own object model for representing database rows,
    columns, datatypes etc.

    Pls give some additional information on what you wanna achieve.

    regards
    Emil Kvarnhammar
    http://www.ynax.com


    "Alsi" <> wrote in message
    news:...
    > Hi Everyone,
    >
    > I have used "Add Web Reference" for consuming different web services.
    >
    > But currently I am trying to generate a generic Proxy Web Service that
    > will be created and populated dynamically from the entries in the database
    > which is my project work in a college.And I am really new in web
    > programming,
    > so any help from you all will be highly appreciated.
    > Thank you
    >
    Emil Kvarnhammar, Nov 3, 2005
    #2
    1. Advertising

  3. Alsi

    Alsi Guest

    Re: Please help me Run web services from information stored in a d

    â–ºSorry for not writing the question in details.

    My requirement is not as complicated as you had spelled out in the reply. In
    fact, the database will contain the string where the WSDL file could be found
    in the net. To give you an idea what string will be stored in the databse, I
    will store the string such as http://ws.strikeiron.com/EmailVerify?WSDL in
    the databse, read this string during the application execution.

    Once I have the string that describes where I can find the Web Service, I
    would like to pass this string to my Generic Proxy Class and be able to
    construct this Class on the fly and use it in my application. I am currently
    doing this by Adding Web Reference using Visual Studio which creates a proxy
    class and lets me instantiate and use the class in my application. It works
    really well but m,y professor wants me to be able to add an WSDL location
    entry in the database table and be able to dynamically create the proxy class
    so that I could expand the number of web services that could be invoked from
    my application without making any changes in the code.

    I don't know if my approach to create the proxy class dynamically from the
    WSDL location string is the right way to go but that is what came to my mind.
    Any alternate way of finding the Web Services from the application
    dynamically without having any references in the code is all I need. I would
    really appreciate if you could provide me some guidance or sample code that
    does this. I am using VB .NET and new to programming.

    Please send me an email at or post a reply here. I will
    be looking at this site 8-10 times a day to see if my question is replied :).

    Thanks a lot for your help.

    Usha


    "Emil Kvarnhammar" wrote:

    > I can't fully understand your question.
    > Do you want to create a web service, that gets information from
    > a database and publishes the information to the consumer?
    >
    > What do you mean by "generic"? Do you want the webservice
    > to work generally with all tables and resultsets? Normally
    > webservices are strictly typed, which means that you specify
    > the types you want to return. Of course though, it's possible to
    > create your own object model for representing database rows,
    > columns, datatypes etc.
    >
    > Pls give some additional information on what you wanna achieve.
    >
    > regards
    > Emil Kvarnhammar
    > http://www.ynax.com
    >
    >
    > "Alsi" <> wrote in message
    > news:...
    > > Hi Everyone,
    > >
    > > I have used "Add Web Reference" for consuming different web services.
    > >
    > > But currently I am trying to generate a generic Proxy Web Service that
    > > will be created and populated dynamically from the entries in the database
    > > which is my project work in a college.And I am really new in web
    > > programming,
    > > so any help from you all will be highly appreciated.
    > > Thank you
    > >

    >
    >
    >
    Alsi, Nov 3, 2005
    #3
  4. Alsi

    Alsi Guest

    Thanks Emil for your quick response and help.
    Sorry for not writing the question in details.

    My requirement is not as complicated as you had spelled out in the reply. In
    fact, the database will contain the string where the WSDL file could be found
    in the net. To give you an idea what string will be stored in the databse, I
    will store the string such as http://ws.strikeiron.com/EmailVerify?WSDL in
    the databse, read this string during the application execution.

    Once I have the string that describes where I can find the Web Service, I
    would like to pass this string to my Generic Proxy Class and be able to
    construct this Class on the fly and use it in my application. I am currently
    doing this by Adding Web Reference using Visual Studio which creates a proxy
    class and lets me instantiate and use the class in my application. It works
    really well but m,y professor wants me to be able to add an WSDL location
    entry in the database table and be able to dynamically create the proxy class
    so that I could expand the number of web services that could be invoked from
    my application without making any changes in the code.

    I don't know if my approach to create the proxy class dynamically from the
    WSDL location string is the right way to go but that is what came to my mind.
    Any alternate way of finding the Web Services from the application
    dynamically without having any references in the code is all I need. I would
    really appreciate if you could provide me some guidance or sample code that
    does this. I am using VB .NET and new to programming.

    Please send me an email at or post a reply here. I will
    be looking at this site 8-10 times a day to see if my question is replied :).

    Thanks a lot for your help.




    "Alsi" wrote:

    > Hi Everyone,
    >
    > I have used "Add Web Reference" for consuming different web services.
    >
    > But currently I am trying to generate a generic Proxy Web Service that
    > will be created and populated dynamically from the entries in the database
    > which is my project work in a college.And I am really new in web programming,
    > so any help from you all will be highly appreciated.
    > Thank you
    >
    Alsi, Nov 3, 2005
    #4
  5. Hi again,

    Still, I can't understand 100% clearly what your'e looking for.
    I can see two possible alternatives. Please let me know if I get your point,
    in any of these.

    Alt. 1)
    Do you want to set the URL depending on what you read from the database?

    In that case it's very simple. For your proxy (e.g. EmailVerifyProxy), just
    write code like this:

    //assume that you've read the url from the database, and stored the url in
    strUrlReadFromDatabase.
    EmailVerifyProxy p = new EmailVerifyProxy();
    p.Url = strUrlReadFromDatabase;

    That code would make the actual location (the URL) of your webservice
    dynamically.

    Alt. 2)
    Or do you really want to get the WSDL from the server (EmailVerify?WSDL),
    and
    generate proxy code on-the-fly for that WSDL-data? In that case, the easiest
    way
    is to use the wsdl.exe tool.
    If this is the case, then you could make a class that takes the URL (for
    example,
    http://ws.strikeiron.com/EmailVerify?WSDL) as constructor parameter, and
    then
    calls wsdl.exe with that URL as input. WSDL will
    Check out this link for info about wsdl.exe:
    http://msdn.microsoft.com/library/e...WebServicesDescriptionLanguageToolWsdlexe.asp
    If you then want to use the class that WSDL generated (that is, use it from
    within the
    same process as you generated the code), you'll have to compile it
    first to an assembly, and of course load the assembly using Reflection.
    It's a bit tricky, but it should work.



    Regards
    Emil Kvarnhammar




    "Alsi" <> wrote in message
    news:...
    > Thanks Emil for your quick response and help.
    > Sorry for not writing the question in details.
    >
    > My requirement is not as complicated as you had spelled out in the reply.
    > In
    > fact, the database will contain the string where the WSDL file could be
    > found
    > in the net. To give you an idea what string will be stored in the databse,
    > I
    > will store the string such as http://ws.strikeiron.com/EmailVerify?WSDL in
    > the databse, read this string during the application execution.
    >
    > Once I have the string that describes where I can find the Web Service, I
    > would like to pass this string to my Generic Proxy Class and be able to
    > construct this Class on the fly and use it in my application. I am
    > currently
    > doing this by Adding Web Reference using Visual Studio which creates a
    > proxy
    > class and lets me instantiate and use the class in my application. It
    > works
    > really well but m,y professor wants me to be able to add an WSDL location
    > entry in the database table and be able to dynamically create the proxy
    > class
    > so that I could expand the number of web services that could be invoked
    > from
    > my application without making any changes in the code.
    >
    > I don't know if my approach to create the proxy class dynamically from the
    > WSDL location string is the right way to go but that is what came to my
    > mind.
    > Any alternate way of finding the Web Services from the application
    > dynamically without having any references in the code is all I need. I
    > would
    > really appreciate if you could provide me some guidance or sample code
    > that
    > does this. I am using VB .NET and new to programming.
    >
    > Please send me an email at or post a reply here. I
    > will
    > be looking at this site 8-10 times a day to see if my question is replied
    > :).
    >
    > Thanks a lot for your help.
    >
    >
    >
    >
    > "Alsi" wrote:
    >
    >> Hi Everyone,
    >>
    >> I have used "Add Web Reference" for consuming different web services.
    >>
    >> But currently I am trying to generate a generic Proxy Web Service that
    >> will be created and populated dynamically from the entries in the
    >> database
    >> which is my project work in a college.And I am really new in web
    >> programming,
    >> so any help from you all will be highly appreciated.
    >> Thank you
    >>
    Emil Kvarnhammar, Nov 3, 2005
    #5
    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. Nick
    Replies:
    1
    Views:
    6,117
    Alvin Bruney - ASP.NET MVP
    Sep 12, 2005
  2. Anup
    Replies:
    1
    Views:
    2,774
    Mark Rae
    May 9, 2006
  3. KK
    Replies:
    2
    Views:
    546
    Big Brian
    Oct 14, 2003
  4. Replies:
    1
    Views:
    286
    bruce barker
    Jan 18, 2007
  5. John
    Replies:
    4
    Views:
    427
Loading...

Share This Page