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 4608974
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:55:15+00:00 2026-05-22T00:55:15+00:00

The URL of a Web Service that I need to call includes a parameter

  • 0

The URL of a Web Service that I need to call includes a parameter that includes free form text. I’m not sure why it was designed that way since it is sent using POST and includes many fields as part of the POST. But, it is causing me a problem.

For some characters like the pound sign and < >, the URL is truncated when it hits the problem character. I’m HTML encoding the text for the parameter, but the problem remains.
I can see special characters like > are being encoded to something like gt;. I’m thinking that the semicolon in the encoded string is somehow a problem.

I put a sniffer receiving the incoming request at the server and I see there that the URL has been truncated.

At the server I see something like:

    ...?extraData=kjfkfjslkj

instead of:

    ...?extraData=kjfkfjslkj#kfjkdlsfj

The code is something like this:

    using System.Web;
    ....
    String strExtra="kjfkfjslkj#kfjkdlsfj";
    strURL = strStuff + "?extraData=" + System.Web.HttpUtility.HtmlEncode(strExtra);
    HttpWebRequest oRequest = (HttpWebRequest)WebRequest.Create(new Uri(strURL));
    oRequest.Method = httpMethod;
    oRequest.ContentType = "application/atom+xml";
    ...
    using (WebResponse oResponse = oRequest.GetResponse())
    {
    ...
    }
  • 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-05-22T00:55:16+00:00Added an answer on May 22, 2026 at 12:55 am

    Everything after the hash (#) sign is not sent to the server. It’s used by the browser and scripts on the page to denote a location on a page, or some other significance. Remove the hash sign or url encode it (%23) to send it to the server.

    This line:

    strURL = strStuff + "?extraData=" + System.Web.HttpUtility.HtmlEncode(strExtra);
    

    should be

    strURL = strStuff + "?extraData=" + Server.UrlEncode(strExtra);
    

    encoding for html is useless when using the data in a url.

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

Sidebar

Related Questions

I need to call a web service from javascript that returns a JSON array
I've a problem...I use jQuery ajax to call a web service that returns XML.
I have a method that I call to make web service requests using GET.
I have the web service URL, login and password, but I can't understand is
I have My Sharepoint Web Service URL, but when i try to access it
I'm trying to access an HTTPS based web service URL from a web/ear application
Im trying to create a web service which gets to a URL e.g. www.domain.co.uk/prices.csv
I have a web service contains a web method with the url http://localhost/Service1.asmx?op=AddNumbers .
I have a list of servers, all exposing the same web service interface, that
I have a web service that I have published locally. I wrote an HTML

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.