Jump to content

SOAP: Difference between revisions

527 bytes added ,  13 years ago
No edit summary
Line 45:
 
After importing the <tt>soap</tt> package from the [https://tapestry.tucson.az.us/unilib Unicon Code Library] this can be done with:
<lang Uniconunicon>import soap
 
procedure main(A)
Line 51:
write("soapFunc: ",soap.call("soapFunc"))
write("anotherSoapFunc: ",soap.call("anotherSoapFunc"))
end</lang>
 
A matching SOAP server can be implemented as:
 
<lang unicon>import soap
 
procedure main()
server := SoapServer("http://example.com/soap/wsdl")
server.addService("soapFunc", soapFunc)
server.addService("anotherSoapFunc", anotherSoapFunc)
msg := server.handleRequest()
write(msg)
exit(0)
end
 
procedure soapFunc(A[])
every (s := " ") ||:= (!A || " ")
return "Hello" || s[1:-1]
end
 
procedure anotherSoapFunc(A[])
every (s := " ") ||:= (!A || " ")
return "Goodbye" || s[1:-1]
end</lang>
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.