2016-06-24 2 views
2

내가 할 :wsdl에 연결하는 중 오류가 발생 했습니까?

base64string = base64.encodestring('%s:%s' % (userid, passwd)).replace('\n', '') 
authenticationHeader = { 
    "Authorization" : "Basic %s" % base64string, 
"Accept-Encoding" :"gzip,deflate", 
"Content-Length" :"1086", 
"Host" :"uslugaterytws1test.stat.gov.pl", 
"Connection" :"Keep-Alive", 
} 

client = Client(url=wsdl_url, headers=authenticationHeader) 
security = Security() 

token = UsernameToken(userid, passwd) 
token.setnonce('MyNonceString...') 
token.setcreated(datetime.now()) 
security.tokens.append(token) 
client.set_options(wsse=security) 

result = client.service.CzyZalogowany() 
print result 

클라이언트 리턴 (58 개) 방법. 하지만 방법 CzyZalogowany 프로그램 복귀를 사용하고자 할 때 :

ssl.SSLError: ('The read operation timed out',) 

방법를 해결하려면? SoupUi에서

#

DUBUG : 파이썬 스크립트에서

DEBUG:>> "POST /TerytWs1.svc HTTP/1.1[\r][\n]" 
DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]" 
DEBUG:>> "Content-Type: text/xml;charset=UTF-8[\r][\n]" 
DEBUG:>> "SOAPAction: "http://tempuri.org/ITerytWs1/CzyZalogowany"[\r][\n]" 
DEBUG:>> "Authorization: Basic --XXXX--[\r][\n]" 
DEBUG:>> "Content-Length: 1086[\r][\n]" 
DEBUG:>> "Host: uslugaterytws1test.stat.gov.pl[\r][\n]" 
DEBUG:>> "Connection: Keep-Alive[\r][\n]" 
DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]" 
DEBUG:>> "[\r][\n]" 
DEBUG:>> "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">[\n]" 
DEBUG:>> " <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken wsu:Id="UsernameToken-1EDC585567575555675433"><wsse:Username>--USER--</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">--PASSWORD--</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">ffoUxdsf49tsdLryxWufW==</wsse:Nonce><wsu:Created>2016-06-28T09:14:05.995Z</wsu:Created></wsse:UsernameToken></wsse:Security><wsa:Action>http://tempuri.org/ITerytWs1/CzyZalogowany</wsa:Action></soapenv:Header>[\n]" 
DEBUG:>> " <soapenv:Body>[\n]" 
DEBUG:>> "  <tem:CzyZalogowany/>[\n]" 
DEBUG:>> " </soapenv:Body>[\n]" 
DEBUG:>> "</soapenv:Envelope>" 

디버그 :

DEBUG:suds.client:sending to (https://uslugaterytws1test.stat.gov.pl/TerytWs1.svc) 
message: 
    <?xml version="1.0" encoding="UTF-8"?> 
    <SOAP-ENV:Envelope xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns0="http://tempuri.org/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
    <SOAP-ENV:Header> 
     <wsse:Security mustUnderstand="true"> 
     <wsse:UsernameToken> 
      <wsse:Username>--USER--</wsse:Username> 
      <wsse:Password>--PASSWORD--</wsse:Password> 
      <wsse:Nonce>MyNonceString...</wsse:Nonce> 
      <wsu:Created>2016-06-28T13:16:17.180000Z</wsu:Created> 
     </wsse:UsernameToken> 
     </wsse:Security> 
    </SOAP-ENV:Header> 
    <ns1:Body> 
     <ns0:CzyZalogowany/> 
    </ns1:Body> 
</SOAP-ENV:Envelope> 
DEBUG:suds.client:headers = {'Content-Length': '1086', 'Connection': 'Keep-Alive', 'Accept-Encoding': 'gzip,deflate', 'SOAPAction': u'"http://tempuri.org/ITerytWs1/CzyZalogowany"', 'Content-Type': 'text/xml; charset=utf-8', 'Host': 'uslugaterytws1test.stat.gov.pl', 'Authorization': 'Basic --XXXX--'} 

아마이 네임 스페이스의 부족 때문이다. 네임 스페이스를 추가하는 방법?

+0

ssl 레이어가 작동합니까? 나머지는 별도로 호출합니까 (브라우저, 컬, wget)? 어쩌면 "CzyZalogowany"(이것이 무엇을 의미하든)가 더 많은 시간을 필요로하고 매개 변수가 필요합니다 ... 자세한 내용을 제공해주십시오. – Dilettant

+0

ssl 레이어가 작동합니까? - 확인하는 방법? SoapUI 및 그 작업에서 wsdl을 테스트합니다. true user7172

+0

SoapUI를 사용하는 경우 클라이언트 인증서를 사용하여 SSL을 테스트해야 할 수 있습니다. http://stackoverflow.com/questions/13994164/soapui-certificate-authentication을 참조하십시오. –

답변

0

나는 uslugaterytws1test.stat.gov.pl에이 특정한 webservice에 동일한 문제가 있었다. 해결 방법은 SOAP-ENV 네임 스페이스를 soapenv으로 변경하는 것입니다.

관련 문제