For the programmer, SOAP makes available an easy to use, language and system independent remote procedure call mechanism, as SOAP implementations are available for a wide range of programming languages and operating system configurations.
If you cannot access the internet, here is an extract from that site;
in addition, use the source - Luke, for information on the implementation.
- a Squeak SOAP RPC implementation -
SoapCore is a SOAP part of SoapOpera.
SoapCore provides very simple API for Soap RPC.
Suppose you have a HelloWorldImpl
class which has method named helloWorld
.
To register the helloWorld service:
service := SoapService implementor: (HelloWorldImpl new ) selector: #helloWorld.
service signature: (SoapServiceSignature name: 'helloWorld').
SoapServiceHandler default add: service
Suppose you have registered the helloWorld service in the host named 'someHost'.
To invoke the helloWorld service:
call := (SoapCallEntry tcpHost: 'someHost') newCall.
call transport: #http.
call methodName: 'helloWorld'.
^ call invokeAndReturn.
there is also a shorter call-setup alternative:
call := SoapCall methodName: 'helloWorld' tcpHost: 'someHost'.
^ call invokeAndReturn.
SoapOpera0.5 has achieved some interoperability with other SOAP implementations.
The World will become one. Enjoy!
From SOAP4R Client:
DOWNLOAD: SOAP4R Client Examples
To invoke the helloWorld service:
#!/usr/bin/env ruby
require 'soap/driver'
server = 'http://someHost:8823/'
drv = SOAP::Driver.new( nil, nil, nil, server)
drv.addMethod('helloWorld')
drv.setWireDumpDev( STDERR )
p drv.helloWorld()
Currently, sending data types are very limited. But It works!
There is a guide for Dolphin Spray and SoapOpera Interop (screenshot).
You should read it first. (Thanks Steve Waring!)
DOWNLOAD: Spray-SoapOpera interop Examples
From Spray Client -> SoapOpera Server:
To invoke the reverseString service:
"call 'reverseString' service" request := SplashRPCRequest method: 'reverseString'
ns: #'http://www.mars.dti.ne.jp/~umejava/smalltalk/soapOpera/rpc/'. request parameterAt: #aString put: 'Hello from Dolphin'. response := request responseFrom: 'http://localhost:8823/' soapAction: nil. response return.
From SoapOperaClient -> Spray Server:
There is a Spray interop test server available in the internet.
You can call services from SoapOpera Client.
To invoke the browseClassDefinition service:
| call resp |
call := (SoapCallEntry tcpHost: 'www.dolphinharbor.org' port: 80) newCall.
call targetObjectURI: '/services/soapOperaInterop'.
call methodName: 'browseClassDefinition'.
call addParameter: (SoapVariable name: #className value: 'SoapOperaInterop').
call invokeAndReturn.
The
HelloWorldServer
class implements both a server and a client API, and is probably the
easiest possible demo.
A real world SOAP client application is the
TranslationServiceApplication,
which uses the BabelFish translation service (see www.xmethods.net).
Legally, they are freeware or public domain goodies, as specified in corresponding
goodies copyright notices.
See the licence info files found in the goodies directories and/or the class files',
and/or the classes documentation methods.
Masashi Umezawa (SoapOpera and SoapOrb)
Steve Waring (Spray Dolphin version)
<info@exept.de>