简体   繁体   中英

Informations about a request for Savon Gem , WSDL and Rails

I solved my problem, but i still can't understand why there was this ** problem.

Little explanation : I have to make a call to SOAP server, with some params.

Here is the definition from the wsdl webservice :

Method : "lanceDecodage"
 Jeton: xsd:string
 ID_JOB: xsd:string
 Priorite: xsd:int

I wanted to do this like this :

@response_second = Savon.client(server).request(:lanceDecodage) do
      soap.body =  {
       :jeton => "ABCDEF"
       :ID_JOB => "123"
       :Priorite => 456
      }
    end

But the server say me i didn't specified the "Priorite" params.

So this ugly request did the trick :

 @response_second = Savon.client(server).request(:lanceDecodage) do
          soap.body =  
            '<Jeton>ABCDEF</Jeton><ID_JOB>' + sound.id_job.to_s + '</ID_JOB><Priorite xsi:type="xsd:int">456</Priorite>'
        end

What was the problem with the 'xsi:type="xsd:int"' ? Did we have to specify the type for Integer? Is there a problem on the WebService?

Thank you for your response.

我没有一个很好的答案,但是显然问题出在卑鄙的SOAP服务中……感谢您的答复

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM