Python 未找到肥皂水类型错误

Python 未找到肥皂水类型错误,python,wsdl,suds,archer,rsa-archer-grc,Python,Wsdl,Suds,Archer,Rsa Archer Grc,我正在尝试连接到“RSA Archer”Web服务。我针对连接的测试服务器编写了一个小型库。已切换到生产环境suds now错误suds.TypeNotFound:Type not found:“用户名” 不太确定该去哪里找 #output C:\Python\python.exe C:/Users/Alex/PycharmProjects/APIClient/APIClient.py Traceback (most recent call last): File "C:/Users/Ale

我正在尝试连接到“RSA Archer”Web服务。我针对连接的测试服务器编写了一个小型库。已切换到生产环境suds now错误suds.TypeNotFound:Type not found:“用户名”

不太确定该去哪里找

#output
C:\Python\python.exe C:/Users/Alex/PycharmProjects/APIClient/APIClient.py
Traceback (most recent call last):
  File "C:/Users/Alex/PycharmProjects/APIClient/APIClient.py", line 93, in <module>
    main()
  File "C:/Users/Alex/PycharmProjects/APIClient/APIClient.py", line 13, in main
    archerapi.start_session(username,instance,password)
  File "C:/Users/Alex/PycharmProjects/APIClient/APIClient.py", line 51, in start_session
    self.token = self.general_client.service.CreateUserSessionFromInstance(cusfi)
  File "C:\Python\lib\site-packages\suds\client.py", line 559, in __call__
    return client.invoke(args, kwargs)
  File "C:\Python\lib\site-packages\suds\client.py", line 612, in invoke
    soapenv = binding.get_message(self.method, args, kwargs)
  File "C:\Python\lib\site-packages\suds\bindings\binding.py", line 120, in get_message
    content = self.bodycontent(method, args, kwargs)
  File "C:\Python\lib\site-packages\suds\bindings\document.py", line 64, in bodycontent
    p = self.mkparam(method, pd, value)
  File "C:\Python\lib\site-packages\suds\bindings\document.py", line 106, in mkparam
    return Binding.mkparam(self, method, pdef, object)
  File "C:\Python\lib\site-packages\suds\bindings\binding.py", line 289, in mkparam
    return marshaller.process(content)
  File "C:\Python\lib\site-packages\suds\mx\core.py", line 60, in process
    self.append(document, content)
  File "C:\Python\lib\site-packages\suds\mx\core.py", line 73, in append
    self.appender.append(parent, content)
  File "C:\Python\lib\site-packages\suds\mx\appender.py", line 102, in append
    appender.append(parent, content)
  File "C:\Python\lib\site-packages\suds\mx\appender.py", line 243, in append
    Appender.append(self, child, cont)
  File "C:\Python\lib\site-packages\suds\mx\appender.py", line 182, in append
    self.marshaller.append(parent, content)
  File "C:\Python\lib\site-packages\suds\mx\core.py", line 72, in append
    if self.start(content):
  File "C:\Python\lib\site-packages\suds\mx\literal.py", line 87, in start
    raise TypeNotFound(content.tag)
suds.TypeNotFound: Type not found: 'userName'
WSDL


Alex,
我不是Python方面的专家,但我建议您替换该行

self.token = self.general_client.service.CreateUserSessionFromInstance(cusfi)

我在这里找到了这个解决方案: 我希望这对你有用


谢谢你,斯坦。

