Problem with HTTP post

AitorEG
Member Posts: 342
Hi everyone,
I am creating a develepomnet, that conenct with a webService, using HTTP post, that sends and XMl file to the server.
When I first start the RTC, and try to create the connection, appears this error:

If I dont close the RTC, and I try again to communicate with the service, I see this error:

It looks that the request is getting "stucked", but I dont understand when, where or why. Im creating the request in this way:
Does anyone see where can the development crash?
Any help will be really appreciatd, I'm quite stucked with this.
Thank you all!
I am creating a develepomnet, that conenct with a webService, using HTTP post, that sends and XMl file to the server.
When I first start the RTC, and try to create the connection, appears this error:

Error in the call to System.........dispose with this message: A task can only be discarded if has a completion status
If I dont close the RTC, and I try again to communicate with the service, I see this error:

It looks that the request is getting "stucked", but I dont understand when, where or why. Im creating the request in this way:
HttpWebRequest := WebRequest.Create(Uri.Uri('https://xxxxxxx/shipping/ship')); HttpWebRequest.Method := 'POST'; HttpWebRequest.ContentType := 'text/xml'; HttpWebRequest.Timeout := 120000; //30000 HttpWebRequest.UseDefaultCredentials(FALSE); XMLDocDotNet := XMLDocDotNet.XmlDocument; XMLDoc.save('C:\XML\convert\XXX.xml'); XMLDocDotNet.Load('C:\XML\convert\XXX.xml'); ByteArray := Encoding.UTF8.GetBytes(XMLDocDotNet.OuterXml); HttpWebRequest.ContentLength := ByteArray.Length; TryCreateRequestStream(HttpWebRequest,RequestStream); RequestStream.Write(ByteArray,0,ByteArray.Length); TryGetWebResponse(HttpWebRequest,HttpWebResponse); StatusCode := HttpWebResponse.StatusCode; StatusDescription := HttpWebResponse.StatusDescription; ResponseText := ReadHttpResponseAsText(HttpWebResponse);
Does anyone see where can the development crash?
Any help will be really appreciatd, I'm quite stucked with this.
Thank you all!
0
Answers
-
I have executed with the debugger, and I also see:
"Cannot serialize the object"0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions