Hey all. I know this isn't a .NET support group, but I was hoping someone could help me with I'm probably I'm having trying to get suds to work with a .NET SOAP service. I'm using version in tags/release-0.2 since the trunk version can't even parse my WSDL.
When sending the POST via suds, here is what my SOAP XML looks like:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.perseus.com/Pdc.WS" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Body tns:Login <userName>myUsername</userName> <password>myPassword</password> </tns:Login> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
which gives me a useless .NET error which is the equivelant of a generic 500 server error:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
I was able to get the error to go away by simple dropping the tns namespace from the Login node and adding xmlns attribute instead:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.perseus.com/Pdc.WS" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Body <Login xmlns="http://www.perseus.com/Pdc.WS"> <userName>myUsername</userName> <password>myPassword</password> </Login> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
As I'm fairly namespace-challenged, any ideas why this may be happening? Thanks in advance for any assistance.
I'd be happy to send the WSDL via e-mail to whoever may want to take a look.
-Rob (Fairbanks)
Rob Yates wrote:
As I'm fairly namespace-challenged, any ideas why this may be happening? Thanks in advance for any assistance. I'd be happy to send the WSDL via e-mail to whoever may want to take a look.
I'm having the same problem as you :) and I believe this is the issue:
https://fedorahosted.org/suds/ticket/7
Jeff Ortel mentioned in an email to the list yesterday [1] that he has fixed the issue in his development code and that it will be put in trunk after some testing. The relevant snippet of that email:
------ * (fix) Proper level of XML element qualification based on <schema elementFormDefault=""/> attribute. This will ensure that when elementFormDefault="qualified", Suds will include the proper namespace on root elements for both literal and encoded bindings. In order for this to work properly, the literal marshaller (like the encoded marshaller) needed to be schema-type aware. Had i added the same schema-type lookup as the encoded marshaller instead of the refactoring described above, the two classes would have been almost a complete duplicate of each other :-( ------
I was building a fairly complex SOAP request the other day, and was going crazy trying to figure out why I was only getting a 500 error response back no matter what I tried. Jeff's email yesterday was a relief.
I just introduced myself to SOAP a couple days ago, and I must say that I like suds and it's interface much more than the other libraries I tried (SOAPpy and ZSI). FYI, SOAPpy seems to have the same namespace problems (I didn't fully test ZSI).
Keep up the good work guys!
Gary
[1] https://www.redhat.com/archives/fedora-suds-list/2008-May/msg00013.html
Gary - Thanks for the reply, good information. I have had no better luck in ZSI or SOAPpy with this particular web service either.
-Rob
Gary Wilson Jr. wrote:
Rob Yates wrote:
As I'm fairly namespace-challenged, any ideas why this may be happening? Thanks in advance for any assistance. I'd be happy to send the WSDL via e-mail to whoever may want to take a look.
I'm having the same problem as you :) and I believe this is the issue:
https://fedorahosted.org/suds/ticket/7
Jeff Ortel mentioned in an email to the list yesterday [1] that he has fixed the issue in his development code and that it will be put in trunk after some testing. The relevant snippet of that email:
- (fix) Proper level of XML element qualification based on <schema
elementFormDefault=""/> attribute. This will ensure that when elementFormDefault="qualified", Suds will include the proper namespace on root elements for both literal and encoded bindings. In order for this to work properly, the literal marshaller (like the encoded marshaller) needed to be schema-type aware. Had i added the same schema-type lookup as the encoded marshaller instead of the refactoring described above, the two classes would have been almost a complete duplicate of each other :-(
I was building a fairly complex SOAP request the other day, and was going crazy trying to figure out why I was only getting a 500 error response back no matter what I tried. Jeff's email yesterday was a relief.
I just introduced myself to SOAP a couple days ago, and I must say that I like suds and it's interface much more than the other libraries I tried (SOAPpy and ZSI). FYI, SOAPpy seems to have the same namespace problems (I didn't fully test ZSI).
Keep up the good work guys!
Gary
[1] https://www.redhat.com/archives/fedora-suds-list/2008-May/msg00013.html
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
Rob,
Yes, Gary is right.
FYI: By using the xmlns="" notation instead of the prefix you're qualifying the entire fragment as being in the (http://www.perseus.com/Pdc.WS) namespace instead of just the <Login/> node.
I'd have to see the entire wsdl to be sure but this looks like the issue described by ticket #7. Besides all of the cases involving the elementFormDefault involve Microsoft services so it's pretty likely ;-)
I'm concerned about you comment that you had a problem using trunk. I committed code last night 7pm EDT that included the fix for ticket #7 and a LOT of other changes. All my regression tests were clean but, every wsdl is different ... When did you try trunk? Can you send me link/copy of the wsdl so I test against it?
Thanks,
Jeff
Rob Yates wrote:
Gary - Thanks for the reply, good information. I have had no better luck in ZSI or SOAPpy with this particular web service either. -Rob
Gary Wilson Jr. wrote:
Rob Yates wrote:
As I'm fairly namespace-challenged, any ideas why this may be happening? Thanks in advance for any assistance. I'd be happy to send the WSDL via e-mail to whoever may want to take a look.
I'm having the same problem as you :) and I believe this is the issue:
https://fedorahosted.org/suds/ticket/7
Jeff Ortel mentioned in an email to the list yesterday [1] that he has fixed the issue in his development code and that it will be put in trunk after some testing. The relevant snippet of that email:
- (fix) Proper level of XML element qualification based on <schema
elementFormDefault=""/> attribute. This will ensure that when elementFormDefault="qualified", Suds will include the proper namespace on root elements for both literal and encoded bindings. In order for this to work properly, the literal marshaller (like the encoded marshaller) needed to be schema-type aware. Had i added the same schema-type lookup as the encoded marshaller instead of the refactoring described above, the two classes would have been almost a complete duplicate of each other :-(
I was building a fairly complex SOAP request the other day, and was going crazy trying to figure out why I was only getting a 500 error response back no matter what I tried. Jeff's email yesterday was a relief.
I just introduced myself to SOAP a couple days ago, and I must say that I like suds and it's interface much more than the other libraries I tried (SOAPpy and ZSI). FYI, SOAPpy seems to have the same namespace problems (I didn't fully test ZSI).
Keep up the good work guys!
Gary
[1] https://www.redhat.com/archives/fedora-suds-list/2008-May/msg00013.html
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list