[Linux-Biella] utilizzo di SOAP

PaulTT paultt a bilug.it
Ven 12 Ott 2018 15:48:33 CEST


On 12/10/2018 15:47, Carolina Maiorana wrote:
> On 12. okt. 2018 15:39, PaulTT wrote:
>> On 12/10/2018 15:32, Carolina Maiorana wrote:
>>> On 12. okt. 2018 15:21, PaulTT wrote:
>>>
>>>>>
>>>> ho visto ora
>>>> nell opzione url non devi mettere il ?wdsl eh
>>>> quello serve per ottenere le funzioni, ma non per mandare la richiesta
>>>>
>>>>
>>> Mi da' comunque lo stesso errore.
>>>
>> si' ma tu che request stai postando?????
>> ometti login e pass , ma con poche info cosi'  gnia si fa
>>
>>
> Ecco:
>
> #!/usr/bin/env python
> # encoding: utf-8
>
> import requests
>
> url = "https://www.nowcast.de/axis2/services/LightningService"
>
> headers = {'content-type': 'text/xml'}
>
> body = """<?xml version="1.0" encoding="UTF-8"?>
>
> <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:type="http://service.nowcast.de/lightning/types">
>     <soapenv:Header/>
>         <soapenv:Body>
>             <typ:HistoricRequest>
>                 <LoginType>

^^^^ prova a metter solo login qui invece di LoginType (e idem sotto /)
quel typ: boh non lo capisco, ma puo' darsi serva, puo' darsi di no


> <login>***</login>
>                     <passwd>***</passwd>
>                 </LoginType>
> <start>2009−05−02T00:00:00.000+00:00</start>
> <end>2009−05−02T10:00:00.000+00:00</end>
>                 <area>
>                     <x1>11</x1>
>                     <y1>48</y1>
>                     <x2>12</x2>
>                     <y2>49</y2>
>                 </area>
>             </typ:HistoricRequest>
>         </soapenv:Body>
> </soapenv:Envelope>"""
>
> response = requests.post(url, data=body, headers=headers)
> print response.content
>


-- 
It is a good day to die. But the day is not yet over.


Maggiori informazioni sulla lista Linux