From 5462c561700bd3f95ab2af697db33acbaf70af8c Mon Sep 17 00:00:00 2001 From: Pavel Shramov Date: Wed, 10 Dec 2008 08:03:17 +0000 Subject: [PATCH] Add support for WS-Addressing WSDL Binding Search for Action attributes not only in WSA*.ADDRESS namespaces but also in WSAW*. wsaw is used by Globus Toolkit 4.2+ See http://www.w3.org/TR/ws-addr-wsdl/ for wsaw definition. --- Namespaces.py | 9 +++++++++ WSDLTools.py | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Namespaces.py b/Namespaces.py index 8875a76..9ed6cbd 100755 --- a/Namespaces.py +++ b/Namespaces.py @@ -183,6 +183,15 @@ class WSA200303: WSA = WSA200408 WSA_LIST = (WSA200508, WSA200408, WSA200403, WSA200303) +class _WSAW(str): + """ Define ADDRESS attribute to be compatible with WSA* layout """ + ADDRESS = "" + +WSAW200605 = _WSAW("http://www.w3.org/2006/05/addressing/wsdl") +WSAW200605.ADDRESS = WSAW200605 # Compatibility hack + +WSAW_LIST = (WSAW200605,) + class WSP: POLICY = "http://schemas.xmlsoap.org/ws/2002/12/policy" diff --git a/WSDLTools.py b/WSDLTools.py index bbfae83..3dd651a 100755 --- a/WSDLTools.py +++ b/WSDLTools.py @@ -11,7 +11,7 @@ ident = "$Id$" import weakref from cStringIO import StringIO -from Namespaces import OASIS, XMLNS, WSA, WSA_LIST, WSRF_V1_2, WSRF +from Namespaces import OASIS, XMLNS, WSA, WSA_LIST, WSAW_LIST, WSRF_V1_2, WSRF from Utility import Collection, CollectionNS, DOM, ElementProxy, basejoin from XMLSchema import XMLSchema, SchemaReader, WSDLToolsAdapter @@ -596,7 +596,7 @@ class PortType(Element): docs = GetDocumentation(item) msgref = DOM.getAttr(item, 'message') message = ParseQName(msgref, item) - for WSA in WSA_LIST: + for WSA in WSA_LIST + WSAW_LIST: action = DOM.getAttr(item, 'Action', WSA.ADDRESS, None) if action: break operation.setInput(message, name, docs, action) @@ -607,7 +607,7 @@ class PortType(Element): docs = GetDocumentation(item) msgref = DOM.getAttr(item, 'message') message = ParseQName(msgref, item) - for WSA in WSA_LIST: + for WSA in WSA_LIST + WSAW_LIST: action = DOM.getAttr(item, 'Action', WSA.ADDRESS, None) if action: break operation.setOutput(message, name, docs, action) @@ -617,7 +617,7 @@ class PortType(Element): docs = GetDocumentation(item) msgref = DOM.getAttr(item, 'message') message = ParseQName(msgref, item) - for WSA in WSA_LIST: + for WSA in WSA_LIST + WSAW_LIST: action = DOM.getAttr(item, 'Action', WSA.ADDRESS, None) if action: break operation.addFault(message, name, docs, action)