473,220 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,220 software developers and data experts.

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 1659
| 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(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim oClass As New Class1

Try

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

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

Call oClass.GetCommissionDetails("XXXXX", "YYYYY", "all", "01/01/2005",
"11/30/2005", True)

TextBox1.Text = oClass.XMLReturn

Catch oExc As Exception

MsgBox(oExc.ToString)

End Try

End Sub

End Class

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

Public Class Class1

Private MyDevelopment As New WebReference.MyWebServDemo Service

Private msXML As String

Public ReadOnly Property XMLReturn() As String

Get

Return msXML

End Get

End Property

Public Sub GetCommissionDetails(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.BegingetCommissionDetails(userid, password, company, fromDate,
toDate, isRollup, AddressOf getCommissionDetailsString, Nothing)

Catch oExc As Exception

MsgBox(oExc.ToString)

End Try

End Sub

Private Sub getCommissionDetailsString(ByVal res As IAsyncResult)

Dim rawXml As String = MyDevelopment.EndgetCommissionDetails(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.Url()

MyDevelopment.BegingetMyCodeStatus(userid, password, year, month, AddressOf
getMyCodeStatusString, Nothing)

'moForm.ShowDialog()

'Return msXML

End Sub

Private Sub getMyCodeStatusString(ByVal res As IAsyncResult)

Dim rawXml As String = MyDevelopment.EndgetMyCodeStatus(res)

msXML = rawXml

'moForm.Close()

End Sub

Public Sub GerMyCodeProductionDetail(ByVal 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.BegingetMyCodeProductionDetails(user id, password, fromDate,
toDate, status, company, sort, isRollup, AddressOf getMyCodeProdDetailString,
Nothing)

End Sub

Private Sub getMyCodeProdDetailString(ByVal res As IAsyncResult)

Dim rawxml As String = MyDevelopment.EndgetMyCodeProductionDetails(res)

msXML = rawxml

End Sub

End Class

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

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

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

<wsdl:types>

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

<element name="getMyCodeStatus">

<complexType>

<sequence>

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

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

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

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

</sequence>

</complexType>

</element>

<element name="getMyCodeStatusResponse">

<complexType>

<sequence>

<element name="getMyCodeStatusReturn" nillable="true" type="xsd:string"/>

</sequence>

</complexType>

</element>

<element name="getMyCodeProductionDetails">

<complexType>

<sequence>

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

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

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

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

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

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

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

<element name="isRollup" type="xsd:boolean"/>

</sequence>

</complexType>

</element>

<element name="getMyCodeProductionDetailsResponse">

<complexType>

<sequence>

<element name="getMyCodeProductionDetailsReturn" nillable="true"
type="xsd:string"/>

</sequence>

</complexType>

</element>

<element name="getCommissionDetails">

<complexType>

<sequence>

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

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

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

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

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

<element name="isRollup" type="xsd:boolean"/>

</sequence>

</complexType>

</element>

<element name="getCommissionDetailsResponse">

<complexType>

<sequence>

<element name="getCommissionDetailsReturn" nillable="true" type="xsd:string"/>

</sequence>

</complexType>

</element>

</schema>

</wsdl:types>

<wsdl:message name="getCommissionDetailsResponse">

<wsdl:part element="intf:getCommissionDetailsResponse" name="parameters"/>

</wsdl:message>

<wsdl:message name="getMyCodeProductionDetailsResponse">

<wsdl:part element="intf:getMyCodeProductionDetailsResponse"
name="parameters"/>

</wsdl:message>

<wsdl:message name="getMyCodeStatusRequest">

<wsdl:part element="intf:getMyCodeStatus" name="parameters"/>

</wsdl:message>

<wsdl:message name="getCommissionDetailsRequest">

<wsdl:part element="intf:getCommissionDetails" name="parameters"/>

</wsdl:message>

<wsdl:message name="getMyCodeStatusResponse">

<wsdl:part element="intf:getMyCodeStatusResponse" name="parameters"/>

</wsdl:message>

<wsdl:message name="getMyCodeProductionDetailsRequest">

<wsdl:part element="intf:getMyCodeProductionDetails" name="parameters"/>

</wsdl:message>

<wsdl:portType name="MyWebServDemo ">

<wsdl:operation name="getMyCodeStatus">

<wsdl:input message="intf:getMyCodeStatusRequest"
name="getMyCodeStatusRequest"/>

<wsdl:output message="intf:getMyCodeStatusResponse"
name="getMyCodeStatusResponse"/>

</wsdl:operation>

<wsdl:operation name="getMyCodeProductionDetails">

<wsdl:input message="intf:getMyCodeProductionDetailsRequest"
name="getMyCodeProductionDetailsRequest"/>

<wsdl:output message="intf:getMyCodeProductionDetailsResponse"
name="getMyCodeProductionDetailsResponse"/>

</wsdl:operation>

<wsdl:operation name="getCommissionDetails">

<wsdl:input message="intf:getCommissionDetailsRequest"
name="getCommissionDetailsRequest"/>

<wsdl:output message="intf:getCommissionDetailsResponse"
name="getCommissionDetailsResponse"/>

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name="MyWebServDemo SoapBinding" type="intf:MyWebServDemo ">

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

<wsdl:operation name="getMyCodeStatus">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="getMyCodeStatusRequest">

<wsdlsoap:body use="literal"/>

</wsdl:input>

<wsdl:output name="getMyCodeStatusResponse">

<wsdlsoap:body use="literal"/>

</wsdl:output>

</wsdl:operation>

<wsdl:operation name="getMyCodeProductionDetails">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="getMyCodeProductionDetailsRequest">

<wsdlsoap:body use="literal"/>

</wsdl:input>

<wsdl:output name="getMyCodeProductionDetailsResponse">

<wsdlsoap:body use="literal"/>

</wsdl:output>

</wsdl:operation>

<wsdl:operation name="getCommissionDetails">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="getCommissionDetailsRequest">

<wsdlsoap:body use="literal"/>

</wsdl:input>

<wsdl:output name="getCommissionDetailsResponse">

<wsdlsoap:body use="literal"/>

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name="MyWebServDemo Service">

<wsdl:port binding="intf:MyWebServDemo SoapBinding" name="MyWebServDemo ">

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

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

Dec 5 '05 #3

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

Similar topics

2
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...
22
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...
0
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...
26
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...
3
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...
1
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: ...
3
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...
3
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...
3
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...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.