使用Suds客户端调用Soap方法时获取IllegalArgumentException

时间:2018-07-23 16:53:11

标签: soap client suds

请帮助我获取方法“ getManagedObjects”的肥皂响应。 我在这里提供了代码,客户端输出以及异常。 我正在尝试使用client.service访问我的soap方法。 我能够连接到端点服务。但我无法得到答复。 方法的参数正确,我用SoapUI进行了测试,我能够在SoapUI中获得响应

以下是我使用wsdl获取托管对象的代码

from suds.client import Client    
url=local_path_for_wsdl_file    
client = Client(url, location=endpoint_url, username=usrname, password=pswd)    
print client    
request = client.factory.create("ns4:GetMOsRequest")    
config = client.factory.create("ns3:Configuration")    
config._confId = "1"    
request.configuration = config    
request.moId = ["XXX","YYY"]    
result = client.service.getManagedObjects(request)    
print result

输出:

Service ( OpenCmPersistencyServiceSOAP ) 
   Ports (1):
      (OpenCmPersistencyPort)
         Methods (12):
            createConfiguration(ns3:ConfigurationHeader configurationHeader, )
            createManagedObjects(ns3:Configuration configuration, ns3:ManagedObject[] managedObject, )
            deleteConfiguration(ns3:Configuration configuration, )
            deleteManagedObjects(ns3:Configuration configuration, ns3:MOId[] moId, )
            getConfigurations(ns4:ConfigurationRequestFilter filter, )
            getMOLites(ns3:Configuration configuration, ns3:MOId[] moId, )
            getManagedObjects(ns3:Configuration configuration, ns3:MOId[] moId, )
            getMetadata(ns4:MetadataRequestFilter filter, )
            getRelatedMOLites(ns3:Configuration configuration, ns3:RelationshipId relationship, ns3:MOId[] moId, )
            queryMOLites(ns3:Configuration configuration, ns5:Query query, ns5:VariableBindings variableBindings, )
            updateConfiguration(ns3:ConfigurationHeader configurationHeader, )
            updateManagedObjects(ns3:Configuration configuration, ns3:ManagedObject[] managedObject, )
         Types (77):
            ns2:Annotation
            ns2:Annotations
            ns0:BaseBatchItemResult
            ns0:BaseErrorCodes
            ns0:BaseRequest
            ns0:BaseResponse
            ns4:BatchItemMOLiteResult
            ns4:BatchItemMOLiteSequenceResult
            ns4:BatchItemMOResult
            ns4:BatchItemMOSequenceResult
            ns0:BatchOperationResponse
            ns0:ClientCredentials
            ns3:Configuration
            ns3:ConfigurationHeader
            ns3:ConfigurationId
            ns4:ConfigurationIdFilter
            ns4:ConfigurationNameFilter
            ns4:ConfigurationRequestFilter
            ns3:ConfigurationType
            ns4:ConfigurationTypeFilter
            ns4:CreateConfigurationRequest
            ns4:CreateConfigurationResponse
            ns4:CreateMOsRequest
            ns4:CreateMOsResponse
            ns4:DeleteConfigurationRequest
            ns4:DeleteConfigurationResponse
            ns4:DeleteMOsRequest
            ns4:DeleteMOsResponse
            ns4:GetConfigurationsRequest
            ns4:GetConfigurationsResponse
            ns4:GetMOLitesRequest
            ns4:GetMOLitesResponse
            ns4:GetMOsRequest
            ns4:GetMOsResponse
            ns4:GetMetadataRequest
            ns4:GetMetadataResponse
            ns4:GetRelatedMOLitesRequest
            ns4:GetRelatedMOLitesResponse
            ns3:Item
            ns2:ItemDef
            ns3:List
            ns2:ListDef
            ns3:MOId
            ns3:MOLite
            ns3:ManagedObject
            ns2:ManagedObjectDef
            ns4:ManagedObjectDefFilter
            ns2:ManagedObjectDefs
            ns4:MetaContentSelector
            ns4:MetadataRequestFilter
            ns3:P
            ns2:PDef
            ns3:ParameterContainer
            ns2:ParameterContainerDef
            ns3:PlanOperation
            ns2:PropertyDef
            ns2:PropertyDefs
            ns5:Query
            ns4:QueryMOLitesRequest
            ns4:QueryMOLitesResponse
            ns5:QueryType
            ns2:RelationshipDef
            ns4:RelationshipDefIdFilter
            ns2:RelationshipDefs
            ns2:RelationshipId
            ns3:RelationshipId
            ns3:ScalarList
            ns2:ScalarListDef
            ns3:StructList
            ns2:StructListDef
            ns4:UpdateConfigurationRequest
            ns4:UpdateConfigurationResponse
            ns4:UpdateMOsRequest
            ns4:UpdateMOsResponse
            ns2:ValueType
            ns5:VariableBinding
            ns5:VariableBindings


(reply){
   errorCode = "ERR_ILLEGAL_ARGUMENT"
   cause = "IllegalArgumentException: Configuration does not exist.

Error details: java.lang.IllegalArgumentException: Configuration does not exist.

0 个答案:

没有答案