Giter VIP home page Giter VIP logo

wsdl2apex-plus's Introduction

wsdl2apex-plus

An enhanced version of the Salesforce WSDL2Apex tool that generates Apex class files from WSDL and schemas files.

At my company, from Salesforce, we needed to call internally created web services to talk to our backend systems. [Salesforce's WSDL2Apex] (https://github.com/forcedotcom/WSDL2Apex) tool would NOT generate the Apex code at all without extensive editing/combining of the WSDL and schema files into one document, and even then it was hit or miss as to whether it would even work.

We were able to use the FuseIT tool, and it would consistently generate the Apex code without requiring the WSDL and schema files to be changed, but even it wasn't perfect, and we still needed to make a lot of changes to the generated code to make it do what we wanted it to do.

This is my attempt at a version of WSDL2Apex that is a bit more full-featured. My goal was to add all of the functionality that we needed at my company so that there was ZERO editing required of either the WSDL/schema files or generated code.

Here are some additional features that I added:

  • Handles imported WSDL and schema files.
  • Optionally builds WS-Security header for UsernameToken and Timestamp with expiry elements -- requires the included Apex class file "WS_Security.cls", and a Custom Metadata Type for the username and password.
  • Optionally has the ability to specify differing end-points by environment (e.g. TEST, ACCEPTANCE, PRODUCTION) using Custom Metadata Types.
  • Optionally accepts the name of a client certificate.
  • Optionally allows for a timeout value to be set.
  • Generates code that validates against ALL schema simple type restrictions (e.g. minimum length, maximum length, fixed length, pattern matching, and enumerated values), and throws an exception when an attempt is made to set an invalid value into a field.
  • Generates code to make sure that all required elements are populated in a complex type before the web service is executed, and throws an exception, if they are missing.

NOTE/CAVEAT: This implementation was created specifically for a project at my company. We have a standard design for our WSDL and schema files making them relatively consistent. The generated code works well on files that follow our standard. I can't guarantee that it's generic enough to handle ALL of the possible schema and WSDL combinations. So, it's provided as-is.

wsdl2apex-plus's People

Contributors

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