Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2008, 06:51 AM
Registered User
 
Join Date: Sep 2008
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
 
Old October 29th, 2008, 04:44 PM
Authorized User
 
Join Date: Nov 2006
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!





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





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