Showing posts with label WCF. Show all posts
Showing posts with label WCF. Show all posts

Sunday, 31 December 2017

SSL/TLS error when calling a web service

For one of our integrations we received the following error when it was enabled in production.

Could not establish secure channel for SSL/TLS with authority ''.

The web service requires some certificates to be installed which were correctly installed. The web service was working fine on development machines. Initial investigation did not find anything different between the development/production systems. We then traced the web service calls using Fiddler on both development and production machines and that's when we found out that the number of ciphers are different on both environment. Production did not had the ciphers highlighted below.


A quick search on internet pointed towards a windows KB (3172614) which adds new ciphers. Installing the KB fixed the issue.

Note: The KB requires restart of the machine.

This posting is provided "AS IS" with no warranties. Use code at your own risk.

Monday, 7 March 2016

Error while activating inbound port

Last week we received an error while trying to activate a previously working WCF inbound port. The error message was
The service '<SERVICE_NAME_HERE>' could not be generated.\n  Error: SysDictType object not initialized.

Stack trace

(S)\Classes\AifServiceDataTypeGenerator\generateType - line 76
(S)\Classes\AifServiceDataTypeGenerator\generateDataContractClass - line 127
(S)\Classes\AifServiceDataTypeGenerator\generateType - line 54
(S)\Classes\AifServiceDataTypeGenerator\generate - line 68
(S)\Classes\AifMessageContractGenerator\generate - line 22
(S)\Classes\AifServiceGenerator\generate - line 30
(S)\Classes\AifServiceGenerationManager\generateServices - line 102
(S)\Classes\AifPortManager\deployPort - line 22
(C)\Forms\AifInboundPort\Designs\DesignList\DeployPort\Methods\Clicked - line 12
The error message was shown on "AIF services" form "General" fast tab.

On investigation we found out that there was a code merge between two TFS branches and somehow one of the EDT used in the service contract was removed. When AIF was trying to generate service artifacts, it could not find the EDT and hence was throwing above error. Once the EDT was re-created, the error disappeared and service activated successfully.

This posting is provided "AS IS" with no warranties. Use code at your own risk.

Sunday, 21 February 2016

A call to SSPI failed, AX-BizTalk WCF service

Recently we developed integration between AX and an external system through BizTalk. The data flow from BizTalk to AX was using a WCF service. Everything worked fine in dev/test/uat systems. Once the code was deployed to production system and configured to talk to BizTalk we started getting the following error.

A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect

On investigation we found that User Principal Name (UPN) was not setup properly on the BizTalk Send port. The UPN is usually the AD user under which AX service is running (in an email format e.g. axServiceUser@companydomain.com). It can also be viewed from the service WSDL URI. Find the service from the inbound ports and copy the WSDL URI.


Paste the URI in internet explorer and WSDL will be shown. Scroll to the end and UPN is shown (highlighted below).


Copy this value and paste it in the "Endpoint Identity" in the Send port of BizTalk application as shown below


The error message should disappear.

Note: There may be other causes (Kerberos/Double hop issues) of this error message. In our cause this was the only issue.

This posting is provided "AS IS" with no warranties. Use code at your own risk.