GithubHelp home page GithubHelp logo

troscoe / suds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kwhinnery/suds

0.0 2.0 0.0 3.84 MB

A lightweight SOAP client library for JavaScript (no longer supported by me)

Home Page: http://www.kevinwhinnery.com

License: Other

suds's Introduction

Suds: A JavaScript SOAP Client Library

XML is like violence - if it doesn't solve your problem, you're probably not using enough of it.

Suds is a lightweight SOAP client library for JavaScript. Suds has been tested on the following platforms:

  • Titanium Desktop (0.7.0)
  • Titanium Mobile (0.7.1)

For more information on creating native desktop and mobile apps with HTML, JavaScript, and CSS, check out the Appcelerator home page. Suds should also run in the web browser against SOAP web services, with the usual cross-domain restrictions. Suds has yet to be tested in the browser, however, so your mileage may vary. NOTE: While jQuery 1.3 is used in the example applications, Suds is not dependent upon it and can be used independently.

Usage

var suds = new SudsClient({ 
  endpoint: "http://webservice.webserviceshare.com/currencyconverter/rates.asmx",
  targetNamespace: "http://websevriceshare.com/" 
});

suds.invoke("GetSupportedCurrencies", {}, function(xmlDoc) {
  //Parse XML response (SOAP Envelope)
});

API

The following is the current API documentation for Suds, which consists of a constructor for the client and an invoke method on the client to call specific services on your endpoint. Impressive, no?

SudsClient(options)

Constructor for a Suds SOAP web service client.

  • options - A JavaScript object containing the following properties:
    • endpoint - the SOAP endpoint you will be using
    • targetNamespace - the namespace for your service data structures and prefix for SOAP actions - will be in your service WSDL
    • envelopeBegin (optional) - a string containing the XML preceding the contents of the SOAP request body
    • envelopeEnd (optional) - a string containing the XML following the contents of the SOAP request body
    • authorization (optional) - a string used to specify basic HTTP authorization in the request header

sudsClient.invoke(soapAction, body, callback(xmlDoc))

Invoke a SOAP action on the web service defined by this Suds instance.

  • soapAction - the web service method to invoke
  • body - can be one of:
    • An XML string containing the SOAP request body, constructed manually
    • A JavaScript object containing a hierarchical data structure which can be converted to XML
  • callback - a callback function to process the request result, with the following information
    • [this] - this inside your callback will refer to the XHR object used to make the SOAP web service call
    • xmlDoc - An XML Document Object containing the SOAP response

Examples

Example applications using Suds for Titanium Mobile and Desktop are located in this project as well. Feel free to pull them down and import into Titanium Developer to see these projects in action. They should work out of the box using a publicly available SOAP web service.

suds's People

Contributors

codef0rmerz avatar digiguru avatar kwhinnery avatar tonylukasavage avatar

Watchers

 avatar  avatar

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.