Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
m29h committed Sep 22, 2023
1 parent d13ab02 commit ea16e0c
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,45 @@ include (
)

main() {
certFile := "cert.pem"
keyFile := "key.pem"
certFile := "cert.pem"
keyFile := "key.pem"

wsseInfo, authErr := soap.NewWSSEAuthInfo(certFile, keyFile)
if authErr != nil {
fmt.Printf("Auth error: %s\n", authErr.Error())
return
}
// setup Client and inject the HeaderBuilder for the wsse header which automatically
// signs each message body and adds a signed Timestamp to limit message validity
soapClient := soap.NewClient("https://soap.example.org/endpoint/service/", wsseInfo.Header())
wsseInfo, authErr := soap.NewWSSEAuthInfo(certFile, keyFile)
if authErr != nil {
fmt.Printf("Auth error: %s\n", authErr.Error())
return
}
// setup Client and inject the HeaderBuilder for the wsse header which automatically
// signs each message body and adds a signed Timestamp to limit message validity
soapClient := soap.NewClient("https://soap.example.org/endpoint/service/", wsseInfo.Header())

// Setup your request structure
// ...
//
// Setup your request structure
// ...
//

// Create the SOAP request
// call.action is the SOAP action (i.e. method name)
// call.requestData is the structure mapping to the SOAP request
// call.responseData is an output structure mapping to the SOAP response

// Make the request by invoking the SOAPdoer interface of the client
// in a real-world example the SOAPdoer interface would get passed into a service type that would implement
// the SOAP service methods
// in a real-world example the SOAPdoer interface would get passed into a service type that would implement
// the SOAP service methods

err := soapClient.Do(context.Background(), call.action, call.requestData, call.responseData)

if err != nil {
fmt.Printf("Unable to validate: %s\n", err.Error())
return
}
// Now we can handle the response itself.
// Do our custom processing
// ...
//
fmt.Printf("Done!\n")
fmt.Printf("Unable to validate: %s\n", err.Error())
return
}
// Now we can handle the response itself.
// Do our custom processing
// ...
//
fmt.Printf("Done!\n")
}
```

Expand Down

0 comments on commit ea16e0c

Please sign in to comment.