Swift SOAP Client

What's New

Swift 4.2



  • Swift 4.2

Lark: Swift SOAP Client

Lark is a SOAP library written in Swift.

Build Status


  • Swift 4
  • Swift Package Manager
  • API Client code generation
  • Strictly typed
  • SOAP 1.1
  • SOAP document/literal (wrapped) encoding
  • Both synchronous and asynchronous


  • If you need help, open an issue.
  • If you'd like to ask a general question, open an issue.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.


First, install the package by including the following in Package.swift:

.Package(url: "", majorVersion: 0)

Then, build your package. This will result in an executable named lark-generate-client which can generate the client code:

swift build
.build/debug/lark-generate-client "http://localhost:8000/?wsdl" > Sources/Client.swift

In your code you can now use the generated Client like this:

let client = HelloWorldServiceClient()

To call a remote method, inspect the generated functions on the Client. For example the sayHello method that takes a SayHello parameter and returns a SayHelloResponse:

let result = try client.sayHello(SayHello(name: "World", times: 2))

Or if you're building a GUI that requires non-blocking networking, use the async version:

client.sayHelloAsync(SayHello(name: "World", times: 2)) { result in

More information can be found in the documentation.


See the Lark-Example repository for an example of how to use Lark.

Swift Compatibility

Swift 4 is required with version 1 of this package. Use version 0 if you need Swift 3 compatibility.


Is Linux supported?

Not yet. This library builds on various XMLDocument APIs that are either not available in Swift-Foundation (the Swift port of some Foundation APIs) or behave differently. Also a major dependency, AlamoFire, is not yet supported on iOS. To track the progress on this, subscribe to ticket 22.

Is iOS supported?

No. This library builds on various XMLDocument APIs that are not available on iOS. Switching to another XML library might help here, but I don't have the need for this. Feel free to reach out to me if you're interested in working on a pull request to change this.

Can it act as a SOAP server?

No. Feel free to reach out to me if you're interested in working on a pull request to change this.

Is CocoaPods / Carthage supported?


Why is it called Lark?

SOAP is sometimes referred to as a fat messaging protocol. Swift is an elegant bird. A Lark sometimes looks like a fat bird.


This library was written by Bouke Haarsma.


  • Swift Tools 4.0.0
View More Packages from this Author


Last updated: Sun Mar 12 2023 18:18:38 GMT-0500 (GMT-05:00)