
23/09/2015, 11:40
|
| | Fecha de Ingreso: noviembre-2014
Mensajes: 22
Antigüedad: 10 años, 3 meses Puntos: 0 | |
Respuesta: Mantener la sesion Hola
Genero el cliente , usando el generador de C#
static void Main(string[] args)
{
CalculadoraClient cal = new CalculadoraClient();
while (true)
{
Console.WriteLine(cal.getSes());
}
}
Donde getSes me devuelve el identificador de sesion (operacion realizada en java)
Codigo del cliente generado
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebService.ServiceReference1.calc {
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Names pace="http://miCalc", ConfigurationName="ServiceReference1.calc.Calculad ora")]
public interface Calculadora {
[System.ServiceModel.OperationContractAttribute(Act ion="", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(S tyle=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults=true, Use=System.ServiceModel.OperationFormatUse.Encoded )]
[return: System.ServiceModel.MessageParameterAttribute(Name ="getURLReturn")]
string getURL();
[System.ServiceModel.OperationContractAttribute(Act ion="", ReplyAction="*")]
[return: System.ServiceModel.MessageParameterAttribute(Name ="getURLReturn")]
System.Threading.Tasks.Task<string> getURLAsync();
[System.ServiceModel.OperationContractAttribute(Act ion="", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(S tyle=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults=true, Use=System.ServiceModel.OperationFormatUse.Encoded )]
[return: System.ServiceModel.MessageParameterAttribute(Name ="sumaReturn")]
int suma(int x, int y);
[System.ServiceModel.OperationContractAttribute(Act ion="", ReplyAction="*")]
[return: System.ServiceModel.MessageParameterAttribute(Name ="sumaReturn")]
System.Threading.Tasks.Task<int> sumaAsync(int x, int y);
[System.ServiceModel.OperationContractAttribute(Act ion="", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(S tyle=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults=true, Use=System.ServiceModel.OperationFormatUse.Encoded )]
[return: System.ServiceModel.MessageParameterAttribute(Name ="getVersionWebReturn")]
int getVersionWeb();
[System.ServiceModel.OperationContractAttribute(Act ion="", ReplyAction="*")]
[return: System.ServiceModel.MessageParameterAttribute(Name ="getVersionWebReturn")]
System.Threading.Tasks.Task<int> getVersionWebAsync();
[System.ServiceModel.OperationContractAttribute(Act ion="", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute(S tyle=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults=true, Use=System.ServiceModel.OperationFormatUse.Encoded )]
[return: System.ServiceModel.MessageParameterAttribute(Name ="getSesReturn")]
string getSes();
[System.ServiceModel.OperationContractAttribute(Act ion="", ReplyAction="*")]
[return: System.ServiceModel.MessageParameterAttribute(Name ="getSesReturn")]
System.Threading.Tasks.Task<string> getSesAsync();
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.ServiceModel", "4.0.0.0")]
public interface CalculadoraChannel : WebService.ServiceReference1.calc.Calculadora, System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Sy stem.ServiceModel", "4.0.0.0")]
public partial class CalculadoraClient : System.ServiceModel.ClientBase<WebService.ServiceR eference1.calc.Calculadora>, WebService.ServiceReference1.calc.Calculadora {
public CalculadoraClient() {
}
public CalculadoraClient(string endpointConfigurationName) :
base(endpointConfigurationName) {
}
public CalculadoraClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public CalculadoraClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public CalculadoraClient(System.ServiceModel.Channels.Bin ding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
public string getURL() {
return base.Channel.getURL();
}
public System.Threading.Tasks.Task<string> getURLAsync() {
return base.Channel.getURLAsync();
}
public int suma(int x, int y) {
return base.Channel.suma(x, y);
}
public System.Threading.Tasks.Task<int> sumaAsync(int x, int y) {
return base.Channel.sumaAsync(x, y);
}
public int getVersionWeb() {
return base.Channel.getVersionWeb();
}
public System.Threading.Tasks.Task<int> getVersionWebAsync() {
return base.Channel.getVersionWebAsync();
}
public string getSes() {
return base.Channel.getSes();
}
public System.Threading.Tasks.Task<string> getSesAsync() {
return base.Channel.getSesAsync();
}
}
} |