Answer the question
In order to leave comments, you need to log in
Why is Savon generating invalid xml?
Hello.
The situation is this. There is a service with which it is necessary to communicate on the SOAP protocol.
PHP script works correctly. When I send a request from ruby, it is not accepted by the server.
Made a dump of both xml that are sent.
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ServiceName" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:soap_function>
<params xsi:type="ns1:RequestType">
... список параметров
</params>
</ns1:soap_function>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:typens="urn:ServiceName" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<typens:soap_function>
... список параметров
</typens:soap_function>
</env:Body>
</env:Envelope>
client.call(:soap_function, message: params)
client.call(:soap_function, message: {params: params})
client = Savon.client(
wsdl: WSDL,
ssl_verify_mode: :none,
pretty_print_xml: true,
log_level: :debug,
raise_errors: true,
logger: Rails.logger,
log: true)
Answer the question
In order to leave comments, you need to log in
Savon is a very good SOAP gem. I think your best bet is to create an issue in the savon repository. It will explain if it's a feature or a bug.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question