Car*_*585 9 c# python basichttpbinding webservice-client wshttpbinding
我遇到了问题,因为我有一个带有wsHttpBinding的Web服务:
<endpoint address="" binding="wsHttpBinding" contract="BindingTest.IService1" />
Run Code Online (Sandbox Code Playgroud)
我无法让我的python代码调用它,每次我尝试调用时都会收到此错误消息:
Exception: (400, u'Bad Request')
Run Code Online (Sandbox Code Playgroud)
经过多次调查并在互联网上搜索后,我只是在我的Web服务中指定了basicHttpBinding:
<endpoint address="basic" binding="basicHttpBinding" contract="BindingTest.IService1" />
Run Code Online (Sandbox Code Playgroud)
通过这种方式,我可以从python代码调用Web服务!
现在我的问题是另一个:我无法真正修改Web服务,我可以在本地尝试,但我没有权限修改它.
那么,有没有办法在python中指定一个"wsHttpBinding"请求?
这是我的实际代码:
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')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
618 次 |
| 最近记录: |