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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:29:11+00:00 2026-05-26T01:29:11+00:00

I am executing a method of a SOAP web service which receives 3 string

  • 0

I am executing a method of a SOAP web service which receives 3 string arguments with suds library.

The first string argument should be an XML and the other 2 an username and password, this is my semi-working implementation.

from suds.client import Client
url = "http://www.jonima.com.mx:3014/sefacturapac/TimbradoService?wsdl"
client = Client(url)
client.service.timbrado(XML_AS_STRING_HERE, 'PRUEBA1', '12345678')

When the first parameter contains an escaped character (ampersand, quotes, apostrophe, less than, bigger than) method does not work because the server interprets the text as if it were unescaped. If doesn’t contain any of those chars the method works great

XML example without ampersand works
http://dl.dropbox.com/u/1990697/no_amp.xml

XML example with ampersand doesn’t work
http://dl.dropbox.com/u/1990697/with_amp.xml

Any idea how can I pass XML with escaped chars?

It doesn’t have to rely on suds but in python.
I am using python 2.6 (How ever it could be with 2.7 if required)

I am also using Django framework, don’t know if that could be useful.


Extra Info:

  • I have no access to modify SOAP server
  • Customer support told me my xml are correct and that they work for
    them, so the error is in my implementation (or somewhere in suds?)
  • 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-26T01:29:11+00:00Added an answer on May 26, 2026 at 1:29 am

    I think the suds library is the culprit here. When you send your escaped xml into suds as a parameter to the client.service.timbrado method it also escapes it. However, it sees that you have escaped the ampersand already like this:

    ...
    descripcion="EJE&MPLO"
    ...
    

    And it does not escape it further (although it should). You should run your escaped xml through xml.sax.saxutils.escape before passing it to client.service.timbrado.

    This should result in xml snippet above looking like this:

    ...
    descripcion="EJE&MPLO"
    ...
    

    When I run your code with the doubly-escaped xml, I receive the following result:

    <?xml version="1.0" ?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
        <S:Body>
            <ns2:timbradoResponse xmlns:ns2="http://sefactura.com">
                <return>
                    <status>401 - Fecha y hora de generación fuera de rango</status>
                </return>
            </ns2:timbradoResponse>
        </S:Body>
    </S:Envelope>
    

    It is an error regarding your data (date and time of generation out of range), not about the format of the xml.

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

Sidebar

Related Questions

I am developing an app which requires interaction with a SOAP web service, to
Groovy adds the execute method to String to make executing shells fairly easy; println
I am posting to a SOAP-based Web Service via PHP SOAP Client and I'm
I have a problem with web service connection. It says, Possible SOAP version mismatch:
Is there a way to get the name of the currently executing method in
The most basic task in an object oriented environment is executing a method on
What is the best method for executing FTP commands from a SQL Server stored
I've created an extension method for SqlCommand that allows some additional work before executing
I have a WCF service with many methods. I would like that after executing
I have written a thread which I've started using the start method but I'm

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.