首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SOAPUI响应消息

SOAPUI响应消息
EN

Stack Overflow用户
提问于 2017-10-25 13:02:47
回答 2查看 1.2K关注 0票数 2

我试图使用soap调用一个web服务,下面是请求的xml:

代码语言:javascript
复制
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:uuid:e657a351-ae8c-42c5-b083-ebe5dcda5c0b">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:GetCustomerAccounts>
         <urn:CustomerLookup>
            <urn:CustomerIdentification>test</urn:CustomerIdentification>
            <urn:CustomerIdentificationValue>aptic</urn:CustomerIdentificationValue>
            <!--Optional:-->
            <urn:JuridicalType>?</urn:JuridicalType>
         </urn:CustomerLookup>
         <!--Optional:-->
         <urn:CustomerOwnerReferenceFilter>?</urn:CustomerOwnerReferenceFilter>
      </urn:GetCustomerAccounts>
   </soapenv:Body>
</soapenv:Envelope>

无论我在customerIdentification和IdentificationValue上放了什么

无效枚举值“test”不能反序列化为'Aptic.WebIntegrationPlatform.Soap.Enums.CustomerIdentificationType类型,请确保存在必要的枚举值,并在类型为 DataContractAttribute属性

这是一个信息:

代码语言:javascript
复制
<Message>The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter urn:uuid:e657a351-ae8c-42c5-b083-ebe5dcda5c0b:CustomerLookup. The InnerException message was 'Invalid enum value 'test' cannot be deserialized into type 'Aptic.WebIntegrationPlatform.Soap.Enums.CustomerIdentificationType'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.</Message>
               <StackTrace><![CDATA[at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameter(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)]]></StackTrace>
               <Type>System.ServiceModel.Dispatcher.NetDispatcherFaultException</Type>
            </ExceptionDetail>
         </detail>

对错误有什么想法吗?

这是服务的wsdl

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-10-26 02:27:28

基本上,错误是由于请求中的CustomerIdentification元素的无效值造成的。

在您根据提供的错误消息和wsdl文件发送的请求中,使用以下元素CustomerIdentification中的一个值。

  • 自定义
  • CustomerSESSNOrCompanyNo
  • CustomerNOSSNOrCompanyNo
  • CustomerReferenceNumber
  • CustomerGuid

为了修复错误,您可能必须为CustomerIdentificationValue元素提供适当的值,以及基于所选的标识值。

顺便说一句,您可以通过右键单击并在请求编辑器中验证SoapUI中的soap请求(快捷方式是Alt + v键的组合)。

票数 3
EN

Stack Overflow用户

发布于 2017-10-25 15:05:50

代码语言:javascript
复制
    <xs:simpleType name="CustomerIdentificationType">
       <xs:restriction base="xs:string">
           <xs:enumeration value="Custom"/>
           <xs:enumeration value="CustomerSESSNOrCompanyNo"/>
           <xs:enumeration value="CustomerNOSSNOrCompanyNo"/>
           <xs:enumeration value="CustomerReferenceNumber"/>
           <xs:enumeration value="CustomerGuid"/>
      </xs:restriction>
    </xs:simpleType>

你能试试这个吗?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46933225

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档