Ruby로 Savon을 사용하여 SOAP 요청을하려고하는데 서버에서 400 개의 잘못된 요청 응답을받습니다. Savon - SOAP - ruby - 400 잘못된 요청
이
은 (soapUI에 따라) 내가 만들려고 요청입니다 : 여기<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:apis="http://www.csisoftwareusa.com/ApiService">
<soap:Header/>
<soap:Body>
<apis:AuthenticateConsumer>
<!--Optional:-->
<apis:consumerName>?</apis:consumerName>
<!--Optional:-->
<apis:consumerPassword>?</apis:consumerPassword>
</apis:AuthenticateConsumer>
</soap:Body>
</soap:Envelope>
내가 루비로 만드는 요청입니다; 0x0000000000 잘못된 요청 오류를 반환합니다.
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<ins0:AuthenticateConsumer>
<ins0:consumerName>?</ins0:consumerName>
<ins0:consumerPassword>?</ins0:consumerPassword>
</ins0:AuthenticateConsumer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Http Headers: SOAPAction: "http://www.csisoftwareusa.com/ApiService/AuthenticateConsumer", Content-Type: text/xml;charset=UTF-8, Content-Length: 504
여기는 Python으로 요청할 수있는 요청입니다. 이 요청은 성공 :
<SOAP-ENV:Envelope>
<SOAP-ENV:Header/>
<ns0:Body>
<ns1:AuthenticateConsumer>
<ns1:consumerName>?</ns1:consumerName>
<ns1:consumerPassword>?</ns1:consumerPassword>
</ns1:AuthenticateConsumer>
</ns0:Body>
</SOAP-ENV:Envelope>
Http headers: {'SOAPAction': u'"http://www.csisoftwareusa.com/ApiService/AuthenticateConsumer"', 'Content-Type': 'text/xml; charset=utf-8'}
내가 레일 응용 프로그램에이 API를 호출을 통합하는 데 필요한, 그래서 파이썬에서 그 일을하는 것은 올바른 해결책이 아니다.
제가 누락 된 부분을 누구든지 볼 수 있는지 궁금합니다. 비어있는 <SOAP-ENV:Header />
태그에 문제가 있습니까? 그렇다면 Savon 요청에 어떻게 추가 할 수 있습니까?
감사합니다, 여기 스튜어트
무엇을 ' SOAP-ENV입니다 : 봉투 >>'당신의 루비 예에? 잘못된 XML이있는 것 같습니다. Nokogiri와 같은 xml 빌더를 사용하여 실제로 빌드해야합니다. –
@MichaelPapile 분명히 StackOverflow 질문의 서식을 잘못 입력 한 것 같습니다. 나는 쿼리를 reran했고 그 마지막 대괄호가 없다. 나는 그 문제를 해결하기 위해 본문을 편집했다. 감사! – Stuart
여기에 대한 업데이트가 있습니까? 나는 똑같은 고민 중이다. Savon Gem의 버전 2 사용하기 – hyeomans