Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8232645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:54:07+00:00 2026-06-07T17:54:07+00:00

I understand how to add a header to the SOAP request. But that generates

  • 0

I understand how to add a header to the SOAP request. But that generates a header that doesn’t match the one I need to pass. That returns this header:

   <SOAP-ENV:Header>
      <wsse:Security mustUnderstand="true">
         <wsse:UsernameToken>
            <wsse:Username>CABLE</wsse:Username>
            <wsse:Password>CABLE</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </SOAP-ENV:Header>

However, I need to modify the namespace of that header to pass the particular namespace for the Security object and the UsernameToken object. I can’t seem to figure out how to override the default values supplied.

<soapenv:Header>
 <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">
       http://schemas.xmlsoap.org/ws/2002/07/secext
 <wsse:UsernameToken xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
 <wsse:Username>CABLE</wsse:Username>
 <wsse:Password Type="wsse:PasswordText">CABLE</wsse:Password>
 </wsse:UsernameToken>
 </wsse:Security>
</soapenv:Header>

Here is the Python Code to generate the above

security = Security()
token = UsernameToken('CABLE', 'CABLE')
security.tokens.append(token)
client.set_options(wsse=security)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:54:11+00:00Added an answer on June 7, 2026 at 5:54 pm

    Figured it out. Here is the answer. Just need to use the ns argument

    def createWSSecurityHeader(username,password):
        # Namespaces
        wsse = ('wsse', 'http://schemas.xmlsoap.org/ws/2002/07/secext')
    
        # Create Security Element
        security = Element('Security', ns=wsse)
    
        # Create UsernameToken, Username/Pass Element
        usernametoken = Element('UsernameToken', ns=wsse)
        uname = Element('Username', ns=wsse).setText(username)
        passwd = Element('Password', ns=wsse).setText(password)
    
        # Add Username and Password elements to UsernameToken element
        usernametoken.insert(uname)
        usernametoken.insert(passwd)
    
        security.insert(usernametoken)
        return security
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create SOAP request like this: <soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/ xmlns:stor=http://storage.xdoc.xx/> <soapenv:Header/> <soapenv:Body> <stor:createDocument>
I found this link: http://support.microsoft.com/kb/222829 But I can't understand that much. Ok, I understood
I understand that I cannot add preconditions on an interface implementation. I have to
I understand that according to the HTML specification, it's invalid to add custom attributes
I'm trying to add basic authorization to my request header. The code below compiles
1) I understand I can call this $memcache_obj = memcache_connect('memcache_host', 11211); in the header
This is a two part question in hopes that I can understand more about
I'm trying to understand why this ajax called doesn't work $.ajax({ type: 'GET', url:
I understand how to add a jquery-ui tab, and I understand how to select
while reading docs of backbone i can't understand how to add model to collection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.