c# - Consuming a webservice returning array in C # -


i have 2 webservices developed in advpl consumed in application in c # vs2013 (windows form).

the first 1 returns string , working perfectly, second , returns array can not consume @ all.

it's not connection problem, because if change second webservice return string works normally, can not array in visual studio 2013.

he returning me "can not implicitly convert type" error.

follows method of webservice published , error generated:

webservice request:

<?xml version="1.0" encoding="utf-8"?" <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"  xmlns:xsd="http://www.w3.org/2001/xmlschema"  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body>    <_cfilial>string</_cfilial> </soap:body> </soap:envelope> 

webservice response

<?xml version="1.0" encoding="utf-8"?" <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"  xmlns:xsd="http://www.w3.org/2001/xmlschema"  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body>    <tarray>       <testearray>          <_ccontigencia>string</_ccontigencia>          <_cdigital01>string</_cdigital01>          <_cdigital02>string</_cdigital02>          <_cmatricula>string</_cmatricula>          <_cnome>string</_cnome>          <_csituacao>string</_csituacao>       </testearray>       <testearray>          <_ccontigencia>string</_ccontigencia>          <_cdigital01>string</_cdigital01>          <_cdigital02>string</_cdigital02>          <_cmatricula>string</_cmatricula>          <_cnome>string</_cnome>          <_csituacao>string</_csituacao>       </testearray>    </tarray> </soap:body> </soap:envelope> 

consumindo:

ws_funcsponto.funcsponto recebe_cadastro = new ws_funcsponto.funcsponto(); ws_funcsponto.testearray qwert = new ws_funcsponto.testearray(); qwert = recebe_cadastro.pegainform("00"); 

erro: error 1 cannot implicitly convert type 'relogio_ponto.ws_funcsponto.testearray[]' 'relogio_ponto.ws_funcsponto.testearray

i guess since there multiple elements treated array. try this:

ws_funcsponto.testearray[] qwert = new ws_funcsponto.testearray[10]; qwert = recebe_cadastro.pegainform("00"); 

instead of getting response in single element, receive in array.


Comments

Popular posts from this blog

c# - how to use buttonedit in devexpress gridcontrol -

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - System.FormatException' occurred in MongoDB.Bson.dll - XXX is not a valid 24 digit hex string -