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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:58:09+00:00 2026-05-14T20:58:09+00:00

I have a simple html service, developed in django. You enter your name –

  • 0

I have a simple html service, developed in django.
You enter your name – it posts this, and returns a value (male/female).

I need to ofer this as a web service. I have no idea where to start.

I want to accept a xml request, and provide an xml response – thats it.

Can anyone give ma any pointers – Googling it is difficult when you dont know what your searching for.

  • 1 1 Answer
  • 1 View
  • 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-14T20:58:09+00:00Added an answer on May 14, 2026 at 8:58 pm

    See the Generating non-HTML content in the django book for instructions.

    Basically, it’s as simple as this:

    def get_data(request, xml_data):
        data = parse_xml_data(xml_data)
        return_data = create_xml_blob(data)
        return HttpResponse(return_data, mimetype='application/xml')
    

    Edit:

    You can send a post with xml_data set to the XML string, or you can send an XML request.

    Here’s some code for sending XML data to a web service, adapted from this site:

    xml_data = """<?xml version="1.0" encoding="UTF-8"?>
    <root>my data here</root>
    """
    
    #construct and send the header
    
    webservice = httplib.HTTP("example.com")
    webservice.putrequest("POST", "/rcx-ws/rcx")
    webservice.putheader("Host", "example.com")
    webservice.putheader("User-Agent", "Python post")
    webservice.putheader("Content-type", "text/xml; charset=\"UTF-8\"")
    webservice.putheader("Content-length", "%d" % len(xml_data))
    webservice.endheaders()
    webservice.send(xml_data)
    

    From django, you’d use request.raw_post_data to get at the XML directly.

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

Sidebar

Related Questions

I have simple HTML page with svg like this: <div id=plan> <svg xmlns=http://www.w3.org/2000/svg version=1.1>
I have a simple html form. This form has a specific width and margin
I have a simple html multiline tooltip implementation: this.tooltip = function(tag) { xOffset =
I have created an Ajax enabled WCF web service that contains this simple method:
I have followed this tutorial http://netbeans.org/kb/docs/websvc/gs-axis.html and successfully created the web service. When i
I have a simple html page where I pass two values, a name (
This is real simple. I have a wcf service (nothing fancy, just New Project->
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have a simple HTML Form with one column having a select menu with
I have a simple html login form which is validated with javascript before its

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.