Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Web Service

Posted on 2013-05-30
4
Medium Priority
?
319 Views
Last Modified: 2013-11-19
I am new to C#.net web service and have a short project that I needed to take input url with a parameter like SessionId then pull the user info from our database and redirect that to third party server.

For an example:  
      User input http://localhost/creditcard?SessionId=bd2df925-8ef0-43b6-aa51-f5f396439da1

and my code will redirect that to

    https://www.thirdparty.com/creditcard/test.do?account_number=1234

I have coded the web service and it takes the session id and output with xml url.  I needed to take the session id directly from the browser and redirecting that to the
https://www.thirdparty.com/creditcard/test.do?account_number=1234

following are the coding
DataHelper.cs
Service1.asmx.cs
0
Comment
Question by:eli411
  • 2
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 2000 total points
ID: 39218079
i think you should return the url to the requester and not make a redirect inside the web service
0
 
LVL 2

Author Comment

by:eli411
ID: 39220428
I needed to create a web form and take the query string and pass the parameters from the web form into web service then return the value back to web form.  I understand that and needed a sample coding in the web form where I can accept the url with a parameter then redirect to different url with more parameters extracted from the web service.

any samples will helped!  I had been searching the web for the last couple days and still have not find my solution.
0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 39221161
hi

creating a web service is very easy
open your visual studio 2008and select new project
then select a type to be web service

after that you will see a page called service1.asmx

with an example function hello word

now let me show u one code
  <WebMethod()> _
    Public Function MyFirstWS(  ByVal Parm As String ) As String
' here this function accept a parameter of type string and return a string value
'here write you code

   dim x as string="123"
return x

end function

' now in your web form project go to your project then right click and click add web 'reference
'put the url of the webservice and add it
'then call the method and pass ur parameter
'

Open in new window


see the following
http://www.codeproject.com/Articles/337535/Understanding-the-Basics-of-Web-Service-in-ASP-NET

http://www.codeproject.com/Articles/1231/ASP-NET-Web-Service
0
 
LVL 2

Author Comment

by:eli411
ID: 39229405
I transfered the code by using Web Form!  The web service is not for what I needed afterall!  I will still give out point to those who helped!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
When you put your credit card number into a website for an online transaction, surely you know to look for signs of a secure website such as the padlock icon in the web browser or the green address bar.  This is one way to protect yourself from oth…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question