September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
53
Task/SOAP/Go/soap-1.go
Normal file
53
Task/SOAP/Go/soap-1.go
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/tiaguinho/gosoap"
|
||||
"log"
|
||||
)
|
||||
|
||||
type CheckVatResponse struct {
|
||||
CountryCode string `xml:"countryCode"`
|
||||
VatNumber string `xml:"vatNumber"`
|
||||
RequestDate string `xml:"requestDate"`
|
||||
Valid string `xml:"valid"`
|
||||
Name string `xml:"name"`
|
||||
Address string `xml:"address"`
|
||||
}
|
||||
|
||||
var (
|
||||
rv CheckVatResponse
|
||||
)
|
||||
|
||||
func check(err error) {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
// create SOAP client
|
||||
soap, err := gosoap.SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl")
|
||||
|
||||
// map parameter names to values
|
||||
params := gosoap.Params{
|
||||
"vatNumber": "6388047V",
|
||||
"countryCode": "IE",
|
||||
}
|
||||
|
||||
// call 'checkVat' function
|
||||
err = soap.Call("checkVat", params)
|
||||
check(err)
|
||||
|
||||
// unmarshal response to 'rv'
|
||||
err = soap.Unmarshal(&rv)
|
||||
check(err)
|
||||
|
||||
// print response
|
||||
fmt.Println("Country Code : ", rv.CountryCode)
|
||||
fmt.Println("Vat Number : ", rv.VatNumber)
|
||||
fmt.Println("Request Date : ", rv.RequestDate)
|
||||
fmt.Println("Valid : ", rv.Valid)
|
||||
fmt.Println("Name : ", rv.Name)
|
||||
fmt.Println("Address : ", rv.Address)
|
||||
}
|
||||
7
Task/SOAP/Go/soap-2.go
Normal file
7
Task/SOAP/Go/soap-2.go
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import soap
|
||||
|
||||
procedure main(A)
|
||||
soap := SoapClient(A[1] | "http://example.com/soap/wsdl") # Allow override of default
|
||||
write("soapFunc: ",soap.call("soapFunc"))
|
||||
write("anotherSoapFunc: ",soap.call("anotherSoapFunc"))
|
||||
end
|
||||
20
Task/SOAP/Go/soap-3.go
Normal file
20
Task/SOAP/Go/soap-3.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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
|
||||
14
Task/SOAP/Perl-6/soap.pl6
Normal file
14
Task/SOAP/Perl-6/soap.pl6
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env perl6
|
||||
|
||||
# Reference:
|
||||
# https://github.com/retupmoca/P6-SOAP
|
||||
# http://wiki.dreamfactory.com/DreamFactory/Tutorials/Temp_Conversion_SOAP_API
|
||||
|
||||
use v6;
|
||||
use SOAP::Client;
|
||||
|
||||
my $request = SOAP::Client.new('http://www.w3schools.com/xml/tempconvert.asmx?WSDL') or die;
|
||||
|
||||
say $request.call('CelsiusToFahrenheit', Celsius => 100 ) or die;
|
||||
|
||||
say $request.call('FahrenheitToCelsius', Fahrenheit => 212 ) or die;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
LOCAL oSoapClient AS OLEAUTOOBJECT
|
||||
LOCAL oSoapClient AS OBJECT //OLEAUTOOBJECT
|
||||
LOCAL cUrl AS STRING
|
||||
LOCAL uResult AS USUAL
|
||||
oSoapClient := OLEAutoObject{"MSSOAP.SoapClient30"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue