jitu

jitu

  • NA
  • 1
  • 0

How to get client side encoded request in web service

Sep 12 2008 6:35 AM

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.