Unable to connect. No server found.

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
clabough
Posts: 27
Joined: Thu Sep 15, 2005 4:55 pm

Unable to connect. No server found.

Post by clabough » Thu Nov 01, 2012 11:55 am

I'm using Vault Standard 5.1.1.19215 with the matching API dlls and cannot connect to the server. If I use:

Code: Select all

			ServerOperations.client.LoginOptions.URL = string.Format("https://{0}/VaultService", "myServerURL");
			ServerOperations.client.LoginOptions.User = this.VaultUser;
			ServerOperations.client.LoginOptions.Password = this.VaultPassword;
			ServerOperations.client.LoginOptions.Repository = this.VaultRepository;
			ServerOperations.Login();
I get the error - "The connection to the server failed: server cannot be contacted or uses a protocol that is not supported by this client. Unable to connect to https://myServerURL/vault/VaultService. No server was found at the specified URL. Please verify your network settings using the Options dialog under the Tools menu in the Vault GUI Client. Web Exception: The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="%2fvault%2fVaultWeb%2fLogin.aspx%3fReturnUrl%3d%252fvault%252fVaultService%252fVaultService.asmx">here</a>.</h2>
</body></html>

--."

If I change it to:

Code: Select all

			ServerOperations.client.LoginOptions.URL = string.Format("https://{0}/VaultService.asmx", "myServerURL");
			ServerOperations.client.LoginOptions.User = this.VaultUser;
			ServerOperations.client.LoginOptions.Password = this.VaultPassword;
			ServerOperations.client.LoginOptions.Repository = this.VaultRepository;
			ServerOperations.Login();
I get - "The connection to the server failed: server cannot be contacted or uses a protocol that is not supported by this client. Unable to connect to https://myServerURL/vault/VaultService.asmx. No server was found at the specified URL. Please verify your network settings using the Options dialog under the Tools menu in the Vault GUI Client. Web Exception: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<html>
<head>
<title>Request format is unrecognized for URL unexpectedly ending in '/VaultService.asmx'.</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head>

<body bgcolor="white">

<span><H1>Server Error in '/vault' Application.<hr width=100% size=1 color=silver></H1>

<h2> <i>Request format is unrecognized for URL unexpectedly ending in '/VaultService.asmx'.</i> </h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

<b> Description: </b>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.

<br><br>

<b> Exception Details: </b>System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/VaultService.asmx'.<br><br>

<b>Source Error:</b> <br><br>

<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>

</td>
</tr>
</table>

<br>

<b>Stack Trace:</b> <br><br>

<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>

[InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/VaultService.asmx'.]
System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +405961
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +212
System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +47
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
</pre></code>

</td>
</tr>
</table>

<br>

<hr width=100% size=1 color=silver>

<b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.3634; ASP.NET Version:2.0.50727.3634

</font>

</body>
</html>
<!--
[InvalidOperationException]: Request format is unrecognized for URL unexpectedly ending in '/VaultService.asmx'.
at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->
--.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Unable to connect. No server found.

Post by Beth » Thu Nov 01, 2012 12:27 pm

Usually, when you see this,
or uses a protocol that is not supported by this client
, as part of an error, it means that you are using a different version of Vault than what the server is.

You might have accidentally grabbed the latest Vault Client API instead of the Vault 5.1.x Client API. Get your Vault Client API from the older version page located here: http://www.sourcegear.com/vault/downloads2.html, and double check that you get the Vault 5.1.2 client API.
Beth Kieler
SourceGear Technical Support

clabough
Posts: 27
Joined: Thu Sep 15, 2005 4:55 pm

Re: Unable to connect. No server found.

Post by clabough » Thu Nov 01, 2012 12:30 pm

I may have found the problem. The ServerOperations class has a check for "VaultService" hard-coded in the login method and our installation is at https://myServerUrl/Vault

I don't see a way to override this behavior in the API.

I have the 5.1.1.19215 Standard version of the API files to match my Vault Standard 5.1.1.19215 server.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Unable to connect. No server found.

Post by Beth » Thu Nov 01, 2012 3:44 pm

If you got the last post, I decided to rewrite it.

Here's how a URL might look: string url = "http://VaultServer/VaultService";
The ServerOperations class has a check for "VaultService" hard-coded in the login method and our installation is at https://myServerUrl/Vault
The Vault client works the same, so it doesn't make a difference.

Does your Vault GUI client work? If so, what kind of information do you put in for the Vault GUI client?
Beth Kieler
SourceGear Technical Support

clabough
Posts: 27
Joined: Thu Sep 15, 2005 4:55 pm

Re: Unable to connect. No server found.

Post by clabough » Thu Nov 01, 2012 3:57 pm

The GUI client works fine, but the API does not. I copied the /vault folder over to another server and put it into /vaultservice and the API is connecting just fine there.

The login() method of ServerOperations does this check, which forces "VaultService" onto the end.

Code: Select all

      if (ServerOperations.client.LoginOptions.URL.IndexOf("VaultService") < 0)
      {
        if (!ServerOperations.client.LoginOptions.URL.EndsWith("/"))
          ServerOperations.client.LoginOptions.URL = ServerOperations.client.LoginOptions.URL + "/";
        ServerOperations.client.LoginOptions.URL = ServerOperations.client.LoginOptions.URL + "VaultService";
      }

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Unable to connect. No server found.

Post by Beth » Wed Nov 21, 2012 3:26 pm

The ServerOperations class has a check for "VaultService" hard-coded in the login method and our installation is at https://myServerUrl/Vault
Unfortunately, we don't have a way around that. The installation has to be at https://myServerUrl/VaultService.
Beth Kieler
SourceGear Technical Support

Post Reply