mibuso.com

Microsoft Business Solutions online community
It is currently Mon Apr 21, 2014 9:12 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Web Service Connection Error Exception.
PostPosted: Sun Aug 01, 2010 3:51 pm 
Offline

Joined: Mon Jun 19, 2006 12:28 pm
Posts: 2
Location: Hyderabad
Country: India (in)
Hi

The below code sends an xml request and picks the xml response perfectly when the Internet connection is up. Just suppose if the connection is down or Web service deosn't resond i get below error message at XMLHttpConn.send(XMLDoc);

I need to handle this exception by checking the connection before send the xml request.

I understand this error is due to connection failure, is there a way to handle this connection error exception.

Please advice..

Below are Code and Error message

==========CODE===============================

WebServiceLink:='http://aldoagi.icongodev.com/aldoagiws/instore.cfc?wsdl';

CLEAR(XP6);
DLG.OPEN('#1########################\\'+
'#2########################\');

DLG.UPDATE(1, 'Order Pre-Confirm');
DLG.UPDATE(2, 'Preparing Request');


WebOrder.RESET;
IF WebOrder.GET("OrdNo.") THEN
WebOrder.MARK(TRUE);

WebOrder.MARKEDONLY(TRUE);
WebOrder.Blob.CREATEINSTREAM(InStr);
WebOrder.Blob.CREATEOUTSTREAM(OutStr);
XP6.SETTABLEVIEW(WebOrder);
XP6.SETDESTINATION(OutStr);
XP6.EXPORT;

IF ISCLEAR(XMLDoc) THEN
CREATE(XMLDoc);
XMLDoc.load(InStr);

XMLDoc.save('C:\XMLRequest.xml');

IF ISCLEAR(XMLHttpConn) THEN
CREATE(XMLHttpConn);

DLG.UPDATE(2, 'Preparing Request');
XMLHttpConn.open('POST',WebServiceLink,FALSE);
XMLHttpConn.setRequestHeader('SOAPAction',WebServiceLink+'/'+AGIService);
XMLHttpConn.setRequestHeader('Content-Type','text/xml');

XMLHttpConn.send(XMLDoc);

DLG.UPDATE(2, 'Awaiting Response');
XMLDoc.load(XMLHttpConn.responseXML);

IF XMLHttpConn.status <> 200 THEN BEGIN
MESSAGE('Status %1 %2',XMLHttpConn.status,XMLHttpConn.statusText);
EXIT;
END;

XMLDoc.save('C:\XMLResponse1.xml');

DLG.UPDATE(2, 'Parsing Response');
RemoveNamespace(XMLDoc,XMLDoc);
XMLDoc.save('C:\XMLResponse2.xml');
XMLDoc.save(OutStr);

ReadxmlResponsePreConfirmOrder('C:\XMLResponse2.xml');
DLG.CLOSE;

==========CODE===============================



======ERROR================================

---------------------------
Microsoft Business Solutions-Navision
---------------------------
This message is for C/AL programmers:

The call to member save failed. MSXML3.DLL returned the following message:
System does not support the specified encoding.



---------------------------
OK
---------------------------
======ERROR================================



Regards,
Mirza.


Top
 Profile E-mail  
 
 Post subject: Re: Web Service Connection Error Exception.
PostPosted: Mon May 21, 2012 2:52 pm 
Offline

Joined: Sun Feb 26, 2012 7:09 pm
Posts: 11
Country: Czech Republic (cz)
Have you solved the issue?


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: