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

  • SEARCH
  • Home
  • 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 119335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:38:12+00:00 2026-05-11T03:38:12+00:00

I have a web service that I can only hit if I’m logged into

  • 0

I have a web service that I can only hit if I’m logged into the website that the web service is on. I need to test the service remotely. So I’ve written some code to create a fake session that is logged into the site in another browser. Then I made the HTTP Web Request and I’m attempting to set a cookie that contains the ASP.NET session ID of that logged in user. But the web service doesn’t detect that the web request is a logged in user or session. What do I need to give the web service to convince it this is a valid session?

// used on each read operation  byte[] buf = new byte[8192];  CookieContainer myContainer = new CookieContainer();  string sessionID = SessionID;  myContainer.Add(new Cookie('ASP.NET_SessionId', sessionID, '/', WebsiteUrl));  // prepare the web page we will be asking for HttpWebRequest request = (HttpWebRequest)     WebRequest.Create(CreateWebserviceUrl('doneScreenScore')); request.ContentType = 'text/xml; charset=utf-8';             request.Method = 'POST'; request.Accept = 'text/xml'; request.Headers.Add('SOAPAction', 'http://detectent.net/doneScreenScore');  request.CookieContainer = myContainer;  Stream s = request.GetRequestStream();  string soaprequest = ''; soaprequest += '<?xml version=\'1.0\' encoding=\'utf-8\'?>'; soaprequest += '<soap12:Envelope xmlns:xsi=\'http://www.w3.org/2001/XMLSchema-instance\' xmlns:xsd=\'http://www.w3.org/2001/XMLSchema\' xmlns:soap12=\'http://www.w3.org/2003/05/soap-envelope\'>'; soaprequest += '  <soap12:Body>'; soaprequest += '    <doneScreenScore xmlns=\'http://detectent.net/\'>'; soaprequest += '      <input1>string</input1>'; soaprequest += '<input2>string</input2>'; soaprequest += '<input3>string</input3>'; soaprequest += '<input4>string</input4>'; soaprequest += '</doneScreenScore>'; soaprequest += '</soap12:Body>'; soaprequest += '</soap12:Envelope>';  s.Write(System.Text.Encoding.ASCII.GetBytes(soaprequest), 0, soaprequest.Length);  s.Close();  // execute the request HttpWebResponse response = (HttpWebResponse)     request.GetResponse();  // we will read data via the response stream Stream resStream = response.GetResponseStream(); string responseFromWebServiceCall = ReadResponseStream(resStream); 
  • 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. 2026-05-11T03:38:13+00:00Added an answer on May 11, 2026 at 3:38 am

    I think that you can do something with the credentials… I am doing this for a webservice…

    rpt.Credentials = new System.Net.NetworkCredential(UserName, Password, Domain);

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

Sidebar

Related Questions

I have a Mac app communicating with a web service that can only deal
I have an ASP.NET web service that I can access via a windows program
I hope you can help me. I have a web service that needs to
Currently we have web-services built up so that everyone (with valid service account) can
Scenario: Web-service producer have only SHA-1 hash of passwords stored in database. We need
We need to implement a WCF service on a machine that can only run
I have a web service that I created in C# and a test harness
I have web service urls that were working fine and are now returning the
I have a web service that returns this string via the jQuery $.ajax() call
I have a web service that requires a two part query to fully get

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.