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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:56:52+00:00 2026-05-15T22:56:52+00:00

I have a ASP.NET (C#) web page which utilizes a VB class library. The

  • 0

I have a ASP.NET (C#) web page which utilizes a VB class library. The VB library performs a SOAP POST to a remote web service and returns a message. However the VB library keeps running into a “No connection could be made because the target machine actively refused it xxx.xxx.xxx.xxx”

However, I’ve also created a C# test client which consumes the same VB class library and can perform the post just fine!

So what is going on here?

Default.aspx:

protected void Page_Load(object sender, EventArgs e)
    {
        String soapString = ........
        MyVBMiddleTierObject.PostMgr pMgr = new MyVBMiddleTierObject.PostMgr();
        Response.Write(pMgr.DoPOST(soapString));
    }

VB Middle Tier:

Public Function DoPOST(ByVal soapMsg As String) As String
  Dim encode As UTF8Encoding = New UTF8Encoding()
  Dim buff() As Byte = encode.GetBytes(soapMsg)

  Dim client As HttpWebRequest = CType(WebRequest.Create(ConfigurationManager.AppSettings("SoapService")), HttpWebRequest)
  client.Headers.Add("SOAPAction", "")
  client.ContentType = "text/xml;charset=utf-8"
  client.Accept = "text/xml"
  client.Method = "POST"
  client.ContentLength = buff.Length
  client.Timeout = 5000

  Dim s As Stream = client.GetRequestStream()
  s.Write(buff, 0, buff.Length)
  s.Close()

  Dim response As WebResponse = client.GetResponse()
  s = response.GetResponseStream()
  Dim sr As StreamReader = New StreamReader(s)
  sPostResult = sr.ReadToEnd()
  response.Close()

  DoPOST = sPostResult

End Function

C# Test client:

class Program
    {
        static void Main(string[] args)
        {
            String soapString = ........
            MyVBMiddleTierObject.PostMgr pMgr = new MyVBMiddleTierObject.PostMgr();
            String s = pMgr.DoPOST(soapString);
            Console.WriteLine(s);
        }
    }

So why is my C# Test Client working just fine, but my web page not?

Update

Soap Message:

<soapenv:Envelope xmlns:java="java:com.xyz.service"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:vcs="http://schemas.xyz.com/vcs">
  <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1"
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <wsse:UsernameToken wsu:Id="UsernameToken-5775010" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility- 1.0.xsd">
        <wsse:Username>JoeShmoe</wsse:Username>
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">123456789</wsse:Password>
      </wsse:UsernameToken>
    </wsse:Security>
  </soapenv:Header>
  <soapenv:Body>
    <vcs:theirService>
      <vcs:theirMethod>
        <java:Frequency>M</java:Frequency>
      </vcs:theirMethod>
    </vcs:theirService>
  </soapenv:Body>
</soapenv:Envelope>

Again, the exact same soap string is being posted (by my test client, and by my web page) but only my test client can connect…


Update to include web.config

<configuration>
    <appSettings>
        <add key="SoapService" value="https://www.wxy.com/theirService"/>
    </appSettings>
    <connectionStrings/>
    <system.web>
        <compilation debug="true" strict="false" explicit="true"/>
        <authentication mode="Windows"/>
    </system.web>
</configuration>

It’s pretty basic…

  • 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-15T22:56:53+00:00Added an answer on May 15, 2026 at 10:56 pm

    The error means the computer your code connected to does not have a server listening on the port you requested (80 I assume). That could mean that the IP is wrong (it found a computer, but the wrong one), or the port is wrong. We would need to see your soapString, to further diagnose.

    try putting this in your web.config to ensure credentials are passed along to your web service.

    <identity impersonate="true" />
    

    or if you are not using a windows token, just specify the userid and password.

    <identity impersonate="true"
              userName="domain\user" 
              password="password" />
    

    You also need to use a proxy with credentials.

    client.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials
    

    or

    client.Proxy.Credentials = New Net.NetworkCredential("UserName", "Password")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 528k
  • Answers 528k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well there is a cunningish way to do it, but… May 16, 2026 at 11:05 pm
  • Editorial Team
    Editorial Team added an answer You put myArray=[coder decodeObjectForKey:@"myArray"]; inside the if block. If you… May 16, 2026 at 11:05 pm
  • Editorial Team
    Editorial Team added an answer This seems to happen when the scripting option "Include If… May 16, 2026 at 11:05 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a ASP.NET web page which contains a table of check boxes and
I have an ASP.Net web page, which uses a Master Page template. The page
I have a ASP.NET (C#) web page in which I want to enumerate a
I have developed an application in ASP.NET 3.5 which utilizes the Membership and Roles
I have an asp.net web page written in C#. Using some javascript I popup
I have an Asp.Net web page, having the common Asp.Net form. The outer border
asp.net c# Our webpage currently contains a rather large web app which causes a
We have an advanced webpage (ASP.NET, C#), and a application which needs to be
We have a non-SSL ASP.NET web app that allows a user to login (ASP
I have an ASP.NET page that has three div s within the only form

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.