Python Suds Soap客户端错误错误错误请求异常:(400,u'Bad Request')

2024-06-30 05:25:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我的SOAP URL是202.46.201.237:82/MobilityService.svc?wsdl

enter image description here

这是我的代码:

from suds.client import Client
url_service = 'http://202.46.201.237:82/MobilityService.svc?wsdl'
client = Client(url_service,headers={'Content-Type':    'application/soap+xml', 'charset': 'utf-8'})

print client

Suds ( https://fedorahosted.org/suds/ )  version: 0.4 GA  build: R699-20100913

Service ( MobilityService ) tns="http://tempuri.org/"
   Prefixes (3)
      ns0 = "http://schemas.datacontract.org/2004/07/Models"
      ns1 = "http://schemas.microsoft.com/2003/10/Serialization/"
      ns2 = "http://tempuri.org/"
   Ports (1):
      (WSHttpBinding_IMobilityService)
         Methods (1):
           AddNomineeDetails(ns0:WebServiceInputView WebServiceInputView, )
         Types (4):
            ns0:WebServiceInputView
            ns1:char
            ns1:duration
            ns1:guid

result = client.factory.create('ns0:WebServiceInputView') 
result.MessageText = 'test'
result.MobileNo = '1234'
result = client.service.AddNomineeDetails(result)

我收到一个Bad Request Exception: (400, u'Bad Request')错误。我怎么解决这个问题?在


Tags: orgclienthttpurlserviceresultschemassuds