473,654 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The underlying connection was closed: Unable to connect to the rem

Hello,

When using VB.Net to connect ot a web service, I am getting the error

The underlying connection was closed: Unable to connect to the remote server

What could be causing this?

Thanks!
Dec 5 '05 #1
2 1691
| The underlying connection was closed: Unable to connect to the remote
server
|
| What could be causing this?

a plethura of reasons. catch the specific exception and see if you can get
more details. for us to better help you, it would be in your best interest
to show your code that communicates with the ws and to know other details
about the ws provider...is it a ws that you created or is it something we
can all hit to diagnose this for you...etc.

details posted here will most likely give you more detailed answers to your
delima.
Dec 5 '05 #2


"steve" wrote:
| The underlying connection was closed: Unable to connect to the remote
server
|
| What could be causing this?

a plethura of reasons. catch the specific exception and see if you can get
more details. for us to better help you, it would be in your best interest
to show your code that communicates with the ws and to know other details
about the ws provider...is it a ws that you created or is it something we
can all hit to diagnose this for you...etc.

details posted here will most likely give you more detailed answers to your
delima.


Thanks. Here is my code:
I can't seem to get any more details on the exception. Here's my code
followed by the contents of the wsdl file.

*************** ******

Public Class Form1

Inherits System.Windows. Forms.Form

Private Sub Button1_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim oClass As New Class1

Try

'Call oClass.GetMyCod eStatus("XXXXX" , "YYYYY", 2005, 10)

'Call oClass.GerMyCod eProductionDeta il("XXXXX", "YYYYY", "11/01/2005",
"11/30/2005", "all", "all", "date", True)

Call oClass.GetCommi ssionDetails("X XXXX", "YYYYY", "all", "01/01/2005",
"11/30/2005", True)

TextBox1.Text = oClass.XMLRetur n

Catch oExc As Exception

MsgBox(oExc.ToS tring)

End Try

End Sub

End Class

*************** *************

Public Class Class1

Private MyDevelopment As New WebReference.My WebServDemo Service

Private msXML As String

Public ReadOnly Property XMLReturn() As String

Get

Return msXML

End Get

End Property

Public Sub GetCommissionDe tails(ByVal userid As String, ByVal password As
String, ByVal company As String, ByVal fromDate As String, ByVal toDate As
String, ByVal isRollup As Boolean)

'Dim oExc As Exception

Try

msXML = ""

MyDevelopment.B egingetCommissi onDetails(useri d, password, company, fromDate,
toDate, isRollup, AddressOf getCommissionDe tailsString, Nothing)

Catch oExc As Exception

MsgBox(oExc.ToS tring)

End Try

End Sub

Private Sub getCommissionDe tailsString(ByV al res As IAsyncResult)

Dim rawXml As String = MyDevelopment.E ndgetCommission Details(res)

msXML = rawXml

End Sub

Public Sub GetMyCodeStatus (ByVal userid As String, ByVal password As String,
ByVal year As Integer, ByVal month As Integer)

msXML = ""

'moForm.Label1. Text = "Retrieving data from: " & vbCrLf & MyProduction.Ur l()

MyDevelopment.B egingetMyCodeSt atus(userid, password, year, month, AddressOf
getMyCodeStatus String, Nothing)

'moForm.ShowDia log()

'Return msXML

End Sub

Private Sub getMyCodeStatus String(ByVal res As IAsyncResult)

Dim rawXml As String = MyDevelopment.E ndgetMyCodeStat us(res)

msXML = rawXml

'moForm.Close()

End Sub

Public Sub GerMyCodeProduc tionDetail(ByVa l userid As String, ByVal password
As String, ByVal fromDate As String, ByVal toDate As String, ByVal status As
String, ByVal company As String, ByVal sort As String, ByVal isRollup As
Boolean)

msXML = ""

MyDevelopment.B egingetMyCodePr oductionDetails (userid, password, fromDate,
toDate, status, company, sort, isRollup, AddressOf getMyCodeProdDe tailString,
Nothing)

End Sub

Private Sub getMyCodeProdDe tailString(ByVa l res As IAsyncResult)

Dim rawxml As String = MyDevelopment.E ndgetMyCodeProd uctionDetails(r es)

msXML = rawxml

End Sub

End Class

*************** *************

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitio ns targetNamespace ="http://service.MyCode. mywebsite.com"
xmlns="http://schemas.xmlsoap .org/wsdl/"
xmlns:apachesoa p="http://xml.apache.org/xml-soap"
xmlns:impl="htt p://service.MyCode. mywebsite.com"
xmlns:intf="htt p://service.MyCode. mywebsite.com"
xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/"
xmlns:wsdlsoap= "http://schemas.xmlsoap .org/wsdl/soap/"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">

<wsdl:types>

<schema elementFormDefa ult="qualified"
targetNamespace ="http://service.MyCode. mywebsite.com"
xmlns="http://www.w3.org/2001/XMLSchema">

<element name="getMyCode Status">

<complexType>

<sequence>

<element name="uid" nillable="true" type="xsd:strin g"/>

<element name="pw" nillable="true" type="xsd:strin g"/>

<element name="year" nillable="true" type="xsd:strin g"/>

<element name="month" nillable="true" type="xsd:strin g"/>

</sequence>

</complexType>

</element>

<element name="getMyCode StatusResponse" >

<complexType>

<sequence>

<element name="getMyCode StatusReturn" nillable="true" type="xsd:strin g"/>

</sequence>

</complexType>

</element>

<element name="getMyCode ProductionDetai ls">

<complexType>

<sequence>

<element name="uid" nillable="true" type="xsd:strin g"/>

<element name="pw" nillable="true" type="xsd:strin g"/>

<element name="fromDate" nillable="true" type="xsd:strin g"/>

<element name="toDate" nillable="true" type="xsd:strin g"/>

<element name="status" nillable="true" type="xsd:strin g"/>

<element name="company" nillable="true" type="xsd:strin g"/>

<element name="sort" nillable="true" type="xsd:strin g"/>

<element name="isRollup" type="xsd:boole an"/>

</sequence>

</complexType>

</element>

<element name="getMyCode ProductionDetai lsResponse">

<complexType>

<sequence>

<element name="getMyCode ProductionDetai lsReturn" nillable="true"
type="xsd:strin g"/>

</sequence>

</complexType>

</element>

<element name="getCommis sionDetails">

<complexType>

<sequence>

<element name="uid" nillable="true" type="xsd:strin g"/>

<element name="pw" nillable="true" type="xsd:strin g"/>

<element name="company" nillable="true" type="xsd:strin g"/>

<element name="fromDate" nillable="true" type="xsd:strin g"/>

<element name="toDate" nillable="true" type="xsd:strin g"/>

<element name="isRollup" type="xsd:boole an"/>

</sequence>

</complexType>

</element>

<element name="getCommis sionDetailsResp onse">

<complexType>

<sequence>

<element name="getCommis sionDetailsRetu rn" nillable="true" type="xsd:strin g"/>

</sequence>

</complexType>

</element>

</schema>

</wsdl:types>

<wsdl:message name="getCommis sionDetailsResp onse">

<wsdl:part element="intf:g etCommissionDet ailsResponse" name="parameter s"/>

</wsdl:message>

<wsdl:message name="getMyCode ProductionDetai lsResponse">

<wsdl:part element="intf:g etMyCodeProduct ionDetailsRespo nse"
name="parameter s"/>

</wsdl:message>

<wsdl:message name="getMyCode StatusRequest">

<wsdl:part element="intf:g etMyCodeStatus" name="parameter s"/>

</wsdl:message>

<wsdl:message name="getCommis sionDetailsRequ est">

<wsdl:part element="intf:g etCommissionDet ails" name="parameter s"/>

</wsdl:message>

<wsdl:message name="getMyCode StatusResponse" >

<wsdl:part element="intf:g etMyCodeStatusR esponse" name="parameter s"/>

</wsdl:message>

<wsdl:message name="getMyCode ProductionDetai lsRequest">

<wsdl:part element="intf:g etMyCodeProduct ionDetails" name="parameter s"/>

</wsdl:message>

<wsdl:portTyp e name="MyWebServ Demo ">

<wsdl:operati on name="getMyCode Status">

<wsdl:input message="intf:g etMyCodeStatusR equest"
name="getMyCode StatusRequest"/>

<wsdl:output message="intf:g etMyCodeStatusR esponse"
name="getMyCode StatusResponse"/>

</wsdl:operation>

<wsdl:operati on name="getMyCode ProductionDetai ls">

<wsdl:input message="intf:g etMyCodeProduct ionDetailsReque st"
name="getMyCode ProductionDetai lsRequest"/>

<wsdl:output message="intf:g etMyCodeProduct ionDetailsRespo nse"
name="getMyCode ProductionDetai lsResponse"/>

</wsdl:operation>

<wsdl:operati on name="getCommis sionDetails">

<wsdl:input message="intf:g etCommissionDet ailsRequest"
name="getCommis sionDetailsRequ est"/>

