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 7925819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:28:11+00:00 2026-06-03T18:28:11+00:00

I’m having trouble with suds . I’m trying to make a generic system to

  • 0

I’m having trouble with suds.

I’m trying to make a generic system to make calls to an API, some parameters are defined as classes with multiple attributes. Initially all these attributes are empty, and I’m trying to pass a dictionary to fill some of the attributes automatically

For example:

from suds.client import Client

client = Client("...")
method = "getCampaignsByCriteria"
arg_repr = {"ids": [123]}
arg = client.factory.create("CampaignSearchCriteria")
for k, v in arg_repr.iteritems():
    setattr(arg, k, v)
service = client.service
args_map = {"searchCriteria": arg}
getattr(service, method)(**args_map)

Generates the following, with all default fields from CampaignSearchCriteria still there, and ids set correctly:

<SOAP-ENV:Body>
  <ns1:getCampaignsByCriteria>
     <searchCriteria xsi:type="ns1:CampaignSearchCriteria">
        <ids xsi:type="ns1:ArrayOf_xsd_long">123</ids>
        <searchString xsi:type="ns0:string"/>
        <pageNumber xsi:type="ns2:int"/>
        <pageSize xsi:type="ns2:int"/>
        <advertiserIds xsi:type="ns1:ArrayOf_xsd_long"/>
        <archiveFilter xsi:type="ns1:ActiveFilter">
           <activeOnly xsi:type="ns2:boolean"/>
           <inactiveOnly xsi:type="ns2:boolean"/>
        </archiveFilter>
        <sortOrder xsi:type="ns1:SortOrder">
           <descending xsi:type="ns2:boolean"/>
           <fieldName xsi:type="ns0:string"/>
        </sortOrder>
     </searchCriteria>
  </ns1:getCampaignsByCriteria>
</SOAP-ENV:Body>

However, since I’m only setting the ids field, I’d like the SOAP body to just take into account the non-empty field(s) to look like this:

<SOAP-ENV:Body>
  <ns1:getCampaignsByCriteria>
     <searchCriteria xsi:type="ns1:CampaignSearchCriteria">
        <ids xsi:type="ns1:ArrayOf_xsd_long">123</ids>
     </searchCriteria>
  </ns1:getCampaignsByCriteria>
</SOAP-ENV:Body>

I couldn’t find how you can choose which field to include when you’re using a custom argument to your method. Any thoughts?

  • 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-03T18:28:12+00:00Added an answer on June 3, 2026 at 6:28 pm

    how your SOAP request looks depends on your WSDL, specifically on the data type definitions which specify the schema for your message.
    so you can’t just omit some fields or the message won’t be a valid request anymore if the schema doesn’t allow it.

    if i’m correct then this should be the wsdl we’re talking about, for all attributes minOccurs isn’t present, which means it defaults to 1 and you can’t omit the elements, althoug they are nillable.

    my general advise: don’t think too much about how a SOAP request looks. SOAP is xml and therefore kind-of human readable, but it’s not really designed to be interpreted by humans.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.