Me topé con el problema siguiente.
Yo hice un producto (web service) que dependia de un web service previamente instalado (Creado por otro desarrollador en otro momento) que es prerequisito de mi webservice.
El chiste es que lo habia tomado de un url, pero cuando cambió al reconfigurar el web.config no tomo el cambio ya que se habia quedado hardcoded.
aparte de hacer lo de la siguiente solucion:
http://www.codeproject.com/Articles/12317/How-to-make-your-Web-Reference-proxy-URL-dynamic
lo que hice fue agregarle este codigo en Resources.cs (Codigo autogenerado).
WEB.CONFIG
<?xml version="1.0"?> <configuration> ... <appSettings> ... <add key="LLAVE" value="http://servidor/carpeta/webservice.dll/soap/IProceso"/> ... </appSettings> </configuration>
REFERENCE.CS
protected static string GetApplicationSettings(string sKey) { string sValue = null; //check if the AppSettings section has items if (System.Web.Configuration.WebConfigurationManager.AppSettings.Count > 0) { sValue = System.Web.Configuration.WebConfigurationManager.AppSettings[sKey]; } return sValue; } /// <remarks/> public IProcesosWSservice() { string TressProcesos = GetApplicationSettings("LLAVE"); this.Url = TressProcesos; if ((this.IsLocalFileSystemWebService(this.Url) == true)) { this.UseDefaultCredentials = true; this.useDefaultCredentialsSetExplicitly = false; } else { this.useDefaultCredentialsSetExplicitly = true; } }
Esta funcion en V .net 2005 da formato a un numero que lo tienes como string y quieres regresarlo como string con pesos o numeros negativos. De ahi se puede partir para muchas otras cosas.!
Private Function darFormato(ByVal numeroStr As String) As String Try If numeroStr = "" Or numeroStr = "0" Then Return "" Else Return CDbl(numeroStr).ToString("$#,###.##;($#,###.##);Zero") End If Catch ex As Exception Throw ex End Try End Function