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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:57:01+00:00 2026-06-11T01:57:01+00:00

I’m trying send XML document to a page .asp, and get the answer, but

  • 0

I’m trying send XML document to a page .asp, and get the answer, but I get following error:

System.UriFormatException: Invalid URI: The URI scheme is not valid. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Net.WebRequest.Create(String requestUriString) at GNS_ZalkarBank.GNSTaskServiceZalkarBank.CreateRequest(String requestData, String address) at GNS_ZalkarBank.GNSTaskServiceZalkarBank.SendRequest(String requestString, String address) at GNS_ZalkarBank.GNSTaskServiceZalkarBank.processData(TaskInfo& taskInfo, Object& data) at Task.RegistryTemplate.RegistryTaskTemplate.execute(DataSet& dataSet)`

I implemented a method for sending data to a page with asp server script:

private string SendRequest(String requestString, String address)
{
    address = "https://myadress/osmp_gni_xml.asp";
    HttpWebRequest httpRequest = this.CreateRequest(requestString, address);
    string response = GetResponse(httpRequest);
    return response;
}

private HttpWebRequest CreateRequest(string requestData, string address)
{
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
    request.Method = "POST";
    //request.UserAgent = "Test";

    byte[] data = Encoding.UTF8.GetBytes(requestData);
    request.ContentType = "text/xml; encoding='utf-8'";
    request.ContentLength = data.Length;
    using (Stream dataStream = request.GetRequestStream())
    {
        dataStream.Write(data, 0, data.Length);
        dataStream.Close();
    }
    return request;
}

private string GetResponse(HttpWebRequest httpWebRequest)
{
    string responseString;
    HttpWebResponse response = (HttpWebResponse)httpWebRequest.GetResponse();
    using (Stream dataStream = response.GetResponseStream())
    {
        using (StreamReader reader = new StreamReader(dataStream))
        {
            responseString = reader.ReadToEnd();
        }
    }
    return responseString;
}

Server side (script page: osmp_gni_xml.asp):

<%@ Language=VBScript CODEPAGE="65001"%>
<%    
    Sub AddSubNode(Parent, Name, Value)  
        Set subNode = XMLDoc.createElement(Name)  
        Parent.appendChild(subNode)  
        subNode.appendChild(XMLDoc.createTextNode(Value))  
    End Sub  

    Function Stream_BinaryToString(Binary, CharSet)
        Const adTypeText = 2
        Const adTypeBinary = 1

        'Create Stream object

        Dim BinaryStream 'As New Stream
        Set BinaryStream = CreateObject("ADODB.Stream")

        'Specify stream type - we want To save text/string data.

        BinaryStream.Type = adTypeBinary

       'Open the stream And write text/string data To the object

        BinaryStream.Open
        BinaryStream.Write Binary

        'Change stream type To binary

        BinaryStream.Position = 0
        BinaryStream.Type = adTypeText

        'Specify charset For the source text (unicode) data.

        If Len(CharSet) > 0 Then
            BinaryStream.CharSet = CharSet
        Else
            BinaryStream.CharSet = "us-ascii"
        End If

        'Open the stream And get binary data from the object

        Stream_BinaryToString = BinaryStream.ReadText
    End Function

    result=300
    OK="incomplete request"
    Dim PostData
    Dim biData

    PostData = ""
    If Request.TotalBytes>0 Then
        biData = Request.BinaryRead(Request.TotalBytes)

        PostData=Stream_BinaryToString(biData, "utf-8")

        ProvStr =  "Provider=sqloledb;Data Source=TEST;Initial Catalog=TESTOsmp;User Id=tests_osmp;Password=tests;"

        Set Conn = Server.CreateObject("ADODB.Connection")  
        Conn.Open ProvStr  
        Set cmdUA = Server.CreateObject("ADODB.Command")
        cmdUA.ActiveConnection = Conn
        cmdUA.CommandText = "GNI_Import"
        cmdUA.CommandType = 4 
        cmdUA.Parameters.Append cmdUA.CreateParameter("Reestr", 202, 1, 2000, PostData)

        Set RS = cmdUA.Execute
        result = RS("result") 

        RS.Close  
        Conn.Close 
        Set Conn = Nothing  
        Set RS = Nothing 
    End If

    'Create XML  

    Set XMLDoc = Server.CreateObject("Microsoft.XMLDOM")  

    Set pi = XMLDoc.createProcessingInstruction("xml"," version=""1.0"" encoding=""utf-8""")  
    XMLDoc.appendChild(pi)  

   'Main  

    Set mainNode = XMLDoc.createElement("response")  
    XMLDoc.appendChild(mainNode)  

    If result=0 Then
        OK="Ok"
    Else
        result=300
        OK="incomplete request"
    End If

    AddSubNode mainNode, "result",  result 
    AddSubNode mainNode, "comment", OK
    Response.ContentType = "text/xml"  
    Response.Write XMLDoc.XML  

    Set mainNode = Nothing 
    Set XMLDoc = Nothing   
%>

Whats wrong?

  • 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-11T01:57:02+00:00Added an answer on June 11, 2026 at 1:57 am

    The provided error text comes from here:

    private HttpWebRequest CreateRequest(string requestData, string address)
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address); // <- THIS LINE
        ...
    }
    

    The error description is complaining that the address https://myadress/osmp_gni_xml.asp is invalid, being https the most likely causes are connection issues.

    Trying to connect via https but not having setup https server-side in the first place is very common: verify the address is reachable, security is properly setup, and the sort. A console tool like F12 developer console (part of IE9), FireBug (Firefox extension) or Fiddler (desktop application) are the best tools to find out what’s happening when it comes to external connections.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.