简体   繁体   English

SOAPUI响应消息

[英]SOAPUI response message

I am trying to call a web service using soap UI, here is the xml for the request: 我正在尝试使用soap UI调用Web服务,这是请求的xml:

<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>

No matter what I put on customerIdentification and IdentificationValue 无论我对客户的身份识别和识别价值如何

 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. DataContractAttribute属性。

Here is the message: 这是消息:

<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>

Any idea for the error ? 对错误有任何想法吗?

Here is wsdl for the service 这是服务的wsdl

Basically the error is due to invalid value for the CustomerIdentification element in the request. 基本上,该错误是由于请求中CustomerIdentification元素的值无效所致。

Use one of the below value for element CustomerIdentification in the request which you are sending based on the error message and wsdl file provided. 根据提供的错误消息和wsdl文件,在要发送的请求中,将以下值之一用于元素CustomerIdentification

  • Custom 习惯
  • CustomerSESSNOrCompanyNo CustomerSESSNOrCompanyNo
  • CustomerNOSSNOrCompanyNo CustomerNOSSNOrCompanyNo
  • CustomerReferenceNumber CustomerReferenceNumber
  • CustomerGuid CustomerGuid

In order fix the error, you may have to provide the appropriate value for CustomerIdentificationValue element as well based on the chosen value for identification. 为了纠正错误,您可能还必须根据所选的标识值为CustomerIdentificationValue元素提供适当的值。

By the way, you can validate the soap request in SoapUI by right click and validate in the request editor (short cut is Alt + v key combination for the same). 顺便说一句,您可以通过右键单击 SoapUI来验证soap请求, 在请求编辑器中进行验证 (快捷Alt + vAlt + v组合键)。

    <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>

Can you try this? 你可以试试这个吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM