2

I'm using zeep to implementation web services, one of WSDLs doesn't work in python but in c# it's ok.

This is the code I am using:

from zeep import Client
wsdl = 'https://sep.shaparak.ir/payments/initpayment.asmx?wsdl'
client = Client(wsdl)

and, my error is:

requests.exceptions.HTTPError: 500 Server Error: Internal Server
Error for url: https://sep.shaparak.ir/payments/initpayment.asmx?wsdl

in c# it works! do you have any idea to help me ?!

1
  • Sounds like zeep is doing something your selver cannot cope with, but a 500 Server Error could be pretty much anything. Do you see anything in the logs on the server? Can you compare the requests sent by C# with the one which fails? As it stands, this question may be too broad. Commented Jun 29, 2017 at 4:14

3 Answers 3

2

With the information you are providing, I am unable to help you solve the Internal Server Error. But, I can help you get more information about what's going on...

http://docs.python-zeep.org/en/master/transport.html#debugging

import logging.config

logging.config.dictConfig({
    'version': 1,
    'formatters': {
        'verbose': {
            'format': '%(name)s: %(message)s'
        }
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'verbose',
        },
    },
    'loggers': {
        'zeep.transports': {
            'level': 'DEBUG',
            'propagate': True,
            'handlers': ['console'],
        },
    }
})
Sign up to request clarification or add additional context in comments.

1 Comment

thanks for your answer... but my codes don't be received to this step... it seems there is problem with wsdl !!!
1

It seems that the problem is with your wsdl as you said, try to use another.
for ex: http://www.soapclient.com/xml/soapresponder.wsdl
and edit your code to be:

client = zeep.Client(wsdl)

Comments

0

I use zeep with magento, here is how I load the wsdl and get a session ID

from zeep import Client
soap = Client(http://my-wsdl)
session = soap.service.login(USER, PASSWORD)

replace http://my-wsdl, USER PASSWORD as applicable

Then, to action a call

list_of_attribute_sets = soap.service.catalogProductAttributeSetList(session)

I hope this helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.