Successfully invoking a WCF service from Ruby? Anyone?

I am trying to integrate rails application with WCF service. I tried soap4r and Savon without love. As far as I can tell, none of the Ruby libraries support the latest version of SOAP.

The error I was getting was:

Cannot process the message because the content type is' text / xml; charset = UTF-8 'was not the expected type' Applications / soap + XML; encoding = UTF-8 'applications / soap + XML.'; encoding = UTF-8 '.

I managed to beat this error by changing the WCF service binding from wsHttpBinding to basicHttpBinding, but then getting a new error:

A message with an action "cannot be processed at the receiver due to a ContractFilter mismatch in the EndpointDispatcher. This may be due to a contract mismatch (action mismatch between the sender and the recipient) or a binding / security mismatch between the sender and the recipient. Make sure the sender and the recipient have the same contract and the same binding (including security requirements, such as message, transport, no). (SOAP :: FaultError)

Now this error leaves me puzzled because I see no way to configure endpoints in any of the Ruby libraries. Somebody knows?

Has anyone successfully called WCF services from Ruby? 'application / soap + xml; encoding = UTF-8 '.

+3
3

, ... , web.config basicHttpBinding, Savon . soap4r, "".

+3

, , SOAP Ruby... , , , , , , ( , , ).

, , .net, .to_xml, XML Builder .

, , .

, , , !

, , JRuby Axis. , Ruby.

, .. , ...

+1

I ran into the same issue with Savon with my WCF web service. The content error is related to the fact that your service expects SOAP 1.2, but by default Savon sends the request as SOAP 1.1.

The Content-Type value for 1.1 is "text / xml; charset = UTF-8", but if the server is configured to 1.2 (which is wsHttpBinding), the Content-Type should be "application / soap + XML; encoding = UTF-8 ' .

I found this method on the Savon website :

response = client.request :get_user do
  soap.version = 2
end
+1
source

Source: https://habr.com/ru/post/1760658/


All Articles