allanmayberry88
allanmayberry88

Reputation: 113

Web Service - No endpoint listening

I can't get this to run properly. Exception being thrown (EndPointNotFound) and error message w/ stack trace I am receiving is below.

I have done all the obvious stuff (I think!) checked that endpoint URI's match, that the service is actually running and that I can hit it from my machine.

Happy to post code if you let me know what you need to help!

Any help is very much appreciated!

"There was no endpoint listening at URL/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."

The remote server returned an error: (407) Proxy Authentication Required. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.

Source Error:

Line 1140:
Line 1141: Public Function GetMember(ByVal ArdbegMember1 As ArdbegWeb.ArdbegMember) As ArdbegWeb.ArdbegMember Implements IArdbegWeb.GetMember Line 1142: Return MyBase.Channel.GetMember(ArdbegMember1) Line 1143: End Function Line 1144:

Source File: C:\Documents and Settings\amayberry\My Documents\Visual Studio 2008\Projects\xpertformstest\ardbeg\ardbeg\ArdbegWeb.vb Line: 1142

Stack Trace:

[WebException: The remote server returned an error: (407) Proxy Authentication Required.] System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) +1868309 System.Net.HttpWebRequest.GetRequestStream() +13 System.ServiceModel.Channels.WebRequestHttpOutput.GetOutputStream() +68

[EndpointNotFoundException: There was no endpoint listening at https://www.URL/service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.] System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7596735 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +275 ardbeg.IArdbegWeb.GetMember(ArdbegMember ArdbegMember1) +0 ardbeg.ArdbegWebClient.GetMember(ArdbegMember ArdbegMember1) in C:\Documents and Settings\amayberry\My Documents\Visual Studio 2008\Projects\xpertformstest\ardbeg\ardbeg\ArdbegWeb.vb:1142 ardbeg._Default.Button1_Click1(Object sender, EventArgs e) in C:\Documents and Settings\amayberry\My Documents\Visual Studio 2008\Projects\xpertformstest\ardbeg\ardbeg\Default.aspx.vb:40 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Edit

I think this has to be a problem with how my app actually hits the web service - although my browser can access the webservice (I have to use a non-default proxy to do this because of access restrictions across the business), I don't think my compiled app is automatically using this. Is there any obvious way to check, and how would I force it to use this if that is the problem?

Edit

Code from behind my main page:

Dim myBinding As New WSHttpBinding()


myBinding.Security.Mode = SecurityMode.Transport
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate

Dim ea As New EndpointAddress("https://URL/service.svc")

Dim cc As New ArdbegWebClient(myBinding, ea)
cc.ClientCredentials.ClientCertificate.SetCertificate( _
StoreLocation.CurrentUser, StoreName.My, X509FindType.FindBySubjectName, "CERTIFICATE")
Dim abMem As New ArdbegMember
Dim retMem As New ArdbegMember

abMem.MemberID = TextBox1.Text

Try
    cc.Open()
    retMem = cc.GetMember(abMem)
    MesgBox(retMem.Surname)
    cc.Close()

Catch cex As CommunicationException
    MesgBox("CommEX - " & cex.Message)
    cc.Abort()
Catch tex As TimeoutException
    MesgBox("TimeEX - " & tex.Message)
    cc.Abort()
Finally
    MesgBox("Closed the Client")
End Try

All I am trying to do at the moment is enter a client id number and have their surname returned via the webservice - just so that I know it is working.

Upvotes: 1

Views: 3278

Answers (1)

allanmayberry88
allanmayberry88

Reputation: 113

I've figured out the problem, for some reason changing the proxy settings in Internet Explorer (despite the fact I don't use it at all) to match the settings I know allow me to hit the web service seems to have allowed my code to hit it.

i don't know how or why, because my code is only ever run in FF but this seems to have allowed it to work.

Upvotes: 2

Related Questions