Git Product home page Git Product logo

lark's Introduction

Lark: Swift SOAP Client

Lark is a SOAP library written in Swift.

Build Status

Features

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

Communication

  • 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.

Usage

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

.Package(url: "https://github.com/Bouke/Lark.git", 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))
print(result.sayHelloResult)

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
    print(result?.value.sayHelloResult)
}

More information can be found in the documentation.

Example

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.

FAQ

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?

No.

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.

Credits

This library was written by Bouke Haarsma.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.