Error message "Pass a valid endpoint name to the service client constructor"

ccbryan

Active member
Joined
Oct 14, 2008
Messages
30
Programming Experience
5-10
Error message "Pass a valid endpoint name to the service client constructor"

Hi all... I'm trying to build a simple project using the USZIP webservice (USZip Web Service).

I have (apparently successfully) added a service reference to that URL, which I named ZipService1.

In my form load I have the following code:
VB.NET:
 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim myzipservice As zipservice1.USZipSoapClient = New zipservice1.USZipSoapClient()
        Dim mycity As Xml.XmlNode = myzipservice.GetInfoByZIP("29720").FirstChild
        Dim x As String
        x = mycity.FirstChild.InnerText.ToString

    End Sub

This compiles and runs.

However, I am getting an error on the first Dim line... "An endpoint configuration section for contract service 'ZipService1.USZipSoap' could not be loaded because more than one endpoint configuration for that contract was found."

Any ideas? Any help will be greatly appreciated!

Chandler
 
There are two bindings generated for that service, one basicHttpBinding named "USZipSoap" and one customBinding named "USZipSoap12", they can be found in the various files under service reference in solution explorer. You can specify the binding name with the client contructor like this:
= New ZipService1.USZipSoapClient("USZipSoap")
 
There are two bindings generated for that service, one basicHttpBinding named "USZipSoap" and one customBinding named "USZipSoap12", they can be found in the various files under service reference in solution explorer. You can specify the binding name with the client contructor like this:
= New ZipService1.USZipSoapClient("USZipSoap")

Awesome John! Works great... thanks for the quick reply.
 
Back
Top