2009-09-26 1 views
0

을 사용하여 비누 요청을하면서 헤더를 추가하는 방법 -내가 같이 정확하게 볼 것이다 비누 요청하고 싶었 것을 사용하여, 나는 WSDL 파일이 soappy

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Header> 
    <AuthSoapHd xmlns="http://foobar.org/"> 
     <strUserName>string</strUserName> 
     <strPassword>string</strPassword> 
    </AuthSoapHd> 
    </soap:Header> 
    <soap:Body> 
    <SearchQuotes xmlns="http://foobar.org/"> 
     <searchtxt>string</searchtxt> 
    </SearchQuotes> 
    </soap:Body> 
</soap:Envelope> 

이를 sovle하기를, 나는이

했다
>> from SOAPpy import WSDL 
>> WSDLFILE = '/path/foo.wsdl' 
>> server = WSDL.Proxy(WSDLFILE) 
>> server.SearchQuotes('rel') 

나는이 오류

faultType: <Fault soap:Server: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. 

에게 얻을 나는 그것을 디버깅이

01,235있어
*** Outgoing SOAP ****************************************************** 
<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope 
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="http://www.w3.org/1999/XMLSchema" 
> 
<SOAP-ENV:Body> 
<SearchQuotes SOAP-ENC:root="1"> 
<v1 xsi:type="xsd:string">rel</v1> 
</SearchQuotes> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

헤더가 포함되지 않은 것을 볼 수 있습니다. WSDL 파일에는 몇 가지 버그가 있다고 생각합니다. 자,이 발신 비누 요청에 헤더를 추가하는 방법을 누군가에게 제안 할 수 있습니까?

어떤 종류의 도움을 주시면 감사하겠습니다. 미리 감사는

답변

0

하지 테스트,하지만 난 당신이 (이 장착 된 프록시를 얻을 server = server._hd (hd)를 사용하여 다음, SOAPpy.Header 인스턴스를, 즉, 비누 헤더를 추가하고 수험하는 것이 좋습니다 the docs 방법을 사용할 수 있다고 생각합니다 귀하의 경우 비록 그 말하듯이 WSDL을 수정하는 것이 좋을지도 모릅니다.).