468,250 Members | 1,604 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,250 developers. It's quick & easy.

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 1530
| 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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by Rajeev Tipnis | last post: by
3 posts views Thread by MattM | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.