Hi to all,
I new to web services.
i googled and found one soap API. which is http://www.weather.gov/forecasts/xml/do ... Series.xmlby calling this SOAP request i will get a response of
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns2199:GmlTimeSeries xmlns:ns2199="uri:DWMLgen">
<listLatLon xsi:type="xsd:string">38.99,-77.02 39.70,-104.80 47.6,-122.30</listLatLon>
<startTime xsi:type="xsd:string">2000-01-01T00:00:00</startTime>
<endTime xsi:type="xsd:string">2010-01-01T00:00:00</endTime>
<compType xsi:type="xsd:string">Between</compType>
<featureType xsi:type="xsd:string">Forecast_Gml2Point</featureType>
<propertyName xsi:type="xsd:string">maxt,mint</propertyName>
</ns2199:GmlTimeSeries>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Defined variable are
Name DataType Subtype Length
locautXmlDoc Automation 'Microsoft XML, v6.0'.DOMDocument
locautXmlHttp Automation 'Microsoft XML, v6.0'.XMLHTTP
test Text 250
and i coded in the code unit run tiger
//HTTP Start
// main method new
IF ISCLEAR(locautXmlDoc) THEN
CREATE(locautXmlDoc);
locautXmlDoc.async:=FALSE;
locautXmlDoc.loadXML('<?xml version="1.0" encoding="ISO-8859-1" ?>'
+'- <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" '
+'xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"'
+'xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"'
+'xmlns:SOAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/">'
+'
http://www.weather.gov/forecasts/xml/docs/SOAP_Requests/GmlTimeSeries.xml');
locautXmlHttp.send(locautXmlDoc);
locautXmlDoc.load(locautXmlHttp.responseXML);
locautXmlDoc.save(test);
MESSAGE(test);
While running error pops up at locautXmlHttp.send(locautXmlDoc); error message is (“The Automation variable has not been instantiated.”).
My intension is to consume this web service and print the out put.
Please Help Me to resolve this issue.
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
i have corrected the code
IF ISCLEAR(locautXmlDoc) THEN
CREATE(locautXmlDoc);
locautXmlDoc.async:=FALSE;
IF ISCLEAR(locautXmlHttp) THEN
CREATE(locautXmlHttp);
locautXmlHttp.open('post','http://www.weather.gov/forecasts/xml/docs/SOAP_Requests/GmlTimeSeries.xml');
locautXmlHttp.send('http://www.weather.gov/forecasts/xml/docs/SOAP_Requests/GmlTimeSeries.xml');
locautXmlDoc.load(locautXmlHttp.responseXML);
locautXmlDoc.save('d:\NHW\Ws.xml');
Without a error code unit runs But XML empty file created.
I also checked HTTP Debugger. Debugger showing response .
Can you help me in this.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.