Search Results

Search found 4626 results on 186 pages for 'wcf serialization'.

Page 144/186 | < Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >

  • Variable sized packet structs with vectors

    - by Rev316
    Lately I've been diving into network programming, and I'm having some difficulty constructing a packet with a variable "data" property. Several prior questions have helped tremendously, but I'm still lacking some implementation details. I'm trying to avoid using variable sized arrays, and just use a vector. But I can't get it to be transmitted correctly, and I believe it's somewhere during serialization. Now for some code. Packet Header class Packet { public: void* Serialize(); bool Deserialize(void *message); unsigned int sender_id; unsigned int sequence_number; std::vector<char> data; }; Packet ImpL typedef struct { unsigned int sender_id; unsigned int sequence_number; std::vector<char> data; } Packet; void* Packet::Serialize(int size) { Packet* p = (Packet *) malloc(8 + 30); p->sender_id = htonl(this->sender_id); p->sequence_number = htonl(this->sequence_number); p->data.assign(size,'&'); //just for testing purposes } bool Packet::Deserialize(void *message) { Packet *s = (Packet*)message; this->sender_id = ntohl(s->sender_id); this->sequence_number = ntohl(s->sequence_number); this->data = s->data; } During execution, I simply create a packet, assign it's members, and send/receive accordingly. The above methods are only responsible for serialization. Unfortunately, the data never gets transferred. Couple of things to point out here. I'm guessing the malloc is wrong, but I'm not sure how else to compute it (i.e. what other value it would be). Other than that, I'm unsure of the proper way to use a vector in this fashion, and would love for someone to show me how (code examples please!) :) Edit: I've awarded the question to the most comprehensive answer regarding the implementation with a vector data property. Appreciate all the responses!

    Read the article

  • Boost singletons

    - by Ockonal
    Hi guys, at this page: http://torjo.com/tobias/index.html#boost_utility_singleton._usage I saw that boost has singleton class which gets second param: recreate instance if it's deleted (when we call the singleton). I can't find the implementation of this singleton in boost library. There is only singletons from serialization and pool. What's wrong?

    Read the article

  • retrieving information from web service calls

    - by Monte Chan
    Hi all, I am trying to retrieve information from a web service call. The following is what I have so far. In my text view, it is showing Map {item=anyType{key=TestKey; value=2;}; item=anyType{key=TestField; value=adsfasd; };} When I ran that in the debugger, I can see the information above in the variable, tempvar. But the question is, how do I retrieve the information (i.e. the actual values of "key" and "value" in each of the array positions)? Yes, I know there is a lot going on in onCreate and I will fix it later. Thanks in advance, Monte My codes are as follows, import java.util.Vector; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.AndroidHttpTransport; public class ViewHitUpActivity extends Activity { private static final String SOAP_ACTION = "test_function"; private static final String METHOD_NAME = "test_function"; private static final String NAMESPACE = "http://www.monteandjanicechan.com/"; private static final String URL = "http://www.monteandjanicechan.com/ws/test_ws.cfc?wsdl"; // private Object resultRequestSOAP = null; private TextView tv; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); tv = (TextView)findViewById(R.id.people_view); //SoapObject request.addProperty("test_item", "1"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); /* resultRequestSOAP = envelope.getResponse(); Vector tempResult = (Vector) resultRequestSOAP("test_functionReturn"); */ SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn; Vector tempResult = (Vector) resultsRequestSOAP.getProperty("test_functionReturn"); int testsize = tempResult.size(); // SoapObject test = (SoapObject) tempResult.get(0); //String[] results = (String[]) resultRequestSOAP; Object tempvar = tempResult.elementAt(1); tv.setText(tempvar.toString()); } catch (Exception aE) { aE.printStackTrace (); tv.setText(aE.getClass().getName() + ": " + aE.getMessage()); } } }

    Read the article

  • persist image or video into voldemort

    - by qkrsppopcmpt
    I am working on my web service, and required to persist some image (jpg whatever) and video(wmv) into memmory. Just want to use single_node_cluster to feel voldemort. Can anybody give me a hint of the configuration and sample code of voldemort? I mean how to configure the value type in stores.xml? protobuf? java-serialization? Any sample or link would be helpful. Thanks

    Read the article

  • Print XML file and download it

    - by Pankaj
    I am create xml using serialization and trying to print them using this code string xmlDate = xml.GetXML(); string name = string.Format("{0}_HighEST", ProjectName); Response.AddHeader("Content-disposition", "attachment; filename=\"" + name + "_HighEST.xml\""); Response.ContentType = string.Format("application/.xml", name); how can assign my xmldata to Response so that data will write on downloaded xml?

    Read the article

  • How do i make formatted json in C#.NET

    - by acidzombie24
    I am using .NET json parser and i would like to serialize my config file so it is readable instead of {"blah":"v", "blah2":"v2"} to something nicer like { "blah":"v", "blah2":"v2" } my code is something like using System.Web.Script.Serialization; var ser = new JavaScriptSerializer(); configSz = ser.Serialize(config); using (var f = (TextWriter)File.CreateText(configFn)) { f.WriteLine(configSz); f.Close(); }

    Read the article

  • Managing dependencies with Hadoop Streaming?

    - by beagleguy
    hi all, had a quick hadoop streaming question.. If I'm using python streaming and I have python packages my mappers/reducers require that aren't installed by default do I need to install those on all the hadoop machines as well or is there some sort of serialization that sends them to the remote machines? thanks!

    Read the article

  • What does "Application Server" in Windows Server 2008 mean?

    - by In Sane
    When seeing the Windows Server 2008 R2 edition comparision by Role, i noticed that there is an entry for Application Server separate from that of IIS. http://www.microsoft.com/windowsserver2008/en/us/r2-compare-roles.aspx What is confusing me is that for Web edition, "Application Server" is not ticked but IIS is ticked. Isnt IIS both the web server and the application server in Windows? And if so, if i take the web edition, can i not host my business components (WCF services)on it because it is not an "Application Server" ?

    Read the article

  • how to write own serializer/deserializer?

    - by joseph
    Hello, I need to save objects - instances of classes - in my app like some filetype. How I can write own serializer/deserializer for it? Or exist some easier way how to save objects to some filetype? Using of io.serialization was commented as not so good solution for "real" app. Why?

    Read the article

  • I need a tutorial for IIS/ASP.Net administration

    - by TheCodeMonk
    My technical support staff is only a little familiar with IIS and that's only as far as install goes. They need to install/update and configure ASP.Net web applications and WCF services that we write. Does anyone know any good tutorials/books/web sites that can help them understand some of the basic concepts of web applications and maintaining them on IIS?

    Read the article

  • Deep clone utility recomendation

    - by Supowski
    Is there any utility for deep cloning for java collections: Arrays Lists Maps NOTE: prefer some solution without usage of serialization, but with use of Object.clone() method. I can be sure that my custom object will implement clone() method and will use only java-standard classes that are cloneable...

    Read the article

  • C# ISerializable question

    - by 5YrsLaterDBA
    I am planning to use serialization to do clone. I have to make my class ISerializable. But how about its super classes and all referenced variable classes? do I need to make them all ISerializable? If I use ISerializable. I have to implement the GetObjectData(), what I should put inside that method? leave it empty is ok?

    Read the article

  • Java Serializable Object to Byte Array

    - by ikurtz
    (im new to java) from my searches for Serialization in Java most of the examples document writing to a file or reading from one. my question is lets say i have a serializable class AppMessage. I would like to transmit it as byte[] over sockets to another machine where it is rebuilt from bytes received. how could i achieve this please? thanks for your insight in advance.

    Read the article

  • What is the easiest to transfer an object between two C# apps over the web?

    - by edude05
    I have written an application that basically gathers up a bunch of text and numerical data from the client PC and stores it as an object. Right now I'm implementing XML serialization so that the file can be saved. The issue is now, how do I get this data to the server? I have a server running IIS 7 setup but I don't quite understand the ASP.net life cycle, so I'm not sure how to implement the receiving app. What should I do? Thanks

    Read the article

  • JavaScript/JSON Serializer

    - by Water Cooler v2
    I see that a JSON serializer is present in the System.Web.Script.Serialization namespace, and is shipped in the System.Web.Extensions.dll assembly. Is this assembly distributed with the .NET framework v4.0 redistributable? Is it also guaranteed to be present on a user's machine if any edition of Visual Studio 2010 is installed?

    Read the article

  • File upload-download in its actual format.

    - by ras
    hi, I've to make a code to upload/download a file on remote machine. But when i upload the file new line is not saved as well as it automatically inserts some binary characters. Also I'm not able to save the file in its actual format, I've to save it as "filename.ser". I'm using serialization-deserialization concept of java. Thanks in advance.

    Read the article

  • Wicket @SpringBean doesn't create serializable proxy

    - by vinga
    @SpringBean PDLocalizerLogic loc; When using above I receive java.io.NotSerializableException. This is because loc is not serializable, but this shouldn't be problem because spring beans are a serializable proxies. On the page https://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach is written: Using annotation-based approach, you should not worry about serialization/deserialization of the injected dependencies as this is handled automatically, the dependencies are represented by serializable proxies What am I doing wrong?

    Read the article

  • how to get json string value?

    - by Net205
    var responseFromServer = "{\"flag\":true,\"message\":\"\",\"result\":{\"ServicePermission\":true,\"UserGroupPermission\":true}}"; var serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); var responseValue = serializer.DeserializeObject(responseFromServer); responseFromServer value is get a webservice, and then how to get the json string value, such as "flag","Servicepermission"??

    Read the article

  • GWT + XML documents with namespaces

    - by chris_l
    I'd like to get a quick overview of available solutions (libraries, ...) that allow me to work with XML documents with namespaces on a DOM level - in GWT's client side. Additionally, I'm looking for an XPath solution that can work on that DOM (even if it requires writing my own XPath Navigator). XML parsing and serialization isn't necessary on the client - this can be done on the server.

    Read the article

  • How to tell Ruby not to serialize an attribute or how to overload marshal_dump properly?

    - by GregMoreno
    I have an attribute in my AR:B that is not serializeable. o = Discussion.find(6) Marshal.dump(o) TypeError: no marshal_dump is defined for class Proc from (irb):10:in `dump' I know the culprit and what I want is to set this variable to nil before any serialization takes place. I can do this but I'm stuck with the proper way to override marshal_dump def marshal_dump @problem = nil # what is the right return here? end Or is there is way to tell Ruby or AR not to serialize an object?

    Read the article

< Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >