Problem to consume Web Service

0

I'm new to Web Services.

I have the following WebService

I need to get the quote of the currency for the current day but I can not get any data.

I'm trying to do it in C #, add the reference to the Web Service but I can not get the data.

The input parameter is a type of structured data called wsbcucotizacionesin which contains:

Moneda[Item] - Numerico(4)
FechaDesde - Date
FechaHasta - Date
Grupo - Numerico(2)

Then I have the output parameter which is a type of structured data called wsbcucotizacionesout which contains:

answerstatus - is a type of structured data where it throws the error codes datacotizaciones - type of structured data where it contains information of the currency that you consult (Date, Currency, Name, ....)

I made a Form where I have a txt to put the coin and a button to send the call, but I'm not getting anything and I do not know how it is done.

I did inside my button:

WebReference1.wsbcucotizacionesin test = new WebReference1.wsbcucotizacionesin();

test.FechaDesde = fecha.ToString();

They can give me a hand on how it should be done or go to find out how I get the data I want from the Web Service.

    
asked by Manuel Larrosa 04.06.2017 в 02:01
source

1 answer

0

As @Veelicus says you should put more code, additionally, WS when receiving the dates in string, you must know what format you expect, since it could be different from the one you are sending to, since a result of ToString depends on the regional configuration
This is an example of the XML that should be generated

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cot="Cotiza">
   <soapenv:Header/>
   <soapenv:Body>
      <cot:wsbcucotizaciones.Execute>
         <cot:Entrada>
            <cot:Moneda>               
               <cot:item>2223</cot:item>
            </cot:Moneda>           
            <cot:FechaDesde>2017-06-05 12:00:00</cot:FechaDesde>
            <cot:FechaHasta>2017-06-05 23:00:00</cot:FechaHasta>
            <cot:Grupo>0</cot:Grupo>
         </cot:Entrada>
      </cot:wsbcucotizaciones.Execute>
   </soapenv:Body>
</soapenv:Envelope>
    
answered by 06.06.2017 в 02:02