Search Results

Search found 31717 results on 1269 pages for 'response write'.

Page 23/1269 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • cURL gets response with utf-8 BOM

    - by Reshat Belyalov
    In my script I send data with cURL, and enabled CURLOPT_RETURNTRANSFER. The response is json encoded data. When I'm trying to json_decode, it returns null. Then I found that response contains utf-8 BOM symbols at the beginning of string (). There is some experiments: $data = $data = curl_exec($ch); echo $data; the result is {"field_1":"text_1","field_2":"text_2","field_3":"text_3"} $data = $data = curl_exec($ch); echo mb_detect_encoding($data); result - UTF-8 $data = $data = curl_exec($ch); echo mb_convert_encoding($data, 'UTF-8', mb_detect_encoding($data)); // identical to echo mb_convert_encoding($data, 'UTF-8', 'UTF-8'); result - {"field_1":"text_1","field_2":"text_2","field_3":"text_3"} The one thing that helps is removing first 3 symbols: if (substr($data, 0, 3) == pack('CCC', 239, 187, 191)) { $data = substr($data, 3); } But what if there will be another BOM? So the question is: How to detect right encoding of cURL response? OR how to detect what BOM has arrrived? Or maybe how to convert the response with BOM? Thanks.

    Read the article

  • Axis2 attachments are vanishing in the response

    - by Shamik
    I am using axis2 to come up with a basic web service which will get the file name as parameter and produces a response SOAP packet which will have the file attached along with the SOAP. Here is the way I am creating the service code (its simple and inspired by Axis2 sample code) public String getFile(String name) throws IOException { MessageContext msgCtx = MessageContext.getCurrentMessageContext(); File file = new File (name); System.out.println("File = " + name); System.out.println("File exists = " + file.exists()); FileDataSource fileDataSource = new FileDataSource(file); System.out.println("fileDataSource = " + fileDataSource); DataHandler dataHandler = new DataHandler(fileDataSource); System.out.println("DataHandler = " + dataHandler); String attachmentID = msgCtx.addAttachment(dataHandler); System.out.println("attachment ID = " + attachmentID); return attachmentID; } Now The client side code - MessageContext response = mepClient .getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); SOAPBody body = response.getEnvelope().getBody(); OMElement element = body.getFirstElement().getFirstChildWithName( new QName("http://service.soapwithattachments.sample","return")); String attachementId = element.getText(); System.out.println("attachment id is " + attachementId); Attachments attachment = response.getAttachmentMap(); DataHandler dataHandler = attachment.getDataHandler(attachementId); Problem is that dataHandler is always null. Though I think at the server side, the file was read and attached along with the SOAP packet. Am I doing something wrong ? EDIT : I have put <parameter name="enableSwA" locked="false">true</parameter> in the axis2.xml file.

    Read the article

  • Flash (AS3) can't read response ...

    - by Quandary
    Question: I call an asp.net handler (ashx) like this from Flash, and onLoadSuccessful, I get the ashx response back. The problem now is whatever I do in onLoadSuccessful to get the responseStatus variable never gets me the variable (just an error message: property responseStatus for string not found), but the output of: trace("Response: " + evt.target.data); is Response: &responseStatus=ASP.NET+Fehler%3a+Die+Datei+%22C%3a%5cinetpub%5cwwwroot%5cRaumplaner_New%5cRaumplaner_New%5cabcdef.xml%22+konnte+nicht+gefunden+werden.& It used to work in ActionScript2... Any hints as to what I do wrong ? I mean the request gets sent, and the reponse received, but no matter how I try to do it, I can't access the responseStatus variable... var scriptRequest:URLRequest = new URLRequest(strURL); var scriptLoader:URLLoader = new URLLoader(); var scriptVars:URLVariables = new URLVariables(); scriptLoader.addEventListener(Event.COMPLETE, onLoadSuccessful); scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError); scriptLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError); scriptVars.ScaleString = nScale; scriptVars.ModifyFile = "abcdef.xml"; scriptRequest.method = URLRequestMethod.POST; scriptRequest.data = scriptVars; scriptLoader.load(scriptRequest); function onLoadSuccessful(evt:Event):void { trace("Success."); //ExternalInterface.call("alert", "Die neue Skalierung wurde erfolgreich gespeichert."); //getURL("javascript:alert(\""+"Die neue Skalierung wurde erfolgreich gespeichert.\\nALLE Instanzen des Browsers schliessen und neu starten, damit die Änderung in Kraft tritt."+"\");"); trace("Response: " + evt.target.data); trace("ResponseStatus: " + evt.target.data.responseStatus); var loader:URLLoader = URLLoader(evt.target); trace("responseStatus: " + loader.data.responseStatus); }

    Read the article

  • C# TcpClient, getting back the entire response from a telnet device

    - by Dan Bailiff
    I'm writing a configuration tool for a device that can communicate via telnet. The tool sends a command via TcpClient.GetStream().Write(...), and then checks for the device response via TcpClient.GetStream().ReadByte(). This works fine in unit tests or when I'm stepping through code slowly. If I run the config tool such that it performs multiple commands consecutively, then the behavior of the read is inconsistent. By inconsistent I mean sometimes the data is missing, incomplete or partially garbled. So even though the device performed the operation and responded, my code to check for the response was unreliable. I "fixed" this problem by adding a Thread.Sleep to make sure the read method waits long enough for the device to complete its job and send back the whole response (in this case 1.5 seconds was a safe amount). I feel like this is wrong, blocking everything for a fixed time, and I wonder if there is a better way to get the read method to wait only long enough to get the whole response from the device. private string Read() { if (!tcpClient.Connected) throw (new Exception("Read() failed: Telnet connection not available.")); StringBuilder sb = new StringBuilder(); do { ParseTelnet(ref sb); System.Threading.Thread.Sleep(1500); } while (tcpClient.Available > 0); return sb.ToString(); } private void ParseTelnet(ref StringBuilder sb) { while (tcpClient.Available > 0) { int input = tcpClient.GetStream().ReadByte(); switch (input) { // parse the input // ... do other things in special cases default: sb.Append((char)input); break; } } }

    Read the article

  • cookies handling on webrequest and response

    - by manish patel
    I have created a application that has a function mainpost. It is created to post data on a https sites. Here I want to handle cookies in this function. How can I do this task? public string Mainpost(string website, string content) { // this is what we are sending string post_data = content; // this is where we will send it string uri = website; // create a request HttpWebRequest request = (HttpWebRequest) WebRequest.Create(uri); request.KeepAlive = false; request.ProtocolVersion = HttpVersion.Version10; request.Method = "POST"; // turn our request string into a byte stream byte[] postBytes = Encoding.ASCII.GetBytes(post_data); // this is important - make sure you specify type this way request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = postBytes.Length; Stream requestStream = request.GetRequestStream(); // now send it requestStream.Write(postBytes, 0, postBytes.Length); requestStream.Close(); // grab te response and print it out to the console along with the status // code HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string str = (new StreamReader(response.GetResponseStream()).ReadToEnd()); Console.WriteLine(response.StatusCode); return str; }

    Read the article

  • How to parse a custom XML-style error code response from a website

    - by user1870127
    I'm developing a program that queries and prints out open data from the local transit authority, which is returned in the form of an XML response. Normally, when there are buses scheduled to run in the next few hours (and in other typical situations), the XML response generated by the page is handled correctly by the java.net.URLConnection.getInputStream() function, and I am able to print the individual results afterwards. The problem is when the buses are NOT running, or when some other problem with my queries develops after it is sent to the transit authority's web server. When the authority developed their service, they came up with their own unique error response codes, which are also sent as XMLs. For example, one of these error messages might look like this: <Error xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Code>3005</Code> <Message>Sorry, no stop estimates found for given values.</Message> </Error> (This code and similar is all that I receive from the transit authority in such situations.) However, it appears that URLConnection.getInputStream() and some of its siblings are unable to interpret this custom code as a "valid" response that I can handle and print out as an error message. Instead, they give me a more generic HTTP/1.1 404 Not Found error. This problem cascades into my program which then prints out a java.io.FileNotFoundException error pointing to the offending input stream. My question is therefore two-fold: 1. Is there a way to retrieve, parse, and print a custom XML-formatted error code sent by a web service using the plugins that are available in Java? 2. If the above is not possible, what other tools should I use or develop to handle such custom codes as described?

    Read the article

  • How to handle image/gif type response on client side using GWT

    - by user200340
    Hi all, I have a question about how to handle image/gif type response on client side, any suggestion will be great. There is a service which responds for retrieving image (only one each time at the moment) from database. The code is something like, JDBC Connection Construct MYSQL query. Execute query If has ResultSet, retrieve first one { //save image into Blob image, “img” is the only entity in the image table. image = rs.getBlob("img"); } response.setContentType("image/gif"); //set response type InputStream in = image.getBinaryStream(); //output Blob image to InputStream int bufferSize = 1024; //buffer size byte[] buffer = new byte[bufferSize]; //initial buffer int length =0; //read length data from inputstream and store into buffer while ((length = in.read(buffer)) != -1) { out.write(buffer, 0, length); //write into ServletOutputStream } in.close(); out.flush(); //write out The code on client side .... imgform.setAction(GWT.getModuleBaseURL() + "serviceexample/ImgRetrieve"); .... ClickListener { OnClick, then imgform.submit(); } formHandler { onSubmit, form validation onSubmitComplete ??????? //handle response, and display image **Here is my question, i had tried Image img = new Image(GWT.getHostPageBaseURL() +"serviceexample/ImgRetrieve"); mg.setSize("300", "300"); imgpanel.add(img); but i only got a non-displayed image with 300X300 size.** } So, how should i handle the responde in this case? Thanks,

    Read the article

  • Submit a form and get a JSON response with jQuery

    - by Leopd
    I expect this is easy, but I'm not finding a simple explanation anywhere of how to do this. I have a standard HTML form like this: <form name="new_post" action="process_form.json" method=POST> <label>Title:</label> <input id="post_title" name="post.title" type="text" /><br/> <label>Name:</label><br/> <input id="post_name" name="post.name" type="text" /><br/> <label>Content:</label><br/> <textarea cols="40" id="post_content" name="post.content" rows="20"></textarea> <input id="new_post_submit" type="submit" value="Create" /> </form> I'd like to have javascript (using jQuery) submit the form to the form's action (process_form.json), and receive a JSON response from the server. Then I'll have a javascript function that runs in response to the JSON response, like function form_success(json) { alert('Your form submission worked'); // process json response } How do I wire up the form submit button to call my form_success method when done? Also it should override the browser's own navigation, since I don't want to leave the page. Or should I move the button out of the form to do that?

    Read the article

  • Response Redirect - Open Link in New Window

    - by bacis09
    First, I've taken the time to review this question which seems to be the most similar, however, the solution that seems to have been selected will not work in my scenario.Not to mention I worry about some of the comments claiming it to be brittle or an inadequate solution. http://stackoverflow.com/questions/104601/asp-net-response-redirect-to-new-window -We have an XML document which basically contains all of the information for a Side menu. -We have numerous URLS which are stored in a constants class. -One of the elements in a string of XML (well call it label) is used to determine if the menu item is created as a LinkButton or a Label. -Links use a custom user control that is used standard for all links across the application (why suggestion on similar thread doesn't work - I don't want all links to open in a new window - just one) -One of the elements in a string of XML (well call it function) is used in a Switch statement to generate our links using Response Redirect. It may look something like this. switch (function) { case goto 1: string url; if (user_group == 1) { url = Constants.CONSTANT1 } else { url = Constants.CONSTANT2 } Response.Redirect(url) case goto 2: ...... default: ...... break; } Given this scenario, I'm trying to find the best way to quickly open a New Window, when a specific case in this switch statement is met. Can it be done with Response Redirect (this seems to be arguable - people say no it can't, yet other people say they have made it work)? If not, what alternative can work here?

    Read the article

  • Calling a function from a ajax response content

    - by pistolshrimp
    Hi guys. I have a function when the page is ready. <script> $(function(){ function do_ajax(){ do some stuff } });.... This works great on that page. Then I make a .post call and load the response into a div. The response has a <script>$(selector).click(function(){ do_ajax(); });</script> with the result. I get an error "do_ajax() is undefined". How can I call do_ajax() from an event from the ajax content? Another one. I am using jquery ui datepicker. So, when the page is loaded, I invoke the $(".datepicker").datepicker(); This works great on that page. Then I make a .post call and load the response into a div. The response has a couple of .datepicker fields. The problem is that the newly loaded datepicker fields don't get the calendar unless I return <script>$(".datepicker").datepicker();</script> with the result. Is that how you guys do it or is there another way? Thanks!

    Read the article

  • Java ReentrantReadWriteLocks - how to safely acquire write lock?

    - by Andrzej Doyle
    I am using in my code at the moment a ReentrantReadWriteLock to synchronize access over a tree-like structure. This structure is large, and read by many threads at once with occasional modifications to small parts of it - so it seems to fit the read-write idiom well. I understand that with this particular class, one cannot elevate a read lock to a write lock, so as per the Javadocs one must release the read lock before obtaining the write lock. I've used this pattern successfully in non-reentrant contexts before. What I'm finding however is that I cannot reliably acquire the write lock without blocking forever. Since the read lock is reentrant and I am actually using it as such, the simple code lock.getReadLock().unlock(); lock.getWriteLock().lock() can block if I have acquired the readlock reentrantly. Each call to unlock just reduces the hold count, and the lock is only actually released when the hold count hits zero. EDIT to clarify this, as I don't think I explained it too well initially - I am aware that there is no built-in lock escalation in this class, and that I have to simply release the read lock and obtain the write lock. My problem is/was that regardless of what other threads are doing, calling getReadLock().unlock() may not actually release this thread's hold on the lock if it acquired it reentrantly, in which case the call to getWriteLock().lock() will block forever as this thread still has a hold on the read lock and thus blocks itself. For example, this code snippet will never reach the println statement, even when run singlethreaded with no other threads accessing the lock: final ReadWriteLock lock = new ReentrantReadWriteLock(); lock.getReadLock().lock(); // In real code we would go call other methods that end up calling back and // thus locking again lock.getReadLock().lock(); // Now we do some stuff and realise we need to write so try to escalate the // lock as per the Javadocs and the above description lock.getReadLock().unlock(); // Does not actually release the lock lock.getWriteLock().lock(); // Blocks as some thread (this one!) holds read lock System.out.println("Will never get here"); So I ask, is there a nice idiom to handle this situation? Specifically, when a thread that holds a read lock (possibly reentrantly) discovers that it needs to do some writing, and thus wants to "suspend" its own read lock in order to pick up the write lock (blocking as required on other threads to release their holds on the read lock), and then "pick up" its hold on the read lock in the same state afterwards? Since this ReadWriteLock implementation was specifically designed to be reentrant, surely there is some sensible way to elevate a read lock to a write lock when the locks may be acquired reentrantly? This is the critical part that means the naive approach does not work.

    Read the article

  • how to write contents in a word doc or pdf in c#

    - by Arunachalam
    how to write contents in a word doc or pdf in c# like if i want to write some daily reports generated into word doc or pdf ..in unix we can just pipe the out put to text file can we do that in c# .i know that using string builder we can write the contents to text files can we write the contents to a doc or pdf format ?

    Read the article

  • Python f.write() at beginning of file?

    - by kristus
    I'm doing it like this now, but i want it to write at the beginning of the file instead. f = open('out.txt', 'a') # or 'w'? f.write("string 1") f.write("string 2") f.write("string 3") f.close() so that the contenst of out.txt will be: string 3 string 2 string 1 and not (like this code does): string 1 string 2 string 3

    Read the article

  • Write failed, errno 0

    - by EpsilonVector
    I have a client server situation in which I receive data using read(socket, char_buf, BUF_SIZE) and then try to write it into a log file using write(filefd, char_buf, strlen(char_buf)) Strangely enough this fails (write returns -1), and yet the errno is set to 0, and I can print the message, AND the log file descriptor works (I write to it before and after this command). What's going on?? (Working on Linux kernel 2.4 (homework))

    Read the article

  • Using 3rd Party JavaScript Plugins Hardwired With &lsquo;document.write&rsquo;

    - by ToStringTheory
    Introduction Have you ever had the need to implement a 3rd party JavaScript plugin, but your needs didn’t fit the model and usage defined by the API or documentation of the plugin?  Recently I ran into this issue when I was trying to implement a web snapshot plugin into our site.  To use their plugin, you had to include a script tag to the plugin on their server with an API key.  The second part of the usage was to include a <script> tag around a function call wherever you wanted a snapshot to appear. The Problem When trying to use the service, the images did not display.  I checked a couple of things and didn’t find anything wrong at first..  It wasn’t until I looked at the function that was called by the inline script did I find the issue – a call to the webservice, followed by a call to ‘document.write’ in its callback.  The solution in which I was trying to implement the plugin happened to be in response to an AJAX call after the document had completely loaded.  After the page has loaded, document.write does nothing. My first thought for a solution was to just cache the script from the service, and edit it do something like a return function or callback that I could use to edit the document from.  However, I quickly discovered that there is no way to cache the script from the service, as it had a hash in the function where it would call the server.  The hash was updated every few seconds/minutes, expiring old hashes.  This meant that I wouldn’t be able to edit the script and upload a new version to my server, as the script would not work after a few minutes from originally getting the script from the service. Solution The solution eluded me until I realized that this was JavaScript I was dealing with.  A language designed so that you could do just about anything to any library, function, or object…  At this point, the solution was simple – take control of the document.write function.  Using a buffer variable, and a simple function call, it is eerily simple to perform: //what would have been output to the document var buffer = ""; //store a reference to the real document.write var dw = document.write; //redefine document.write to store to our buffer document.write = function (str) {buffer += str;} //execute the function containing calls to document.write eval('{function encapsulated in <script></script> tags}'); //restore the original document.write function (just in case) document.write = dw; That’s it.  Instead of using the script tags where I wanted to include a snapshot, I called a function passing in the URL to the page I wanted a snapshot of.  After that last line of code, what would have been output to the document (or not in the case of the ajax call) was instead stored in buffer. Conclusion While the solution itself is simple, coming from a background much more footed in the .Net platform, I believe that this is a prime example of always keeping the language that you are working in in mind.  While this may seem obvious at first, as I KNEW I was in JavaScript, I never thought of taking control of the document.write function because I am more accustomed to the .Net world.  I can’t simply replace the functionality of Console.WriteLine.

    Read the article

  • Make my git user and apache user have read/write/delete access

    - by Mr A
    I am having permission problems on my server. I use user developer to pull my git repository on the server. Then apache uses its own apache user to do write and execute code. I always have the problems when the app wants to write something in the directory (i.e: log files, and cache ...) if I execute a cron job and it uses my developer rights and wants to add something to the folders that is written by apache. My question is how to have my developer have the same write/delete access as my apache and avoid permission conflicts with each other? I am not fluent on linux command so, it would help if you could provide links or simply examples of doing so. thanks.

    Read the article

  • SELinux "allow httpd_t httpd_sys_content_t:dir write;"

    - by alexus
    I'm getting following message in my /var/log/audit/audit.log: type=AVC msg=audit(1402615093.053:68): avc: denied { write } for pid=799 comm="httpd" name="php" dev="xvda1" ino=8667365 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=dir type=SYSCALL msg=audit(1402615093.053:68): arch=c000003e syscall=2 success=no exit=-13 a0=7f7a5ca697a8 a1=241 a2=1b6 a3=1 items=0 ppid=662 pid=799 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null) pipe audit2allow outputs: #============= httpd_t ============== #!!!! This avc can be allowed using the boolean 'httpd_unified' allow httpd_t httpd_sys_content_t:dir write; How do I apply allow httpd_t httpd_sys_content_t:dir write; to my current SELinux policy?

    Read the article

  • Simultaneous read/write to RAID array slows server to a crawl

    - by Jeff Leyser
    Fairly beefy NFS/SMB server (32GB RAM, 2 Xeon quad cores) with LSI MegaRAID 8888ELP controlling 12 drives configured into 3 different arrays. 5 2TB drives are grouped into a RAID 6 array. As expected, write performance to the array is slow. However, sustained, simultaneous read/write to the array (wether through NFS or done locally) seems to practically block any other access to anything else on the controller. For example, if I do: cp /home/joe/BigFile /home/joe/BigFileCopy where BigFile is 20G, then even a simple ls /home/jane will take many 10s of seconds to complete. In addition, an ls /backup will also take many tens of seconds, even though /backup is a different array on the same controller. As soon as the cp is done, everything is back to normal. cp /home/joe/BigFile /backup/BigFile does not exhibit this behavior. It's only when doing read/write to the same array.

    Read the article

  • Fedora12 Slow USB 2.0 Write Speed, ehci_hcd module is missing

    - by MA1
    I am using Fedora 12, the problem I am facing is USB 2.0 write speed. I have a dual boot system with Windows XP and Fedora 12. USB 2.0 write speed in Windows XP is much faster then what I am getting in Fedora 12. After searching Google I came to know that ehci_hcd module is missing/not present in my system. ehci_hcd module is neither loaded nor it is present in the available list of modules. Can someone guide me how to fix this issue? Does ehci_hcd have something to do with USB 2.0 write speed? Do I have to recompile the kernel and add/enable the ehci_hcd module?

    Read the article

  • windows 2000 freezing during large disk write

    - by robert
    We have a windows 2000 sp4 server which freezes up for about 1 minutes while its web-app does a ~500mb write operation. I can see the webapp start to do I/O activity (through process explorer) then the RDP session becomes unresponsive, you can click on windows and buttons but nothing happens. When the disk write finally finishes the session 'catches up' on all the mouse clicks you did during the freeze in a mad flurry of window activity and the server returns to normal. During the freeze the web-app stops as well. The same behaviour happens on the console of the server. (so I know its not a network thing) Nothing appears in the Event logs. Its like nothing happened. I have upgraded all the HP hardware drivers to the latest proliant support pack. And also run a HP hardware diagnostics which found nothing wrong. What would cause a disk write to lock the rest of the OS?

    Read the article

  • No write access on Windows 2008 workgroup share

    - by Serge - appTranslator
    Hi All, I'm trying to access network shares on my new Windows 2008 server (workgroup) using my server's local admin account. I can read files but not modify them. Permissions (sharing + file system) say: Users = Read only. Admins = Full Control. Even though I connect using my admin account (net use x: \\server\share /user:server\me), I can't write. OTOH, I have another share on the same computer where users have Read AND Write. I can write into that one. What's the problem? Does it have to do with UAC? TIA for your help.

    Read the article

  • Setup SVN repository subfolder specific write permission

    - by Hai Lang
    I need to setup a SVN repository which the devgroup should have full privilege to read and write except for two sub folders /1 and /2. For /1 and /2, four users should have write permission and all other users should only have read permission. I put the following into the configuration file, but people in devgroup still have write permission in /1 and /2. Any help would be highly appreciated. [project:/] @devgroup = rw [project:/1] @devgroup = r user1 = rw user2 = rw user3 = rw user4 = rw [project:/2] @devgroup = r user1 = rw user2 = rw user3 = rw user4 = rw

    Read the article

  • ASP.NET MVC: shortcut for Response.Write and String.Format

    - by pcampbell
    I've found a pattern in my Views like this: <% if (someCondition) { Response.Write(string.Format("Hello {0}, Visitor {1} on {2}.", userName, someCounter, someDate)); } else { Response.Write(string.Format("Foo is {0}.", bar)); } %> The question here is around DRY and Response.Write(string.Format()). Are there better, or more concise ways to . Consider that HTML encoding would be a nice feature to include, perhaps as a boolean to a method call of some kind (extension method on Html?. Is there an obvious extension method that I'm missing? Do you have an extension method that you rely on to achieve this functionality?

    Read the article

  • IOException reading from HttpWebResponse response stream over SSL

    - by Lawrence Johnston
    I get the following exception when attempting to read the response from my HttpWebRequest: System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream. at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.StreamReader.ReadBuffer() at System.IO.StreamReader.ReadToEnd() ... My code functions without issue when using http. I am talking to a third-party device; I do not have access to the server code. My code is as follows: private string MakeRequest() { // Disable SSL certificate verification per // http://www.thejoyofcode.com/WCF_Could_not_establish_trust_relationship_for_the_SSL_TLS_secure_channel_with_authority.aspx ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; }); Uri uri = new Uri("https://mydevice/mypath"); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); request.Method = WebRequestMethods.Http.Get; using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using (Stream responseStream = response.GetResponseStream()) { using (StreamReader sr = new StreamReader(responseStream.)) { return sr.ReadToEnd(); } } } } Does anybody have any thoughts about what might be causing it?

    Read the article

  • Call a web service and parse xml response in blackberry

    - by Nirmal
    Hello All... Currently I have a ready design for blackberry application. Now, I need to call the web service in my app, and that web service will give me some xml response. So, I need to parse that response from xml to some POJO. So, for parsing the xml response should I go with the basic DOM praser, or should I use any other J2ME specific prasing concept ? If anybody have any sample tutorial link for the same then it would be very much useful to me. Thanks in advance....

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >