Problem when pass the symbol '+' as a parameter from classic asp to a web service

Posted on 2009-04-16
Last Modified: 2012-05-06
Hi everybody,

I'm working with MSXML2.ServerXMLHTTP to use a web service from classic asp. I pass several parameters and everything is working good except when i try to pass a value with the symbol '+'. For example: a value like 'abc+def' is converted to 'abc def' and then it fails because of the validation.

This is my code:

    Set httpReq = New MSXML2.ServerXMLHTTP
    BookID = "1"
    Category = "cf+so"
   webServiceUrl = "http://localhost:1131/WS/MyWebService.asmx/Search?BookID=" & BookID
    webServiceUrl = webServiceUrl & "&Category=" & Category

    httpReq.Open "GET", webServiceUrl, False

    Set myXmlDoc = New MSXML2.DOMDocument
    If myXmlDoc.Load(httpReq.responseBody) Then

When i debug it..this is what the web service receive:    
BookID = "1", Category = "cf so"
As you can see the web service receive a blank space ' ' instead of '+' but i need the '+' to be passed.

Somebody know why is this happening? Any idea?


Question by:richardhaeger
    LVL 19

    Accepted Solution

    Try using the URLEncode method , e.g.:

    webServiceUrl = webServiceUrl & "&Category=" & Server.URLEncode(Category)

    Author Closing Comment

    It worked...
    Thank you very much!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now