I need to build a web page to call a web service and return the result to me.

Hi,

I want to make a web page, so that when I call it, it invokes a web service and simply return the result to me.

The idea is to use ......

http://www.mydomain.com/login/user/password    (this must to return a result as text string).

....... using the values ¿¿"user" and "password" as parameters.

Following my Web Service sample:

Imports My
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Script.Services
Imports System.Xml
Imports System.Data
Imports System.IO
Imports System.Windows.Forms
Imports Microsoft.AnalysisServices
Imports Utilities.Utilities
Imports System.Diagnostics

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<System.Web.Script.Services.ScriptService()> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class DPNetServices
Inherits System.Web.Services.WebService

' Web Services para mobiles

 <WebMethod(EnableSession:=True)> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
Public Function ManageMobileUsers(ByVal UsrNmb As String, ByVal UsrPwd As String) As String

' This function return a JSON text

Return appm.DBProc.ManageMobileUsers(UsrNmb, UsrPwd)

End Function

End Class


Anybody call help with it, please?

I have not experience in web pages.

Thanks in advance,

Jonny
JonyTolengoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
You will need to create an instance of a proxy class to call the web method, and return the JSON string.

Explanation:

Web Services with ASP.NET
http://msdn.microsoft.com/en-us/library/ms972326.aspx
0
JonyTolengoAuthor Commented:
Thanks for your response, but I can do it by myself, remember that I mentioned that I have not skills in web development.

Could you show me exactly how the web page is?

Sorry for my ignorance,

Thanks in advance,

Jonny
0
Bob LearnedCommented:
Let's try some steps, as this is a perfect learning opportunity.

1) Add a web reference to the web service, by right-clicking on the project node in the Solution Explorer, and selecting 'Add Service Reference'.   There are 2 flavors of web services, and if you have a legacy ASP.NET web service (and not a WCF service), then there is an <Advanced> button that you can use to add a service reference using the old method.  At the bottom of the advanced dialog is the Compatibility section, with an <Add Web Reference> button.  Visual Studio will generate a proxy class, that you can use to call a web method.

2) Create an instance of the proxy class.  In the referenced article, under the "Using the Web Service" section, there is an example of creating an instance of a class, and calling the GetCounters web method.

Dim perfcounters As New PerfCounters
    Dim counters As Counters = perfcounters.GetCounters()

    webapp.InnerHtml = counters.ApplicationName
    restarts.InnerHtml = counters.WorkerProcessRestarts.ToString()
    procrunning.InnerHtml = counters.WorkerProcessRunning.ToString()
    apprunning.InnerHtml = counters.ApplicationsRunning.ToString()
    queued.InnerHtml = counters.RequestsQueued.ToString()
    totalrequests.InnerHtml = counters.RequestsTotal.ToString()
    failedrequests.InnerHtml = counters.RequestsFailed.ToString()
    succeededrequests.InnerHtml = counters.RequestsSucceeded.ToString()
    activesessions.InnerHtml = counters.ActiveSessions.ToString()

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JonyTolengoAuthor Commented:
Thanks so much.!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.