HttpAuthenticated for WSDL open
by Ryan Schroeder
Hello,
I have a server that requires basic HTTP authentication to download the WSDL
file. I tried setting the transport to HTTPAuthenticated, but it looks like
the Client doesn't apply the options.transport when opening the url.
Here's the snippet I'm referring to from client.py:
def __init__(self, url, **kwargs):
"""
@param url: The URL for the WSDL.
@type url: str
@param kwargs: keyword arguments.
@see: L{Options}
"""
options = Options()
options.transport = HttpAuthenticated()
self.options = options
options.cache = FileCache(days=1)
self.set_options(**kwargs)
self.wsdl = Definitions(url, options) <--------------
shouldn't this be self.options?
I tried making this change, but also ran into the fact that the
HttpAuthenticated class does not override the open method using a provided
username and password. The basic HttpTransport open method is called
instead.
Regards,
Ryan
14 years, 4 months
preserving space?
by Brodie Thiesfield
Hi all,
New to suds and I'm seeing some strange behaviour with whitespace only contents.
I have an element being returned from the soap server that consists of
just a single space.
<text> </text>
The WSDL defines this as:
<element name="text" type="xsd:string" minOccurs="0"
maxOccurs="1" nillable="true"/>
In the debug log I can see that the space has been returned by the
server, although I don't understand any of the rest of the log (is
there a way to log only the messages?)
When accessing this element though, it has the value of None. i.e.
this code appends 'None' to the string:
if part.text == None:
txn += "<None>";
else:
txn += part.text
Surely this is not expected behaviour? Is there some setting that I am
missing to prevent this? Is there a way to make it return the space?
Regards,
Brodie
Note: Using suds 0.3.8 GA on Windows with python 2.6.4
14 years, 4 months
Re: [Fedora-suds-list] fedora-suds-list Digest, Vol 20, Issue 23
by João Kreuzberg
Jeff,
I was able to resolve it within the WS backend, but thanks for the quick
response.
Keep up the excellent work.
Regards,
João
On Thu, Dec 17, 2009 at 3:00 PM, <fedora-suds-list-request(a)redhat.com>wrote:
> Send fedora-suds-list mailing list submissions to
> fedora-suds-list(a)redhat.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://www.redhat.com/mailman/listinfo/fedora-suds-list
> or, via email, send a message with subject or body 'help' to
> fedora-suds-list-request(a)redhat.com
>
> You can reach the person managing the list at
> fedora-suds-list-owner(a)redhat.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fedora-suds-list digest..."
>
>
> Today's Topics:
>
> 1. Re: [NAMESPACE] (Jeff Ortel)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 17 Dec 2009 09:52:01 -0600
> From: Jeff Ortel <jortel(a)redhat.com>
> Subject: Re: [Fedora-suds-list] [NAMESPACE]
> To: Jo?o Kreuzberg <ivanirjoao(a)gmail.com>
> Cc: fedora-suds-list(a)redhat.com
> Message-ID: <4B2A53A1.80100(a)redhat.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hey João,
>
> Can you give me a link (or attach) the wsdl?
>
> Regards,
>
> Jeff
>
> On 12/16/2009 11:51 PM, João Kreuzberg wrote:
> > Hey guys,
> >
> > First of all, congrats for Suds, it's a fantastic tool!
>
> Thanks :)
>
> >
> > I'm having a minor problem with the generated soap envelope for my
> request:
> >
> > <SOAP-ENV:Envelope xmlns:ns0="LDN"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
> > <SOAP-ENV:Header/>
> > <SOAP-ENV:Body>
> > <ns0:AccountSearch>
> > <AccountSearchQuery xmlns="LDN" xsi:type="AccountSearchQuery">
> > <IdLoginAccount>100</IdLoginAccount>
> > <AccessLevel>50</AccessLevel>
> > <IdParentAccount>0</IdParentAccount>
> > <ParentAccessLevel>0</ParentAccessLevel>
> > <Status>1</Status>
> > <PageNumber>1</PageNumber>
> > <PageSize>10</PageSize>
> > </AccountSearchQuery>
> > </ns0:AccountSearch>
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > But the following line crashes:
> >
> > <AccountSearchQuery xmlns="LDN" xsi:type="AccountSearchQuery">
> >
> > If I take xmlns="LDN" out, it works just fine.
> >
> > Is there a way for me to not include the prefix for the content document
> > on my envelope?
> >
> > I know under client.options I'm able to configure the prefixes to False
> > but that removes all the namespaces.
> >
> > I'm accessing .NET web services and it can't parse the envelope if it
> > contains the xmlns="LDN".
> >
> > Thanks much,
> >
> > --
> > Ivanir João Kreuzberg
> >
> >
> >
> > _______________________________________________
> > fedora-suds-list mailing list
> > fedora-suds-list(a)redhat.com
> > https://www.redhat.com/mailman/listinfo/fedora-suds-list
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: smime.p7s
> Type: application/pkcs7-signature
> Size: 5126 bytes
> Desc: S/MIME Cryptographic Signature
> Url :
> https://www.redhat.com/archives/fedora-suds-list/attachments/20091217/dc8...
>
> ------------------------------
>
> _______________________________________________
> fedora-suds-list mailing list
> fedora-suds-list(a)redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-suds-list
>
> End of fedora-suds-list Digest, Vol 20, Issue 23
> ************************************************
>
--
Ivanir João Kreuzberg
14 years, 4 months
[NAMESPACE]
by João Kreuzberg
Hey guys,
First of all, congrats for Suds, it's a fantastic tool!
I'm having a minor problem with the generated soap envelope for my request:
<SOAP-ENV:Envelope xmlns:ns0="LDN" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns0:AccountSearch>
<AccountSearchQuery xmlns="LDN" xsi:type="AccountSearchQuery">
<IdLoginAccount>100</IdLoginAccount>
<AccessLevel>50</AccessLevel>
<IdParentAccount>0</IdParentAccount>
<ParentAccessLevel>0</ParentAccessLevel>
<Status>1</Status>
<PageNumber>1</PageNumber>
<PageSize>10</PageSize>
</AccountSearchQuery>
</ns0:AccountSearch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
But the following line crashes:
<AccountSearchQuery xmlns="LDN" xsi:type="AccountSearchQuery">
If I take xmlns="LDN" out, it works just fine.
Is there a way for me to not include the prefix for the content document on
my envelope?
I know under client.options I'm able to configure the prefixes to False but
that removes all the namespaces.
I'm accessing .NET web services and it can't parse the envelope if it
contains the xmlns="LDN".
Thanks much,
--
Ivanir João Kreuzberg
14 years, 4 months
WSSE Expires
by Andrews, Gavin
I am trying to perform a SOAP Client call to a server which mandates WSSE Authentication.
Creating
<wsse:Security mustUnderstand="true">
<wsse:UsernameToken>
<wsse:Username>username</wsse:Username>
<wsse:Password>password</wsse:Password>
<wsu:Created>2009-12-15T19:01:46.229259</wsu:Created>
</wsse:UsernameToken>
Works well, but the server still isn't happy as it requires the wsu:Expires element.
Is there a way to add expires into the UsernameToken?
Thanks in advance,
Gavin
--------------------------------------------------------------------------
NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.
14 years, 4 months
Empty class
by Victor Gimeno
Hello I'm just starting with suds and Python,
I have a Polymorphic WS width just one entry point "response PocessMessage(request)"
So I have many classes for different messages to send to the Server
For example, I have a class "GetUser" with the user name , in response I get a UserObjet with the information for that user.
My problem occur if I have an empty message, something like "GetALLUserList", this message doesn´t have any data
And in response I get an array of user objects.
I'm Attaching a small WSDL showing the problem.
And the code looks like this:
#
# create a service client using the wsdl.
#
url = 'http://127.0.0.1:8082/?wsdl'
client = Client(url, username='admin', password='password', cache=None)
print client
#
# create a GetUserRequest object using the wsdl
#
print 'create GetUserRequest'
GetUserRequest = client.factory.create('ns1:GetUserRequest')
GetUserRequest.username='admin'
result=client.service.ProcessMessage(GetUserRequest )
print result
#
# create a GetAllUsersRequest object using the wsdl
#
GetAllUsersRequest = client.factory.create('ns1:GetAllUsersRequest')
result2=client.service.ProcessMessage(GetAllUsersRequest)
print result2
and error occurred when I try to Invoke the ProccessMessage function with and Empty class
Thanks a lot in advance
Victor Gimeno
14 years, 4 months