<wsdl:output message="intf:g etCommissionDet ailsResponse"
name="getCommis sionDetailsResp onse"/>

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="MyWebServ Demo SoapBinding" type="intf:MyWe bServDemo ">

<wsdlsoap:bindi ng style="document "
transport="http ://schemas.xmlsoap .org/soap/http"/>

<wsdl:operati on name="getMyCode Status">

<wsdlsoap:opera tion soapAction=""/>

<wsdl:input name="getMyCode StatusRequest">

<wsdlsoap:bod y use="literal"/>

</wsdl:input>

<wsdl:output name="getMyCode StatusResponse" >

<wsdlsoap:bod y use="literal"/>

</wsdl:output>

</wsdl:operation>

<wsdl:operati on name="getMyCode ProductionDetai ls">

<wsdlsoap:opera tion soapAction=""/>

<wsdl:input name="getMyCode ProductionDetai lsRequest">

<wsdlsoap:bod y use="literal"/>

</wsdl:input>

<wsdl:output name="getMyCode ProductionDetai lsResponse">

<wsdlsoap:bod y use="literal"/>

</wsdl:output>

</wsdl:operation>

<wsdl:operati on name="getCommis sionDetails">

<wsdlsoap:opera tion soapAction=""/>

<wsdl:input name="getCommis sionDetailsRequ est">

<wsdlsoap:bod y use="literal"/>

</wsdl:input>

<wsdl:output name="getCommis sionDetailsResp onse">

<wsdlsoap:bod y use="literal"/>

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="MyWebServ Demo Service">

<wsdl:port binding="intf:M yWebServDemo SoapBinding" name="MyWebServ Demo ">

<wsdlsoap:addre ss
location="http://localhost:825/MyCode/services/MyWebServDemo "/>

</wsdl:port>

</wsdl:service>

</wsdl:definition s>

Dec 5 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
473
by: Michael R. | last post by:
Hello, Ich have some Problems with the call of a WebService! Situation: WebService is on the Internetserver The Webapplikcaion ist on the Intanetserver .... when I call the Webservice form the Intranetserver .... I get following Error:
22
3255
by: Kristof Thys | last post by:
Hello, I'm developing a C# - windows forms application. To get some information for my application, I'm connecting to an URL, wich gives me XML generated using php. With 90% of the users, this code just works fine: WebRequest request = WebRequest.Create(URL);
0
1096
by: Luis Esteban Valencia | last post by:
I have an application on my intranet It works fine there when I copied the proyect to the server of the Internet it gives me this error. The arquitecture of my servers are. There is one Server for Internet another server for Databases and another server for Intranet. The only one that has public IP is the Internet Server and obviously I cant give public access to the database server. The applicacion access data on the database server....
26
16499
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On Win2K3/IIS6.0), do we still need this patch? 2) Does it specifically solve only this error: The underlying connection was closed. An unexpected error
3
3241
by: MattM | last post by:
I am getting the "The underlying connection was closed: Unable to connect to the remote server" message when trying to connect an ASPX page to a simple Hello World web service. I have read a few posts on this topic but my situation is different. The problem appears to be a setting with my test server. The basic scenario is it works when the URL is the short server name (testserver) but fails with the full server name (testserver.abc.com). ...
1
2812
by: Jim | last post by:
I have the following code: Line 35: Dim sURL As String = "http://www.google.com" Line 36: Dim data As Stream = client.OpenRead(Server.UrlPath­Encode(sURL)) Line 37: Dim reader As New StreamReader(data) Line 38: Results = reader.ReadToEnd()
3
4066
by: Rahul Anand | last post by:
As per our requirements we have a web service which internally connects (Simple HTTP Post Request) to a remote server to initiate some work. We are calling the web service method asynchronously from a .NET Web Application hosted on IIS. In our setup the web request form a client can be running for long duration (may be more than 4 hours). We are getting exceptions during the HTTP send/receive inside the web service method. The exception...
3
2090
by: Monty | last post by:
OK, I had an issue with this and found lots of advice that did not apply, so I'm posting what I found hoping it might help someone else. Here's the sitch: you have a COM app that calls to a .Net assembly which in turn calls a web service. You know the web service is reachable and that the COM app is able to instantiate your .Net assembly (because you RegAsm'ed it and it's good to go). However, when you attempt to make a call to the web...
3
9537
by: nandan | last post by:
Yes. My client has a proxy server. That much i know. In my application I make two kinds of calls that are affected by the proxy server I finally got the webservice call working. But my httpwebrequest.GetReponse() function call throws the above error. So here's what i do in the case it works.. //THIS WORKS
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.