# New Bindings in 2.2.0

## Python

To a large extent the new bindings are compatible with the old SWIG bindings; in a few cases they can do things differently but wrappers are in place to avoid client code changes.

- NodeList and StringList objects are obsolete, normal Python tuples (no lists, immutability is a requirement) can be used instead. (NodeList and StringList kept as aliases to Python list object for compatibility)
- StringDict object is obsolete, a normal Python dictionary can be used instead. (StringDict kept as an alias to Python dict object for compatibility)
- In LibAuthnRequest and Samlp2AuthnRequest, nameIDPolicy has been renamed to nameIdPolicy. (old name kept as an alias)
- In Saml2Subject, nameID has been renamed to nameId. (old name kept as an alias)
- In MiscTextNode, text_child has been renamed to textChild. (old name kept as an alias)
- In Identity there is now a federations dictionary member, the providerIds attribute is made to return the keys of that dictionary.
- In Server there is now a providers dictionary member, the providerIds attribute is made to return the keys of that dictionary.
- In Session there is now a assertions dictionary member, the providerIds attribute is made to return the keys of that dictionary.
- In Profile there is now a hasDirtyIdentity() method, a isIdentityDirty property is made to return its result.
- In Profile there is now a hasSessionIdentity() method, a isSessionDirty property is made to return its result.
- Incompatible Change: Provider constructor raises an appropriate exception on error, checking the this member to know if an error occured is no longer necessary and doesn't work, you can use the following code to emulate the new behaviour in the old bindings:

          if not hasattr(lasso, 'cptrToPy'):
              print 'old swig bindings, setting new lasso.Provider'
              lasso.OrigProvider = lasso.Provider
              # old (SWIG) bindings
              class Provider(lasso.OrigProvider):
                  def __init__(self, *args):
                      lasso.OrigProvider.__init__(self, *args)
                      if self.this is None:
                          raise lasso.Error('Error creating Provider')
              lasso.Provider = Provider

## Java

- NodeList and StringList are obsolete use normal java List class (ArrayList, LinkedList).
- getFederations in Identity, getProviders in Server and getAssertions in Session returns HashMap. You can modify them and commit your changes using the associated setXXX method.
- all lasso constants are in the class LassoConstants.
- all lasso error codes are converted to java exceptions with a derived name, look at the Javadoc --- the default Makefile does not generate documentation on exception Throwing, modify BINDING_OPTIONS in bindings/java/Makefile. There are abstract exception classes for catching family of exceptions.
- shared library name changed, now it's libjnilasso.so (should not bother you since the java class load it for you)

## PHP

To a large extent the new PHP5 bindings are compatible with the old PHP4 SWIG bindings; in a few cases they can do things differently but wrappers are in place to avoid client code changes.

- Programs must now add this line before calling lasso functions : `include("lasso.php");` with the file "lasso.php" being in your PHP path
- Exceptions are raised for functions which in PHP4 returned negative integers
- NodeList, StringList and StringDict objects are obsolete, normal PHP5 arrays can be used instead.
- In LibAuthnRequest and Samlp2AuthnRequest, nameIDPolicy has been renamed to nameIdPolicy.
- In SamlSubject and Saml2Subject, nameID has been renamed to nameId
- In MiscTextNode, text_child has been renamed to textChild.
- In Identity there is now a federations dictionary member, instead of the providerIds attribute
- In Server there is now a providers dictionary member, instead of the providerIds attribute
- In Session there is now a assertions dictionary member, instead of the providerIds attribute
- In Profile there is now a hasDirtyIdentity() method, instead of the isIdentityDirty attribute
- In Profile there is now a hasSessionIdentity() method, instead of the isIdentityDirty attribute