Highlighted
Trusted Contributor.
Trusted Contributor.
716 views

Web Service Script Issue

With web service protocol, I send a soap request and do retrieve the response from tree view. However below exception is thrown out. Is there anybody encounter this before? What is the root cause?

 

InvokeMethod failure:Unable to cast object of type 'Mercury.LR.NETProxy.RequestAddress[]' to type 'Mercury.LR.NETProxy.ResponseInfo[]

0 Likes
14 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hi,

 

Web services usually need more detailed analysis.

Which version of LoadRunner are you working with?

 

A few quick suggestions:

1. When you are importing a service from Manage Services -> Import -> Advanced Settings if the script was generated  using .Net Framework toolkit try  the Axis/Java based Web Service Framework and vice verse if possible.

2. Import a working soap request and check is the issue will appear during replay.

 

Kind regards,

Vesela

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Hi Vesela,

 

I tried the Axis/Java based web service framework as the toolkit, but it doesn't work.

 

I am using the Vugen 11.04. For this specific request payload, i do can see the right response from the snapshot of the tree view. So i assume that the soap request is valid.

 

Is there any situation that improper soap request will retrieve the right response exists?  

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hi,

 

Please check the following KM:

Error: "ExtractResultArg failure: Object reference not set to an instance of an object.." while replaying a Web Services script

http://support.openview.hp.com/selfsolve/document/KM1215319

 

In your case  the exception is  "Unable to cast object of type 'Mercury.LR.NETProxy.RequestAddress[]' to type 'Mercury.LR.NETProxy.ResponseInfo[]"

 

This  could  mean that something in the content of ResponseInfo  which you received during the replay is not what was expected to be received. For example it could be the name of the elements, the expected value types of the elements, whether an element is mandatory or optional, etc.

 

In the KM I have sent to you the issue was Note that the element "xxxx" is specified such that it is required to be present in the response from the server. However the XML response from the server omits this value.

The conclusion of the KM is: In general, perform a review of the WSDL in conjunction with the errors displayed on replay to identify and modify the relevant elements in the WSDL file.

 

There are improvements available in web services protocol in LoadRunner 11.52 and LoadRunner 12 compared to LR 11.04 . One additional suggestion I can give you it to try to import the wsdl file in LoadRunner 11.52 or 12 if you have an option to install it on other machine and check if there will be a change in the behavior.

 

With such type of problems the script and the wsdl file need to be analyzed. Could you please open a case with support?

 

Kind regards,

Vesela

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Hi Vesela,

 

Thank you for the post and the KM. I go through the KM and your latest post. In my WSDL, only the message, service opearation, port binding are defined. In the KM, it seems that service response cannot meet the predefined response schema. I don't find from the WSDL. Can you let me know where i can found those response schema? Your suggestion is to modify the WSDL, which part of WSDL need to be changed? Which element is pinpointed based on below WSDL file and error message?

 

WSDL File:

<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="gisserviceAddrValidation" targetNamespace="http://www.avivacanada.com/services/gisservice/addrvalidation/v1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.avivacanada.com/services/gisservice/addrvalidation/v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:documentation>
- <wsdl:appinfo source="WMQI_APPINFO">
- <MRWSDLAppInfo imported="true">
  <generatedXSD location="GISServiceAddressValidation_InlineSchema1.xsd" />
  <binding hasEncoding="false" imported="true" name="AddrValidationSoapBinding" originalBindingStyle="document" />
  </MRWSDLAppInfo>
  </wsdl:appinfo>
  </wsdl:documentation>
- <wsdl:types>
- <xsd:schema targetNamespace="http://www.avivacanada.com/services/gisservice/addrvalidation/v1" xmlns:ns1="http://www.avivacanada.com/schema/gisservice/addrvalidation/v1/">
  <xsd:import namespace="http://www.avivacanada.com/schema/gisservice/addrvalidation/v1/" schemaLocation="https://yyzesb2020.ana.corp.aviva.com:7810/services/gisservice/addrvalidation?xsd=xsd0" />
  <xsd:include schemaLocation="https://yyzesb2020.ana.corp.aviva.com:7810/services/gisservice/addrvalidation?xsd=xsd1" />
  </xsd:schema>
  </wsdl:types>
- <wsdl:message name="AddrValidationRqMsg">
  <wsdl:part element="tns:AddrValidationRq" name="parameters" />
  </wsdl:message>
- <wsdl:message name="AddrValidationRsMsg">
  <wsdl:part element="tns:AddrValidationRs" name="parameters" />
  </wsdl:message>
- <wsdl:message name="AddrValidationFaultMsg">
  <wsdl:part element="tns:AddrValidationFault" name="parameters" />
  </wsdl:message>
- <wsdl:portType name="AddrValidation">
- <wsdl:operation name="addrvalidation">
  <wsdl:input message="tns:AddrValidationRqMsg" name="AddrValidationRq" />
  <wsdl:output message="tns:AddrValidationRsMsg" name="AddrValidationRs" />
  <wsdl:fault message="tns:AddrValidationFaultMsg" name="AddrValidationFault" />
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="AddrValidationSoapBinding" type="tns:AddrValidation">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="addrvalidation">
  <soap:operation soapAction="" style="document" />
- <wsdl:input name="AddrValidationRq">
  <soap:body use="literal" />
  </wsdl:input>
- <wsdl:output name="AddrValidationRs">
  <soap:body use="literal" />
  </wsdl:output>
- <wsdl:fault name="AddrValidationFault">
  <soap:fault name="AddrValidationFault" use="literal" />
  </wsdl:fault>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="gisserviceAddrValidation">
- <wsdl:port binding="tns:AddrValidationSoapBinding" name="AddrValidationSoapBindingSOAP">
  <soap:address location="https://yyzesb2020.ana.corp.aviva.com:7810/services/gisservice/addrvalidation" />
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>

 

Error Message:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Unable to cast object of type 'Mercury.LR.NETProxy.RequestAddress[]' to type 'Mercury.LR.NETProxy.ResponseInfo[]'.
   at Mercury.LR.NETProxy.gisserviceAddrValidation.addrvalidation(ClientInfo& ClientInfo, RequestAddress[] Addresses, ResponseInfo[]& Addresses1)

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Hi,

 

The issue will require more detailed investigation. Please open a case with support.

 

Kind regards,

Vesela

HPE Support
If you haven’t tried it yet, come and join us in our entitled forums at Support Customer Forums

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution and give Kudos to the author for their assistance.
0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Hi Vesela,

 

I did open a ticket regarding this issue a few weeks ago, but HP support haven't provide a solution by now.

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Do you have a case number? Also, what is the name of the company that you represent?

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

The case number is 4648251174. I am working in Aviva Canada.

0 Likes
Highlighted
Absent Member.
Absent Member.

The case hasn't reached the RnD yet. Vesela, could you expedit it?

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Hi Galshadeck,

 

I have another ticket 4648316195 for which i haven't received any solution after 2 weeks. Can you expedite or escalate it as well?

0 Likes
Highlighted
Absent Member.
Absent Member.

Could you share its summary here?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.