Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8127417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:31:25+00:00 2026-06-06T07:31:25+00:00

I am trying to setup a simple proxy server that we post the data

  • 0

I am trying to setup a simple proxy server that we post the data to my proxy server. The proxy server will take the posted data forward it on to the actual server and get the response from the actual server. Then display the response on the proxy server which the website that made the request reads and does whatever with the data.
I am having trouble with the first part in getting the raw post data that is coming from the website. It appears the asmx file always wants to do things off of parameters but my proxy just want to forward on the raw request. It does not know the parameters. Below is an example request to the proxy server:
localhost/mobile.asmx
POST
{“userName”:”fake@email.com”,”password”:”xxxx”,”appID”:”2302FF64-925D-4E0E-B086-73AA9FF152D8″}

Once again I do not want to just get the username and password. I want to capture the full raw request and forward it on to the real server.

I have tried tons of things. Because there is no request parameter I can not use request. I also believe the function GETUSERTOKENLOGIN takes place after the stream of raw post data is read so I can no longer use a stream to get the data. I have tried quite a few things.

I want this to be a super simple script if possible. Below is my super simple example. I know I can just add a wrapper around the data but I would like to not have to do that.

Any help would be greatly appreciated.
MOBILE.ASMX

<%@ WebService Language="C#" Class="mobile" %>

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Net;
using System.IO;
using System.Web.Script.Services;
using System.Text;
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]
public class mobile : System.Web.Services.WebService 
{
    public mobile()
    {


    }

    // The HelloWorld() example service returns the string Hello World.
    [WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    public string GetUserTokenLogin()
    {
        // Create a new request to the mentioned URL.
        WebRequest myWebRequest = WebRequest.Create("http://api.geonames.org/citiesJSON");
        myWebRequest.Method = "POST";
        Stream dataStream = myWebRequest.GetRequestStream();
        WebResponse myWebResponse = myWebRequest.GetResponse();

        // Print the  HTML contents of the page to the console.
        Stream streamResponse = myWebResponse.GetResponseStream();
        StreamReader streamRead = new StreamReader(streamResponse);
        Char[] readBuff = new Char[256];
        int count = streamRead.Read(readBuff, 0, 256);
        String FullData = "";
        while (count > 0)
        {
            String outputData = new String(readBuff, 0, count);
            FullData = FullData + outputData;
            count = streamRead.Read(readBuff, 0, 256);
        }

        // Close the Stream object.
        streamResponse.Close();
        streamRead.Close();

        myWebResponse.Close();
        return FullData;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:31:27+00:00Added an answer on June 6, 2026 at 7:31 am

    Parsing the request is the job of your application server.

    Your proxy server should not have any application code on it.
    If all you want to do is use IIS as a proxy server, refer: Setting up IIS as a reverse proxy.

    If you only want the raw request and want to write out your raw response, you could create a custom HttpModule.

    Refer: Creating a custom HttpModule

    In this module, you can get the request as the client sent it, and forward it to another server, and then, take the response from that server and forward it to your client. (In effect you are making a reverse proxy.)

    There is no way you could achieve this within a asp.net webservice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup a simple timer that gets started from a Rails Application.
I am trying to setup a simple UDP client and server using Ruby. The
I am trying to setup a simple function which will make it a lot
I'm trying to setup a very simple ServerSocket in an Android app that responds
I'm trying to learn Flex, I setup a simple Air application with PHP server
In an academic project I'm trying to setup a simple physics engine. I am
I setup a Paypal Sandbox account and am trying to create simple purchases through
I'm trying to make a simple base war which includes all the boilerplate setup
I'm trying to set up a simple server side RSA encryption of a small
I'm trying to setup a simple has_many :through => association. I have 3 models.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.