Can .NET web services with wsHttpBinding be consumed by python
Asked Answered
T

0

11

I got a problem because I have a web service with wsHttpBinding:

<endpoint address="" binding="wsHttpBinding" contract="BindingTest.IService1" />

I can't get my python code call it, every time that I try to call I receive this error message:

Exception: (400, u'Bad Request')

After investigate a lot and searching in internet I made it work just specifying to my Web Service to have basicHttpBinding:

<endpoint address="basic" binding="basicHttpBinding" contract="BindingTest.IService1" />

In this way I could call the web service from python code!

Now my problem is another: I can't really modify the web service, I could try locally but I don't have the permission to modify it.

So, is there some way to specify in python to make a "wsHttpBinding" request?

This is my actual code:

import logging
from suds.client import Client
import sys
from suds.sax.element import Element

handler = logging.StreamHandler(sys.stderr)
logger = logging.getLogger('suds.transport.http')
logger.setLevel(logging.DEBUG), handler.setLevel(logging.DEBUG)
logger.addHandler(handler)

client =Client('Service_URL')
client.set_options(headers={'Content-Type': 'application/soap+xml; charset=utf-8'})
result = client.service.RouteDocument('Input')
Taxable answered 24/11, 2016 at 16:17 Comment(4)
same problem!! got any solution?Windstorm
Nop, just change the API type to Rest API and I had no problemsTaxable
Moving to REST API is recommended anyway since WCF will not be supported in future releases of .NET.Souvaine
Hi @Souvaine I know, but I have some service that are still in .Net and are the only one I couldn't automatizeTaxable

© 2022 - 2024 — McMap. All rights reserved.