cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Calling SAP Web Services does not work

Former Member
0 Likes
2,821

Hi,

using this little program, I try to get a simple "Hello World" from a webservice in SAP.

-


require 'soap/rpc/driver'

s = SOAP::RPC::Driver.new('http://server:port/sap/bc/srt/rfc/sap/Z_WS_RUBY/', 'urn:sap-com:document:sap:soap:functions:mc-style')

s.add_method("Z_WS_RUBY", "StringIn" )

p s.Z_WS_RUBY("World")

-


Unfortunately there is an error:

in `parse_local': unknown namespace qualifier: xml (XSD::NS::FormatError)

from D:/rubyy/InstantRails/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:532:in `decode_attrs' ETC

In the WebService Recorder I find that the call is going through with request:

-


<?xml version="1.0" encoding="utf-8" ?>

- <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

- <env:Body>

- <n1:Z_WS_RUBY xmlns:n1="urn:sap-com:document:sap:soap:functions:mc-style" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<StringIn xsi:type="xsd:string">World</StringIn>

</n1:Z_WS_RUBY>

</env:Body>

</env:Envelope>

-


but response ist like:

-


- <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">

- <soap-env:Body>

- <soap-env:Fault>

<faultcode>soap-env:Client</faultcode>

<faultstring xml:lang="en">Operation not supported</faultstring>

</soap-env:Fault>

</soap-env:Body>

</soap-env:Envelope>

-


What am I mssing here ?

Any help is appreciated.

Regards

Marcus

Message was edited by:

Marcus Schiffer

View Entire Topic
marcus_schiffer
Active Participant
0 Likes

Thanks for the hint !

I will try it out immediately.

However, where ist the problem with the above code ? SOA is about using easy standards, so I would expect SAP to work with standard Web Service coding in Ruby.

Help is still appreciated.

Regards

Marcus

Former Member
0 Likes

I think that is the utopia of WS*, but the reality is somewhat different.

Cheers.