I try to send a webservice message with the recommended tools:
CREATE(locautXmlDoc);
locautXmlDoc.async := FALSE;
locautXmlDoc.load('C:\input.xml');
CREATE(locautXmlHttp);
locautXmlHttp.open('POST','https//:xxx',0);
locautXmlHttp.setRequestHeader('Content-type','text/xml');
locautXmlHttp.send(locautXmlDoc);
locautXmlDoc.load(locautXmlHttp.responseXML);
locautXmlDoc.save('C:\temp.xml');
But I get the error message "download failed"
I think the problem is, that I have to use a proxy.
How can I adress the way through a proxy?
Rallnus (Yamaha FJ1200 - '89 / 25th anniversary was great!)
0
Comments
This is my attempt, and it works for me..
Let me know if this is what you're looking for..
Rvduuren
I'll try your code. But now I've got another problem: I can't find the soap elements in my library. Whish version of the SOAP Framework shall I use?
Now I've got .Net Framework Version 1.1sp1. Do I need V. 2.0 or 3.0? Which is the best?
"C:\Program Files\Common Files\MSSoap\Binaries\mssoap1.dll"
I use MSSOAP1. This is (what I know) not related to the .Net framework.
I have serveral Customers working with it, no complaints there..
Good luck.
Info
http://support.microsoft.com/kb/307033/
Rvduuren
1) Our partner has a webservice which we connect to. This creates a transaction in their web system and returns an error status and a transaction number to us.
2) ANY time i do this over the web interface in Internet Explorer it always works fine. No issues. No time outs. Transaction number and no error every time.
3) However when using code very similar to above it errors out with the Navision standard "This message is for C/AL programmers....." screen. When we look in the partner system the transaction has been created successfully. It just has not been returned to Navision.
4) When this happens there is a good 15 seconds of 'hang' time before the error appears.
a.) always set the XMLDOM property ASYNC to false, unless you catch the asynchronous events
b.) always check the LOAD whether it has been successful as there might be encoding problems or even a not well-formed XML
I would expect the problem in your case to be the missing ASYNC=false as the default is true!
MCP+I, MCSE NT, Navision MCT (2004,2005)
The only LOAD in my code is in the 'Microsoft XML, v6.0'.DOMDocument
This LOAD comes AFTER the Connector.EndMessage; code where Connector is 'Microsoft Soap Type Library'.HttpConnector
This Connector.Endmessage is where my error is occouring, so checking anything to do with the LOAD is not useful therefore.
In your case, the problem is not related to the XML load as the sending already fails at the Connector.EndMessage. This indicates a communication problem already at the request level. Do you use a proxy/ firewall ? Check the internet settings of your IE and compare them to the proxy settings for the connector (if you use a proxy), as you said it works from there.
As you said you get a "This message is for C/AL programmers..". What exactly is the error description in the dialogbox ?
MCP+I, MCSE NT, Navision MCT (2004,2005)
NOW I have a new problem. When i put my address into Internet Explorer it works nice when I do:
https://myaddress.com/kdi/gui/custinfo.php
IE gives me the proper XML document back. However when i do:
IF NOT XMLDOC.LOAD('https://myaddress.com/kdi/gui/custinfo.php') THEN ERROR('FECK')
I always get FECK!!
Name DataType Subtype Length
MSXMLHTTP Automation 'Microsoft XML, v6.0'.XMLHTTP
MCP+I, MCSE NT, Navision MCT (2004,2005)
Of yourse, I missed the instantiation of the automation server and the send. This time, it's tested 8)
In case you need to send a request, use it instead of the '' in the send function.
But beware: any occuring error can not be caught! Therefore, any error,e.g. a connection error because of a unknown host, will lead to a C/SIDE error...
MCP+I, MCSE NT, Navision MCT (2004,2005)
I am using the following code to send XML files.
IF ISCLEAR(XMLHTTP) THEN
CREATE(XMLHTTP);
XMLHTTP.open('POST', GLSetup."VCS Host URL", FALSE);
XMLHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
IF ISCLEAR(XMLDomDoc) THEN
CREATE(XMLDomDoc);
XMLDomDoc.load(XMLInstream);
XMLHTTP.send(XMLDomDoc);
It works fine for 2 URLs I tried but it doesn't work for one I need it to work. I get the following response:
<?xml version="1.0"?>
<AuthorisationResponse>
<UserId></UserId>
<Reference></Reference>
<Response>~xmlMessage parameter is empty</Response>
<AdditionalResponseData></AdditionalResponseData>
</AuthorisationResponse>
Do you have any idea why?
Thank you,
Marcin