c# - type, which is not valid in the given context -


'dinnorapp.dinnorappweb2.addusuarioconimagendesktoprequest' 'type', not valid in given context 

i have problem kind of error, code here

   public int addusuario(string nombrecompleto, string usuario, string correo, string contraseña, string palabraclave, byte[] imagen)     {         users = new usuario();         dinnorappweb2.usuario usuario3 = new dinnorappweb2.usuario();         soap = new dinnorappweb2.webservice1soapclient();         usuario3 = soap.addusuarioconimagendesktop(dinnorappweb2.addusuarioconimagendesktoprequest(nombrecompleto, usuario, correo, contraseña, palabraclave, imagen));         users.nombrecompleto = usuario3.nombrecompleto;         users.usuario = usuario3.usuario;          if (users.nombrecompleto != null && users.usuario != null)         {              return 1;         }          return 0;     } 

the code above, in winform, information use webservice

on references file is

  // codegen: parameter 'imagen' requires additional schema information cannot captured using parameter mode. specific attribute 'system.xml.serialization.xmlelementattribute'.     [system.servicemodel.operationcontractattribute(action="http://tempuri.org/addusuarioconimagen", replyaction="*")]     [system.servicemodel.xmlserializerformatattribute(supportfaults=true)]     dinnorapp.dinnorappweb2.addusuarioconimagenresponse addusuarioconimagen(dinnorapp.dinnorappweb2.addusuarioconimagenrequest request);      [system.servicemodel.operationcontractattribute(action="http://tempuri.org/addusuarioconimagen", replyaction="*")]     system.threading.tasks.task<dinnorapp.dinnorappweb2.addusuarioconimagenresponse> addusuarioconimagenasync(dinnorapp.dinnorappweb2.addusuarioconimagenrequest request); 

the code above, when call service reference(webservice)

 [system.servicemodel.operationcontractattribute(action="http://tempuri.org/addusuario", replyaction="*")]     [system.servicemodel.xmlserializerformatattribute(supportfaults=true)]     int addusuario(string nombrecompleto, string usuario, string correo, string contraseña, string palabraclave);      [system.servicemodel.operationcontractattribute(action="http://tempuri.org/addusuario", replyaction="*")]     system.threading.tasks.task<int> addusuarioasync(string nombrecompleto, string usuario, string correo, string contraseña, string palabraclave); 

the code above, can invoke method parameter easily, error think problem byte[] don't know why, because if change byte[] string or int or similar in parameter, normal rest.

the byte[] save or add image on mysql. how can solve it? hope can help.

sorry english.

you realize somewords in spanish.

edit:

i solved , correct code:

dinnorappweb2.addusuarioconimagendesktoprequest add2 = new dinnorappweb2.addusuarioconimagendesktoprequest(nombrecompleto,usuario,correo,contraseña,palabraclave,imagen);  soap.addusuarioconimagendesktop(add2); 


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -