<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ref1="http://localhost/navision.wsdl"> <SOAP-ENV:Body> <ref1:StockAdjustmentMessage> <stockAdjustment> <itemCode>ITEM3</itemCode> <quantityAdjusted>-330</quantityAdjusted> <reasonCode>QA</reasonCode> </stockAdjustment> </ref1:StockAdjustmentMessage> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
PROCEDURE StockAdjustmentMessage@1000000008(stockAdjustment@1000000000 : XMLport 50001) OK : Boolean; BEGIN OK := stockAdjustment.IMPORT; END;
static void Main(string[] args) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(@"c:\StockAdjustment.xml"); HttpWebRequest request; HttpWebResponse response; Stream responseStream; StreamWriter writer; StreamReader reader; string url = @"http://iis:7047/DynamicsNAV/WS/TestCompany/Codeunit/ReflexInbound"; request = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url)); request.ProtocolVersion = new Version(1, 1); request.Method = "POST"; request.ContentType = @"application/xml; charset=utf-8"; request.Accept = "text/xml"; request.UseDefaultCredentials = true; request.Headers.Add("SOAPAction", @"StockAdjustmentMessage"); writer = new StreamWriter(request.GetRequestStream(), Encoding.UTF8); writer.Write(xmlDoc.OuterXml); writer.Flush(); writer.Close(); response = (HttpWebResponse)request.GetResponse(); responseStream = response.GetResponseStream(); string response_result = string.Empty; if (responseStream != null) { reader = new StreamReader(responseStream); response_result = reader.ReadToEnd(); }
Answers