steve said:
| 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(userid, 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
art element="intf:getCommissionDetailsResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getMyCodeProductionDetailsResponse">
<wsdl
art element="intf:getMyCodeProductionDetailsResponse"
name="parameters"/>
</wsdl:message>
<wsdl:message name="getMyCodeStatusRequest">
<wsdl
art element="intf:getMyCodeStatus" name="parameters"/>
</wsdl:message>
<wsdl:message name="getCommissionDetailsRequest">
<wsdl
art element="intf:getCommissionDetails" name="parameters"/>
</wsdl:message>
<wsdl:message name="getMyCodeStatusResponse">
<wsdl
art element="intf:getMyCodeStatusResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getMyCodeProductionDetailsRequest">
<wsdl
art element="intf:getMyCodeProductionDetails" name="parameters"/>
</wsdl:message>
<wsdl
ortType name="MyWebServDemo ">
<wsdl
peration name="getMyCodeStatus">
<wsdl:input message="intf:getMyCodeStatusRequest"
name="getMyCodeStatusRequest"/>
<wsdl
utput message="intf:getMyCodeStatusResponse"
name="getMyCodeStatusResponse"/>
</wsdl
peration>
<wsdl
peration name="getMyCodeProductionDetails">
<wsdl:input message="intf:getMyCodeProductionDetailsRequest"
name="getMyCodeProductionDetailsRequest"/>
<wsdl
utput message="intf:getMyCodeProductionDetailsResponse"
name="getMyCodeProductionDetailsResponse"/>
</wsdl
peration>
<wsdl
peration name="getCommissionDetails">
<wsdl:input message="intf:getCommissionDetailsRequest"
name="getCommissionDetailsRequest"/>
<wsdl
utput message="intf:getCommissionDetailsResponse"
name="getCommissionDetailsResponse"/>
</wsdl
peration>
</wsdl
ortType>
<wsdl:binding name="MyWebServDemo SoapBinding" type="intf:MyWebServDemo ">
<wsdlsoap:binding style="document"
transport="
http://schemas.xmlsoap.org/soap/http"/>
<wsdl
peration name="getMyCodeStatus">
<wsdlsoap
peration soapAction=""/>
<wsdl:input name="getMyCodeStatusRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl
utput name="getMyCodeStatusResponse">
<wsdlsoap:body use="literal"/>
</wsdl
utput>
</wsdl
peration>
<wsdl
peration name="getMyCodeProductionDetails">
<wsdlsoap
peration soapAction=""/>
<wsdl:input name="getMyCodeProductionDetailsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl
utput name="getMyCodeProductionDetailsResponse">
<wsdlsoap:body use="literal"/>
</wsdl
utput>
</wsdl
peration>
<wsdl
peration name="getCommissionDetails">
<wsdlsoap
peration soapAction=""/>
<wsdl:input name="getCommissionDetailsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl
utput name="getCommissionDetailsResponse">
<wsdlsoap:body use="literal"/>
</wsdl
utput>
</wsdl
peration>
</wsdl:binding>
<wsdl:service name="MyWebServDemo Service">
<wsdl
ort binding="intf:MyWebServDemo SoapBinding" name="MyWebServDemo ">
<wsdlsoap:address
location="
http://localhost:825/MyCode/services/MyWebServDemo "/>
</wsdl
ort>
</wsdl:service>