Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 12th, 2008, 06:51 AM
Registered User
 
Join Date: Sep 2008
Location: Pune, , India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get client side encoded request in web serv

1) Client Side: (in Java)

Suppose my username = testuser and password = test123;
Then code like this :

String login = username+":"+password;

// Stream connection object used to establish the communication with the server.
StreamConnection = StreamConnection)Connector.open(“https://192.168.1.68/sample.asmx/login”);

// Http connection object used to communicate with the server.
HttpsConnection httpConn = (HttpsConnection)strConn;

//Encode the login information in Base64 format.
 byte[] encoded = Base64OutputStream.encode(login.getBytes(), 0, login.length(), false, false);

httpConn.setRequestProperty(auth, authType + new String(encoded));

================================================== =================
2) On server side (C# web service) how i access this encoded request.

After getting this request I know how to decode it and doing further procedure. Only I want know the how I get this http request.


Jitu
  #2 (permalink)  
Old October 29th, 2008, 04:44 PM
Authorized User
 
Join Date: Nov 2006
Location: Valparaiso, IN, USA.
Posts: 93
Thanks: 0
Thanked 1 Time in 1 Post
Default

You should be able to use the System.Net.HttpWebRequest Class.

HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://www.anywhere.com/");

the HttpWebRequest.Credentials will allow you to set the credentials required by the server. I'm not really sure what you are doing with StreamConnection ...


What you don't know can hurt you!
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Converting Client-side to Server-side Code kwilliams ASP.NET 2.0 Professional 1 November 21st, 2007 05:25 PM
Firing server side events at client side codes mehdi62b ASP.NET 1.0 and 1.1 Basics 6 May 18th, 2005 09:11 AM
How to get request parameters on client-side arcuza XSLT 6 March 22nd, 2005 09:13 AM
Identify culture(of the client) from web request a madkaikar_ashish General .NET 2 February 2nd, 2005 01:04 PM
sharing a server-side variable with client-side pigtail Javascript How-To 6 November 4th, 2004 02:01 AM



All times are GMT -4. The time now is 02:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.