2017-12-28 76 views
0

web2py pysimplesoap을 사용하고 있으며 서버에서 데이터를 가져 오려고합니다. 메소드를 호출 한 후 응답이 있지만 xml에는 데이터가 없습니다. 제안 사항이 있으십니까? 여기 python web2py pysimplesoap 클라이언트 봉투 데이터

내 코드

url = "https://www.xxx.ss/demo/aaa/aaa" 
# 


xml = ("""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cet="http://xxxx.yy"> 
     <soapenv:Header/> 
     <soapenv:Body> 
      <cet:GetEmployedElement> 
      <!--Zero or more repetitions:--> 
      <cet:GetEmployed> 
       <cet:OrganizationCode></cet:OrganizationCode> 
       <cet:LastName></cet:LastName> 
       <cet:FirstName></cet:FirstName> 
       <cet:AktCard></cet:AktCard> 
       <cet:JobAgreementType></cet:JobAgreementType> 
       <cet:Mferac></cet:Mferac> 
      </cet:GetEmployed> 
      </cet:GetEmployedElement> 
     </soapenv:Body> 
    </soapenv:Envelope> 
    """) 

from gluon.contrib.pysimplesoap.client import SoapClient, SoapFault 
client = SoapClient(wsdl="https://www.xxxx.yy/demo/aaa/aaa?wsdl", location="https://www.xxxx.yy", cacert=None, trace=True) 
# call SOAP method 
#print server.methods['getEmployed'] 
#print client 
print client.getEmployed() 

하고 내 결과는

POST http://192.168.66.53:8380/demo/KadrisData/KadrisData 
SOAPAction: "http://cetrtapot.si/getEmployed" 
Content-length: 269 
Content-type: text/xml; charset="UTF-8" 

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soap:Header/> 
<soap:Body> 

</soap:Body> 
</soap:Envelope> 

입니다 그리고 잠시 후 내가 먼저 내가 설정하는 데 필요한 간단한 비누로

urllib2.URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond> 

답변

0

와 시간 제한을받을 내부 URL을 호출 한 이후 XML을 가져올 URL

client.services['xxx']['ports']['xxx']['location'] = 'https://www.xxx.yyy/demo/gg/gg' 

그러나 xml 구문 분석 및 기타 문제로 인해 제프 라이브러리를 사용하기로 결정했기 때문에 일부 수정 작업도 수행해야했습니다. 이 버그 있지만 데이터를 검색 할 수있는 호출입니다 잘못 수행 된 경우 내가 그래서 몇 가지 물건을 수정

client = Client(url ,strict=False) 
#In case some parameters expected from envelope were missing I got an error, so I needed to set strict = False 
x = client.service.getEmployed 
x._proxy._binding_options['address'] = 'https://www.xxxx.yyyy/demo/gggg/gggta' 
#a new binding option neede to be set otherwise some internal 192.168.xx.yy was called and that is why I always got an timeout error 

희망 (코드에 주석 참조)에 필요한 모르는이 사람

하는 데 도움이