How I can receive a class as parameter within asmx class? and as I can validate that the class contains data?
My class:
public class ws_loginViewModel
{
public int user { get; set; }
public string pass { get; set; }
}
My method within asmx class
public int Login(ws_loginViewModel user)
when cosuming this method without send parameter, i have the next error
soap:Client System.Web.Services.Protocols.SoapException: El servidor no puede leer la solicitud. ---> System.InvalidOperationException: Error en el documento XML (7, 41). ---> System.FormatException: La cadena de entrada no tiene el formato correcto. en System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) en System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) ...
I consume with SoapUi software and it generate this xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:vac="">
<soapenv:Header/>
<soapenv:Body>
<vac:Login>
<!--Optional:-->
<vac:user>
<vac:user>?</vac:user>
<!--Optional:-->
<vac:pass>?</vac:pass>
</vac:user>
</vac:Login>
</soapenv:Body>
</soapenv:Envelope>
userproperty. - David