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

  • Home
  • SEARCH
  • 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 5995437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:57:35+00:00 2026-05-22T23:57:35+00:00

I am starting out with python and trying to construct an XML request for

  • 0

I am starting out with python and trying to construct an XML request for an ebay web service:

Now, my question is:

Say, this is my function:

def findBestMatchItemDetailsAcrossStores():
     request = """<?xml version="1.0" encoding="utf-8"?>
     <findBestMatchItemDetailsAcrossStoresRequest xmlns="http://www.ebay.com/marketplace/search/v1/services">
     <siteResultsPerPage>50</siteResultsPerPage>
     <entriesPerPage>50</entriesPerPage>
     <ignoreFeatured>true</ignoreFeatured>
     <keywords>ipod</keywords> <-----REQUIRED
     <itemFilter>
     <paramName>PriceMin</paramName>
     <paramValue>50</paramValue>
     <name>Currency</name>
     <value>USD</value>
     </itemFilter>
     <itemFilter>
     <paramName>PriceMax</paramName>
     <paramValue>100</paramValue>
     </itemFilter>
     </findBestMatchItemDetailsAcrossStoresRequest>"""
     return get_response(findBestMatchItemDetailsAcrossStores.__name__, request)

Where, keyword is the only required field. So, how should I construct the method? The ways can be:

  1. Create an object, pass it to the func(object) : The java way
  2. Pass all the arguments: func(a=val1, b=val2, c=val3, d=val4 etc)
  3. Use **kwargs and trust the person who calls the function, that he passes the right keys with the values, because I will use the keys to actually construct the XML tags.

Update:

All the xml tags you see in the request are needed to be passed by the user. But keywords should be passed and others maybe passed if required.

Any suggestions?

  • 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-05-22T23:57:36+00:00Added an answer on May 22, 2026 at 11:57 pm

    A good idea is to put all the parameters with appropriate defaults (or just None defaults) in the function signature. Yeah, it will require a little more typing in the function itself, but the interface will be clean, self-documented and simple to use, as you won’t have to look up possible parameters in ebay docs or function source. It will save you time later on.

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

Sidebar

Related Questions

After starting out with Python on Ubuntu Linux, I've now for a good while
I have some old python code that uses the pywin32 extensions. Starting out with
So I am just starting out developing PHP web applications and have finished setting
I'm just starting out writing trying to write a simple program in C and
I was trying out one of the Python standard library modules, let's call it
I'm just starting out learning python (for webapp usage) but I'm confused as to
Just starting out with jQuery and this problem seems to be impossible to me.
I am just starting out in XNA and have a question about rotation. When
I am starting out with PRADO php framework and i have a quick question:
Just starting out in asp.net. Have just created a login.aspx page in my site

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.