Hello,
It appears that the soap envelope namespace is hardcoded to ' http://schemas.xmlsoap.org/soap/envelope/' in binding.py. I'm trying to talk to a gSOAP based web service that insists the envelope namespace be ' http://www.w3.org/2003/05/soap-envelope'.
Unfortunately, I don't have permission to share the WSDL file.
Any suggestions? --Chris
On Mon, Aug 24, 2009 at 11:55 PM, Chris Frantzfrantzcj@gmail.com wrote:
Hello,
It appears that the soap envelope namespace is hardcoded to 'http://schemas.xmlsoap.org/soap/envelope/' in binding.py. I'm trying to talk to a gSOAP based web service that insists the envelope namespace be 'http://www.w3.org/2003/05/soap-envelope'.
Unfortunately, I don't have permission to share the WSDL file.
Any suggestions?
We have the same issue with our gSOAP service. I'm sure there are other cleaner ways of achieving the same result, but what about simply replacing the envns object before you make any calls to the web service? For example:
suds.bindings.binding.envns = ('SOAP-ENV', 'http://www.w3.org/2003/05/soap-envelope')
-Mike
I got bitten by this again. My program wants to talk to several different SOAP services and a couple of them are very picky about the SOAP-ENV. Worse, they don't use the same SOAP-ENV.
This patch allows suds to pick up the SOAP-ENV from the WSDL, iff it is defined as a namespace prefix in the root of the document.
I'm no XML and/or WSDL expert, so this fix may or may not work for you. It happens to work for me. This patch is based on suds-0.3.7.
--Chris
--- C:/src/suds/suds/bindings/binding.py (revision 5) +++ C:/src/suds/suds/bindings/binding.py (revision 337) @@ -67,6 +67,10 @@ self.options = Options() self.parser = Parser() self.multiref = MultiRef() + self.envns = envns + ns = wsdl.root.nsprefixes.get('SOAP-ENV') + if ns: + self.envns = ('SOAP-ENV', ns)
def unmarshaller(self, typed=True): """ @@ -289,7 +293,7 @@ @return: The soap envelope containing the body and header. @rtype: L{Element} """ - env = Element('Envelope', ns=envns) + env = Element('Envelope', ns=self.envns) env.addPrefix(Namespace.xsins[0], Namespace.xsins[1]) env.append(header) env.append(body) @@ -303,7 +307,7 @@ @return: the soap body fragment. @rtype: L{Element} """ - header = Element('Header', ns=envns) + header = Element('Header', ns=self.envns) header.append(content) return header
@@ -382,7 +386,7 @@ @return: the soap body fragment. @rtype: L{Element} """ - body = Element('Body', ns=envns) + body = Element('Body', ns=self.envns) body.append(content) return body
@@ -503,4 +507,4 @@ return self else: return self.__resolved - \ No newline at end of file +
On Tue, Aug 25, 2009 at 11:44 AM, Michael Sommerville msommerville@gmail.com wrote:
On Mon, Aug 24, 2009 at 11:55 PM, Chris Frantzfrantzcj@gmail.com wrote:
Hello,
It appears that the soap envelope namespace is hardcoded to 'http://schemas.xmlsoap.org/soap/envelope/' in binding.py. I'm trying to talk to a gSOAP based web service that insists the envelope namespace be 'http://www.w3.org/2003/05/soap-envelope'.
Unfortunately, I don't have permission to share the WSDL file.
Any suggestions?
We have the same issue with our gSOAP service. I'm sure there are other cleaner ways of achieving the same result, but what about simply replacing the envns object before you make any calls to the web service? For example:
suds.bindings.binding.envns = ('SOAP-ENV', 'http://www.w3.org/2003/05/soap-envelope')
-Mike
On Thu, Oct 15, 2009 at 5:32 PM, Chris Frantz frantzcj@gmail.com wrote:
I got bitten by this again. My program wants to talk to several different SOAP services and a couple of them are very picky about the SOAP-ENV. Worse, they don't use the same SOAP-ENV.
This patch allows suds to pick up the SOAP-ENV from the WSDL, iff it is defined as a namespace prefix in the root of the document.
I'm no XML and/or WSDL expert, so this fix may or may not work for you. It happens to work for me. This patch is based on suds-0.3.7.
It appears that the soap envelope namespace is hardcoded to 'http://schemas.xmlsoap.org/soap/envelope/' in binding.py. I'm trying to talk to a gSOAP based web service that insists the envelope namespace be 'http://www.w3.org/2003/05/soap-envelope'.
We have the same issue with our gSOAP service. I'm sure there are other cleaner ways of achieving the same result, but what about simply replacing the envns object before you make any calls to the web service? For example:
That looks far cleaner than my monkey-patching doesn't it? That works fine for me too.
Thanks!
-Mike
On 10/16/2009 11:06 AM, Michael Sommerville wrote:
On Thu, Oct 15, 2009 at 5:32 PM, Chris Frantzfrantzcj@gmail.com wrote:
I got bitten by this again. My program wants to talk to several different SOAP services and a couple of them are very picky about the SOAP-ENV. Worse, they don't use the same SOAP-ENV.
This patch allows suds to pick up the SOAP-ENV from the WSDL, iff it is defined as a namespace prefix in the root of the document.
I'm no XML and/or WSDL expert, so this fix may or may not work for you. It happens to work for me. This patch is based on suds-0.3.7.
It appears that the soap envelope namespace is hardcoded to 'http://schemas.xmlsoap.org/soap/envelope/' in binding.py. I'm trying to talk to a gSOAP based web service that insists the envelope namespace be 'http://www.w3.org/2003/05/soap-envelope'.
We have the same issue with our gSOAP service. I'm sure there are other cleaner ways of achieving the same result, but what about simply replacing the envns object before you make any calls to the web service? For example:
That looks far cleaner than my monkey-patching doesn't it? That works fine for me too.
I agree that the current hard coded URI for the soap envelope namespace needs to be addressed. It seems to be a difference between soap 1.1 and soap 1.2.
soap 1.1 defines: http://schemas.xmlsoap.org/soap/envelope/ soap 1.2 defines: http://www.w3.org/2003/05/soap-envelope
Chris: I like your approach (and patch) of determining the soap envelope namespace from the wsdl. But your patch relies on the soap envelope namespace being mapped to a prefix in the WSDL and that it is mapped to the prefix "SOAP-ENV". Neither are reliable. But, as I said, I like the approach and I'm looking through the specs to find a way to determine the soap version by examining the wsdl. Once determined, I can set the proper namespaces in the wsdl.Definitions objects to be used when generating the messages.
Thanks!
-Mike
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list