Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you pass a datetime param. calling a .net ws?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01670728
Message ID:
01670734
Vues:
40
>>>Hi
>>>I am trying to consume a .net web service, where one of the parameters is a datetime. Tried all sorts of formats, but they all fail in this field. Any ideas how should i format it?
>>>
>>>TIA
>>>Jaime
>>
>>ttoc(datetime, 3) is the correct XML format for a date time as Antonio already said.
>>
>>FWIW I would write a C# wrapper for the service (with SOAP, it was always problematic for me to consume a service from within VFP).
>>
>>Maybe you can share the wsdl address of the service.
>
>Thanks Cetin
>I can't share the wsdl, it's in an intranet, but the function itself is extremely easy:
>
>GetFlightDetails ( airline as string, flightNo as string, flightDate as datetime, SecKey as string ) as FlightData
>*** the guy that wrote it tests it through fiddler, and sent me the following:
>URL
>http://server/WS/ASMXServices/AsmxWrapperService.asmx/GetFlightDetails
>
>Header
>Content-Type: application/x-www-form-urlencoded
>
>Body
>airline=ly&flightNo=315&flightDate=05/16/2018&SecKey=some_secret_key
>
Jaime,

Won't these settings format the date as you require?
SET DATE TO "MDY"
SET CENTURY ON
SET MARK TO "/"

TEXT TO m.Body TEXTMERGE NOSHOW
airline=ly&flightNo=315&flightDate=<<DTOC(DATE(2018, 5, 16))>>&SecKey=some_secret_key
ENDTEXT
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform