암을 무시 savon 몸 네임 스페이스에 의해 작성된 다시 쓰기 -이 클라이언트 변수가 ins0
: 나는 'Savon는 namespace_identifier 속성을하려고
client.call(:ping, soap_header: { "head:HTNGHeader": { "head:From": { "head:Credential": { "head:userName": "******", "head:password":"*****" }}}}, message: {"ns:EchoData": "TestData"})
:
client = Savon.client(wsdl: "https://integcert.synxis.com/interface/Contracts/ChannelConnect2004.wsdl", log_level: :debug, log: true, pretty_print_xml: true, env_namespace: :soapenv, namespaces: {"xmlns:soapenv": "http://schemas.xmlsoap.org/soap/envelope/", "xmlns:head": "http://htng.org/1.1/Header/","xmlns:ns": "http://www.opentravel.org/OTA/2003/05"}, convert_request_keys_to: :none, namespace_identifier: "ns", element_form_default: :qualified)
그리고 오전는 요청을 수행 할 때 이 비누 rq 몸을 가지고있어 :
<soapenv:Body>
<ins0:OTA_PingRQ>
<ns:EchoData>TestData</ns:EchoData>
</ins0:OTA_PingRQ>
</soapenv:Body>
이 ins0 에서왔다?
또한 나는 namespace_identifier: nil
매개 변수를 사용하여 클라이언트를 정의하기 위해 노력하고 이러한 종류의 요청했을 때 :이 비누 RQ 본체를 가지고
client.call(:ping, soap_header: { "head:HTNGHeader": { "head:From": { "head:Credential": { "head:userName": "******", "head:password":"*****" }}}}, message: {"ns:OTA_PingRQ": {"ns:EchoData": "TestData"}})
:
<soapenv:Body>
<OTA_PingRQ>
<ns:OTA_PingRQ>
<ns:EchoData>TestData</ns:EchoData>
</ns:OTA_PingRQ>
</OTA_PingRQ>
그리고를 올바른 몸을 가지고 싶습니다 :
<soapenv:Body>
<ns:OTA_PingRQ>
<ns:EchoData>TestData</ns:EchoData>
</ns:OTA_PingRQ>
</soapenv:Body>
추가로 중첩 된 OTA_PingRQ
노드를 제거하거나 ins0
네임 스페이스를 사용자 정의로 바꾸는 방법에 대한 아이디어가 있으십니까?
SOAP : envelop을 포함한 완전한 XML을 게시하십시오. 네임 스페이스 접두사 ins0은 SOAP 봉투에서 선언되어 있어야합니다. ins0, ns가 모두 "http://www.opentravel.org/OTA/2003/05"로 정의되어 있으면 요청이 유효합니다. SOAP UI를 사용하여 생성 된 SOAP 요청의 유효성을 검사하고 테스트하는 것이 좋습니다. – sashwat