Highlighted
Trusted Contributor.
Trusted Contributor.
2055 views

Problems with WCF Windows Web Services over nettcp bindings with callbacks in LR 12.02 and 12.50

I'm hitting a nettcp based WCF Service using LR VuGen 12.02 and Web Services protocol by importing the WSDL of the Service.

After composing a request and trying to send it, I'm getting the following error. which actually works fine from the WPF Client but fails from the LR VuGen Script

    Action.c(16): Error:The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:59:59.9949990'. 
Error: An existing connection was forcibly closed by the remote host 

Server stack trace: 
   at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
   at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   at System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at HP.WcfRouter.IUniversalContract.Send(Message message)
   at HP.WcfRouter.WcfRouter.DoRequestInternal(Boolean isOneWay, Dictionary`2 context)
Action.c(16): Error:InvokeMethod failure: External component has thrown an exception..
Action.c(16): Error:ExtractResultArg failure: Object reference not set to an instance of an object..
Action.c(16): Error:Web service call "GetTopicsByUserID" execution failed

I have tried out many suggestions relevant but with no luck For your reference: Increasing Timeouts and maxItemsInObjectGraph and many more such posts on StackOverflow such as Socket Connection Aborted-StackOverflow post

 

I have posted this on StackOverflow and James Pulley replied back but I'm not able to build a custom solution using Visual Studio as it is very complex

Can you please let me know if LR VuGen 12.02 is compatible with nettcp binding and callbacks and if yes how to fix the issue

 

This is how I configured the Security settings based on the WSDL Description 



0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

If your client binding configuration works, I suggest you apply it for Vugen by following steps:

1. Enable Security Scenario, choose Custom Binding (then Quit Vugen)
2. Go to "<script_folder>\WSDL\@config\<serviceName>.stss", open and add "configurationName" attribute to <protocols> element: configurationName="<your_binding_name>"
3. Then, go to "%lr_path%\bin\HP.Utt.StandaloneDebugger.exe.confi​g", open and add your Client configuration binding (inside system.serviceModel/bindings section) with the name as above.
4. Start Vugen and try replaying


Hope this works.

Regards,
Thien

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Hi Thien,

 

I'm able to see only the following file "HP.Utt.StandaloneDebugger.exe.config"

 

<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"
sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

 

Where should I add the Client Configuration and what specific parameters are to be added?

 

Please reply ASAP.

 

Thanks in advance.

Murali

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi Murali,

 

With your HP.Utt.StandaloneDebugger.exe.config, it should be:

<?xml version="1.0"?>
<configuration>
 <startup useLegacyV2RuntimeActivationPolicy="true">
 <supportedRuntime version="v4.0"
 sku=".NETFramework,Version=v4.0"/>
 </startup>
 <system.serviceModel>
        <!-- place your binding configuration here-->
    </system.serviceModel>
</configuration>

 

Regards,

Thien

 

Edit: Here is an example, but I think you should get the configuration from Dev Team

<?xml version="1.0"?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
	<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
    <system.serviceModel>
        <bindings>
	    <netTcpBinding>
		<binding name="bindingName" 
		        closeTimeout="00:01:00"
		        openTimeout="00:01:00" 
			receiveTimeout="00:10:00" 
			sendTimeout="00:01:00"
			transactionFlow="false" 
		        transferMode="Buffered" 
			transactionProtocol="OleTransactions"
			hostNameComparisonMode="StrongWildcard" 
			listenBacklog="10"
			maxBufferPoolSize="524288" 
			maxBufferSize="65536" 
			maxConnections="10"
			maxReceivedMessageSize="65536">
			  <readerQuotas maxDepth="32" 
			        maxStringContentLength="8192" 
				maxArrayLength="16384"
				maxBytesPerRead="4096" 
				maxNameTableCharCount="16384" />			  
			</binding>
		 </netTcpBinding>
	</bindings>		
    </system.serviceModel>
</configuration>

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi,

I am facing the same error as Murali.  I followed the workaround given above.  

When I replay, I am getting this error : No elements matching the key '<Your binding Name>' were found in the configuration element collection.  I made sure that the naming is correct in all the configs and the contract has the correct name.

Can  you please let me know if this issue is resolved by the workaround?

Thanks,

snatarajan

0 Likes
Highlighted
Absent Member.
Absent Member.

After looking into the 'WCF Extensibility' Help topics, It seems LR expects 'Custom Binding' implementation.  Further analyzing the nature of our application, the following steps helped me to submit the request and get a response back.

  • Make sure net.tcp is enabled and the services can be connected through the nettcpbinding port.  ( I used WCFTestClient to make sure that I can access the service through nettcp)
  • Create a script with webservices
  • In the 'Manage Services' modal, Import the WSDL
  • Go to 'Protocols and Security' Tab.  Edit Data and pick 'Plain Soap' option from 'Core Scenarios'. 
  • In the Advanced modal, set the reliable session and other necessary items as per the nature of the application under test (AUT)
  • Apply the settings
  • Open the "<script_folder>\WSDL\@config\<serviceName>.stss", remove the Text encoding element and replace the 'Preferredlrhttptransport' with a 'TCPTransport' element and supply the attributes that matches the AUT's configuration.
  • If there is a 'ReliableSession' within the TCPTransport, move it above the TCPTransport.  Make sure the Transport element is placed last.  (LR expects elements in this order : Encoding, Security, ReliableSession, Transport)
  • NOTE : There is no need for supplying a configurationName in the protocols element
  • Save the config
  • Add web_add_header to the script before the 'web_service_call' for any content types that are supported by the AUT. 
  • Add web_service_set_option to exclude WS headers as needed
  • Add the Web service call using the modal and making sure to pick the nettcpbinding for port
  • Run the script

Talk with the developers and find out if they can implement a custom binding for the nettcp.  If the answer is a no for various valid reasons, hope the above steps help.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

For anyone who is still encoutering similar issue, reply provided by snatarajan  is basically valid.

More added:

  • Before running the script attached in VuGen, pay attention to WSDL\@config\*.stss file which should not contain the commented out lines.

 

<protocols scenario="customBinding" uiType="customBinding" xmlns="http://hp/ServiceTest/config">

  <mode>Private</mode>

  <customization>

   <!--  <textMessageEncoding addressingVersion="WSAddressing10" />

    <reliableSession /> -->

    <tcpTransport />

  </customization>

  <identities>

    <server />

    <client />

  </identities>

</protocols>

 

  • Also, there is NO need to modify HP.Utt.StandaloneDebugger.exe.config.

 

This is just a hello world net.tcp scenario without using security and authentication features. Customer’s real case may be complex enough and difficult to tackle.

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.