Hi all,
I have created a codeunit which is called from action pane in customer card. But while calling from action pane i am getting following error as mentioned below:
"The server "net.[url=tcp://localhost:7046/DynamicsNAV/Service]tcp://localhost:7046/DynamicsNAV/Service[/url]" is either unavailable or your connection has been lost. Do you want to attempt to reconnect".
On clicking YES on the error dialog box the RTC simply closes and gives a second eror message as below:
"The connection to the server is lost.The application will close."
This functionality is working fine in classic client.
Please help!!!
0
Answers
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Thanks for the response.
This codeunit is performing the following tasks:
1.First, it exports some data(in customer table) using xmlport.
2.Then it send the xml using http post method to a webservice
3.Then it receives the response from the webservice and imports the data in a table using xml port
This whole functionality is working well in classic client, only when I try doing it in RTC, that i receive the said message.
Please find a code part:
CLEAR(TempBlob);
TempBlob.Blob.CREATEOUTSTREAM(Ostream);
XmlPort.SetCurrencyCodes(Para A,Para B,Para C);
XmlPort.SETDESTINATION(Ostream);
XmlPort.EXPORT;// if i comment & rest of the code after message('hi') ,then i dont get the error message and i receive 'hi' message.
Message('hi');
.......rest of the code to call 'send soap message'..
Please help.
It looks like the service tier is crashing. Check the eventlog on service tier.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Following is the message found in the log:
Service: MicrosoftDynamicsNavServer
User: adder\Admin
Type: System.ArgumentException
Message: Invalid name character in 'soap:Envelope'. The ':' character, hexadecimal value 0x3A, cannot be included in a name.
After you run Xmlport.export
Load the stream into MSXMLDocument.
create a function that will add namespaces and return a new DOM Object.
Then send that to web services.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Would it be possible for you to post a sample of the code you are using to do this?
I run into the same problem but I am not being able to getting it to work, so I would appreciate any help with a code sample.
thanks in advance
jpjesus@netcabo.pt
AddNamespace looks like this, but in your case it will be different depending on how your xml file looks like.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The solution worked initially but started giving the same problem when we did some more modification. Finally i found that the error arised when xml port(meant for exporting the data & create a xml file) was called, so instead of calling the xml port to export the data & create an xml file, I exported the data and created the xml in the way as shown below:
CREATE(XmlEnv);
XmlEnv.preserveWhiteSpace := FALSE;
XmlEnv.loadXML(
'<?xml version="1.0" encoding="utf-8"?>' +
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
' xmlns:xsd="http://www.w3.org/2001/XMLSchema"' +
' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
' <soap:Body>' +
' <getNameRequest xmlns="http://Abcd.com" xmlns:doc="http://abcd.com">' +
' <add>'+
' <city>'+PC+'</city>'+
' <postCd>'+Pd+'</postCd>'+
' </add>'+
' </getNameRequest>'+
' </soap:Body>'+
' </soap:Envelope>');
where pc,pd are the variables containing data.,
Thanks,
Prabh
@navinb
I don't think that one can use those properties in this case. As far as I could read on several forums these properties can only be applied to a single namespace. If you have more than one, like I do, it won't work.
@All
Another thing I manage to find out is that this is not directly related to namespaces. I removed all references to namespaces that I was using on my XMLPort, as well to the SOAP.
If a single TAG as the character ":" in it, this error will pop up in the RTC. In my case, bcause the webservices I have to invoke use something like "cdp:ItemCode" in all tags, I need to use the ":" in all tags..... darn
Not sure that I can persuade the WebServices provider into changing the tags.....
jpjesus@netcabo.pt
http://www.mymibuso.org/forum/viewtopic.php?f=32&t=40874&sid=6db8bf86c0c1bc5bd4e828924dc9be16
jpjesus@netcabo.pt