嗨,斯坦,谢谢你的回答。令牌位工作正常。这是对复杂数据类型的调用。我切换到简单的数据类型,它现在似乎可以工作了。
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://archer-tech.com/webservices/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://archer-tech.com/webservices/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://archer-tech.com/webservices/">
<s:element name="CreateUserSession">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="companyId" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateUserSessionResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CreateUserSessionResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateDomainUserSession">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="companyId" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="usersDomain" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateDomainUserSessionResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CreateDomainUserSessionResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateUserSessionFromInstance">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="instanceName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateUserSessionFromInstanceResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CreateUserSessionFromInstanceResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateDomainUserSessionFromInstance">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="instanceName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="usersDomain" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CreateDomainUserSessionFromInstanceResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CreateDomainUserSessionFromInstanceResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="TerminateSession">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="sessionToken" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="TerminateSessionResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="TerminateSessionResult" type="s:int"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="CreateUserSessionSoapIn">
<wsdl:part name="parameters" element="tns:CreateUserSession"/>
</wsdl:message>
<wsdl:message name="CreateUserSessionSoapOut">
<wsdl:part name="parameters" element="tns:CreateUserSessionResponse"/>
</wsdl:message>
<wsdl:message name="CreateDomainUserSessionSoapIn">
<wsdl:part name="parameters" element="tns:CreateDomainUserSession"/>
</wsdl:message>
<wsdl:message name="CreateDomainUserSessionSoapOut">
<wsdl:part name="parameters" element="tns:CreateDomainUserSessionResponse"/>
</wsdl:message>
<wsdl:message name="CreateUserSessionFromInstanceSoapIn">
<wsdl:part name="parameters" element="tns:CreateUserSessionFromInstance"/>
</wsdl:message>
<wsdl:message name="CreateUserSessionFromInstanceSoapOut">
<wsdl:part name="parameters" element="tns:CreateUserSessionFromInstanceResponse"/>
</wsdl:message>
<wsdl:message name="CreateDomainUserSessionFromInstanceSoapIn">
<wsdl:part name="parameters" element="tns:CreateDomainUserSessionFromInstance"/>
</wsdl:message>
<wsdl:message name="CreateDomainUserSessionFromInstanceSoapOut">
<wsdl:part name="parameters" element="tns:CreateDomainUserSessionFromInstanceResponse"/>
</wsdl:message>
<wsdl:message name="TerminateSessionSoapIn">
<wsdl:part name="parameters" element="tns:TerminateSession"/>
</wsdl:message>
<wsdl:message name="TerminateSessionSoapOut">
<wsdl:part name="parameters" element="tns:TerminateSessionResponse"/>
</wsdl:message>
<wsdl:portType name="generalSoap">
<wsdl:operation name="CreateUserSession">
<wsdl:input message="tns:CreateUserSessionSoapIn"/>
<wsdl:output message="tns:CreateUserSessionSoapOut"/>
</wsdl:operation>
<wsdl:operation name="CreateDomainUserSession">
<wsdl:input message="tns:CreateDomainUserSessionSoapIn"/>
<wsdl:output message="tns:CreateDomainUserSessionSoapOut"/>
</wsdl:operation>
<wsdl:operation name="CreateUserSessionFromInstance">
<wsdl:input message="tns:CreateUserSessionFromInstanceSoapIn"/>
<wsdl:output message="tns:CreateUserSessionFromInstanceSoapOut"/>
</wsdl:operation>
<wsdl:operation name="CreateDomainUserSessionFromInstance">
<wsdl:input message="tns:CreateDomainUserSessionFromInstanceSoapIn"/>
<wsdl:output message="tns:CreateDomainUserSessionFromInstanceSoapOut"/>
</wsdl:operation>
<wsdl:operation name="TerminateSession">
<wsdl:input message="tns:TerminateSessionSoapIn"/>
<wsdl:output message="tns:TerminateSessionSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="generalSoap" type="tns:generalSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CreateUserSession">
<soap:operation soapAction="http://archer-tech.com/webservices/CreateUserSession" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CreateDomainUserSession">
<soap:operation soapAction="http://archer-tech.com/webservices/CreateDomainUserSession" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CreateUserSessionFromInstance">
<soap:operation soapAction="http://archer-tech.com/webservices/CreateUserSessionFromInstance" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CreateDomainUserSessionFromInstance">
<soap:operation soapAction="http://archer-tech.com/webservices/CreateDomainUserSessionFromInstance" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="TerminateSession">
<soap:operation soapAction="http://archer-tech.com/webservices/TerminateSession" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="generalSoap12" type="tns:generalSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CreateUserSession">
<soap12:operation soapAction="http://archer-tech.com/webservices/CreateUserSession" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CreateDomainUserSession">
<soap12:operation soapAction="http://archer-tech.com/webservices/CreateDomainUserSession" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CreateUserSessionFromInstance">
<soap12:operation soapAction="http://archer-tech.com/webservices/CreateUserSessionFromInstance" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CreateDomainUserSessionFromInstance">
<soap12:operation soapAction="http://archer-tech.com/webservices/CreateDomainUserSessionFromInstance" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="TerminateSession">
<soap12:operation soapAction="http://archer-tech.com/webservices/TerminateSession" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="general">
<wsdl:port name="generalSoap" binding="tns:generalSoap">
<soap:address location="https://egrcb-eur.archer.rsa.com/ws/general.asmx"/>
</wsdl:port>
<wsdl:port name="generalSoap12" binding="tns:generalSoap12">
<soap12:address location="https://egrcb-eur.archer.rsa.com/ws/general.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
self.token = self.general_client.service.CreateUserSessionFromInstance(cusfi)
self.token = self.general_client.service.CreateUserSessionFormInstance(**cusfi)