SOAP Exception: Maximum retry on the connection exceeded


November 22, 2007 - 10:12, by Steven Van de Craen - 0 Comments

Setup

On of my current projects is a custom solution for Microsoft Dynamics NAV to communicate with SharePoint using a Web Service. In order to do this you need to install the SOAP Toolkit (on the server and any clients running the code) to build a SOAP Message in C/AL code.

C/AL

// Create SOAP message
CREATE(AutSoapHttpConnector);
CREATE(AutSoapSerializer);
CREATE(AutXMLDocument);
AutSoapHttpConnector.Property('EndPointURL', 'http://moss.litwareinc.com/_ws/customservice.asmx');
AutSoapHttpConnector.Property('Timeout', '9000');
AutSoapHttpConnector.Connect;
AutSoapHttpConnector.Property('SoapAction', 'http://vandest/webservices/HelloWorld');
AutSoapHttpConnector.BeginMessage;

AutSoapSerializer.Init(AutSoapHttpConnector.InputStream);
  AutSoapSerializer.StartEnvelope('SOAP', 'NONE');
  AutSoapSerializer.StartBody;
  AutSoapSerializer.SoapDefaultNamespace('http://vandest/webservices');
    AutSoapSerializer.StartElement('CreateHelloWorld');
    ...

Problem

Maximum retry on the connection exceeded. HRESULT=0x80004005: Unspecified error - Connector: Unspecified HTTP error. HRESULT=0x800A1518

Solution

Don't use the Fully Qualified Domain Name (FQDN) of the computer running the Web Service, instead use the NETBIOS Name:

AutSoapHttpConnector.Property('EndPointURL', 'http://moss/_ws/customservice.asmx');

http://support.microsoft.com/kb/892964