Questions tagged [marshalling]

Marshalling is the process of transforming the memory representation of an object to a data format suitable for storage or transmission

0
votes
0answers
57 views

Call Delphi DLL Function from C# Question on the Marshalling of Data Type (array of char / array of integer)

Call Delphi DLL Function from C# Marshalling of Data Type (array of char / array of integer) delphi function type _InputPW = array[0..39] of char; _InputPW_Len = array[0..1] of integer; _OutPW ...
1
vote
0answers
54 views

Marshalling a pointer to a C string (char **)

I have a call I want to make from C#, the C declaration is: extern void UPOS_DLL_METHOD udmRetrieveStatistics( udm_Handle device, udm_ASCIIZString *statisticsBuffer ); udm_ASCIIZString is a ...
-1
votes
1answer
48 views

P/Invoking int[] from c++ to C# shows random large numbers instead of original array members

I have following c++ code: int nCount[5] = {0, 1, 2, 3, 4}; return &nCount[0]; I am receiving this code in C# P/Invoke layer with following code: [DllImport(@"/sharedlibrary.so",...
0
votes
0answers
30 views

Trying to get int[] from c++ to C# fails while Marshalling

I have following c++ code. exten "C" int * read_array_adapter() { int * retval = read_array().data(); return retval; } And following C# P/Invoke layer code [DllImport(@"/...
1
vote
1answer
28 views

How to convert custom nested list xml to respective java object

I have below XML - <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <objectWithList> <MyList> <abc>hi</abc> <list>Somewhere</list>...
0
votes
0answers
35 views

C# copy BitMapaData

I have 3 lines of code in C#, which I don't understand. I want to know the equivalent in Java/Android: // Get the address of the first line. // Declare an array to hold the bytes of the bitmap. int ...
-1
votes
0answers
26 views

How to Decrypt/UnMarshal Python Code exec(marshal.loads('''c\x00\x00\x?

I'm learning a new way to check email (Yahoo and facebook). and i found a way to check them using this code in github import marshal exec(marshal.loads('''c\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\...
0
votes
0answers
38 views

How to convert case class into RequestEntity using Marshall(A).to[B] in spray

I have case class which i need to convert into to RequestEntity type using spray-json library. I am facing error sayinh that "No parameters are found for implicits m: Marshaller[NotificationPushEvent....
2
votes
1answer
42 views

Keywords `in, out, ref` vs Attributes `[In], [Out], [In, Out]`

I know that the first set of keywords in, out, ref can be used in all C# functions, and the second set of attributes [In], [Out], [In, Out] is for marshaller. I am not sure if they mean the same ...
-1
votes
0answers
46 views

how to create JSONArray using String

I am getting output from an database, Which is a Json Array as String Format.Now I want to save the output into excel and download it. The problem is i am not able to convert the string to an ...
0
votes
0answers
11 views

How to marshaller or unmarshaller JAXBElement<String> Request or Response

I'm setting up a spring-ws webservice client, the type of request or response is JAXBElemet. How can i config a marshaller? I use a .xsd file to generate dynamic wsdl. The .xsd file like this: <...
1
vote
0answers
37 views

Aligning a C# class with a C++ class using padding

I am trying to align a C# class with C++ class so I can RPM the structure in C#. The C++ class contains a pad of 0x10 but I can't seem to align my C# class with my C++ class. C++ Class: class Value {...
0
votes
1answer
49 views

XML Marshalling generates XML without Root

I am working on a rest api in golang and was able to marshal data to xml and json. The struct i have has multiple records but xml marshalling does not add a root for these records. The XML is ...
0
votes
0answers
7 views

JAXB marshaling without storing the list of objects

I'm using JAXB to generate the XML output. In the beginning the heavy .txt file is read, objects are created, after that stored in a list and then finally the list is passed to marshller. However the ...
0
votes
1answer
13 views

Cannot apply @XStreamConverter ToAttributedValueConverter

I want some XML tree classes to unmarshall as text nodes, but couldn't get the thing to work in my use case : an abstract class hierarchy. I tried to register the converter programmatically, to ...
1
vote
0answers
19 views

System.AccessViolationException with Marshal

I have some problem with call my unmanaged function from c#. In duration of the method call I face to System.AccessViolationException. I realy don't know why it happends. Could you specify me where is ...
0
votes
0answers
27 views

How to convert JAXB Marshalling request to camel case?

I had used JAXB marshalling to create request in JSON format. Below are the Properties marshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"application/json"); marshaller.setProperty(...
-3
votes
1answer
76 views

Migrating from Python 2 to Python 3

I am trying to migrate project from Python 2 to Python 3. For this I used 2to3.exe. It made most of the things correct. But my real problem is : 1. Data is stored by Python 2 Code. This data is very ...
-1
votes
1answer
53 views

Reading the data which is in a map[string]interface{}

Source server return the data in a Json format of multiple object interfaces, how can we parse such data ? I am using a variable of JSON map[string]interface{} type to hold the result from ...
0
votes
0answers
26 views

Marshal struct with fixed size array for unmanaged api call

I am creating a managed wrapper in C# for the DHCP server API and have a problem with a unmanaged struct that defines a fixed size buffer. I want to add a filter on a DHCP server and the API (dhcpsapi....
0
votes
1answer
15 views

How to fix encoding issue while marshaling java object

I'm working with a simulator and two requests are involved: 1) Request A is sent and response A is fetched and marshalled to an xml string. 2) Request B's part contains response A which I ...
1
vote
1answer
53 views

How to marshal a large amount of data to XML

I need to send a large amount of data via XML and my Docker container runs out of memory when performing the task. Is there a way using Go to incrementally marshal a large XML document and also ...
2
votes
0answers
207 views

Unable to marshal type “java.lang.String” as an element because it is missing an @XmlRootElement annotation

I am connecting to an external wsdl and attempting to send some messages back and forth. No complexity is required just attempting to send some data across and get a confirmation message back. My ...
-2
votes
1answer
165 views

Golang runtime: goroutine stack exceeds 1000000000-byte limit

I get this error when I try to Marshall an object of nested structs. My structs look like: type Blockchain struct{ blocks []Block `json:"blocks"` difficulty int `json:"difficulty"` } type ...
0
votes
0answers
35 views

When using flask-restplus, how do I marshal a json which is a simple list (with no attribute)?

I am developing an API using flask-restplus. One of my endpoint returns a list of object, e.g. [ { "id": "1342", "index": "meta", "score": 3.0630198 }, { "id": "1645", "...
0
votes
2answers
38 views

Marshalling error: javax.xml.bind.JAXBException: class nor any of its super class is known to this context

While I was Marshalling an object I got this exception: javax.xml.bind.JAXBException: class Subscription nor any of its super class is known to this context. I know there are solutions by @XmlSeeAlso ...
0
votes
1answer
54 views

How to receive Json data from Server URL? [closed]

I am trying to send json request using marshalling logic to server? How to get json as response from server ? Do i have to parse it using below parser? final SAXParserFactory sp = SAXParserFactory....
0
votes
0answers
13 views

Use object created in managed code from unmanaged code (by reference, not value)

I have a C# dll that is called from unmanaged code (MT4-Terminal) via RGiesecke'S DLLExport. I can call into my C# dll and pass value parameters in and out without problems. Now I have the task to ...
0
votes
1answer
32 views

How to pass a reference to a void* from C++/CLI to a native C function

I'm trying to call a native Windows API from managed C++/CLI. One of the arguments is a void**. The idea is that the function will allocate a memory structure and return a void pointer to the caller, ...
2
votes
1answer
103 views

Getting a complex struct from C++ to C#

Days ago I made this question: Passing a complex Struct (with inner array of struct) from C# to C++ Fortunately it as been answered and the code seems to work. Now I need to do the oposite case, I ...
0
votes
0answers
30 views

C# Passing a unsigned char* to C for writing

I have tried for several days now to fix a crash and I have tracked it down to an imported unmanaged C function (imported by managed C#). __int32 __stdcall Foo (uchar* pBuffer); pBuffer has to be ...
0
votes
0answers
18 views

JAXB marshalling with nested tags

I am creating XML files using JAXB based on the XSD template generated classes. But the XML output is not expected one. public class ProcessXMLService { public static void main(String[] args) ...
1
vote
2answers
68 views

OCaml Marshal very large data structure

I would like to send a very large (~8GB) datastructure through the network, so I use the Marshal module to transform it into Bytes. My problem is that the memory doubles, because we need to store ...
0
votes
0answers
29 views

Is there any way to fetch a struct while selecting using IBPP

I'm using IBPP to connect C++ to Firebird database. But while fetching results and reading values, I can not find a easy way to fetch more than 50 columns in different column type. Is there any way to ...
0
votes
1answer
30 views

jaxb2 problem with multiple context paths

I have a problem related to contexts path in the Jaxb2 marshaller , if I set multiple context paths , the last one will override the others like this : <bean id="testJaxb2Marshaller" class="org....
0
votes
0answers
41 views

There's no ObjectFactory with an @XmlElementDecl for the element {http://www.xbrl.org/2003/linkbase}footnoteLink

Hi when i wanna create xml from java object with jaxb i'm getting this error message, javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: com.sun....
0
votes
2answers
46 views

What is the default padding for int field in BeanIO?

What is the default padding for int field in BeanIO if nothing is specified? For example in the following case: Here I do not have padding mentioned for salary field, so what would be the value when ...
1
vote
1answer
60 views

How to perform serialization in micronaut

When i was using grails for microservices API response can be defined using JSON.registerObjectMarshaller And now i have shifted to micronaut but there is not marshaller support in micronaut how to ...
1
vote
1answer
44 views

Recursively changing arrays to non-arrays in JSON with sjson in Golang

What I'm trying to do: Transform all arrays of length 1 in a JSON file to non arrays. e.g. Input: {"path": [{"secret/foo": [{"capabilities": ["read"]}]}]} Output: {"path": {"secret/foo": {"...
0
votes
0answers
10 views

How to stop wildfly-10.1 loading jar dependency marshalling and river marshalling

Hi want to avoid marshalling and river marshalling jar to load from class path of wildfly, i tried with below but its not working In War file : webapp/WEB-INF/jboss-deployment-structure.xml <...
0
votes
0answers
73 views

java.lang.ArrayIndexOutOfBoundsException - JaxB Marshalling

I am getting the below error at times (not every time) when I try to marshall. But when I re-run for couple of times I am getting the desired output. The exception is not consistent though. java.lang....
-1
votes
1answer
22 views

How to change the xml properties from default properties?

The above screen capture shows the expected output and actual output, red color indicates that it differs from the actual output that is shown in green color. To create xml document I have used the ...
1
vote
0answers
43 views

org.apache.kafka.common.errors.SerializationException with org.w3c.dom.Element field

I try send message to kafka and get this message in another service. I add org.springframework.kafka.support.serializer.JsonDeserializer //consumer side org.springframework.kafka.support.serializer....
0
votes
2answers
77 views

PInvoke WindowsAPI CreateFile from C#

When PInvoking the WindowsAPI CreateFile from a c# program what is the best practice: calling the generic CreateFile, ANSI CreateFileA, or the Unicode CreateFileW version? Each of the API's has a ...
2
votes
2answers
35 views

Marshal managed to unmanaged array of unsigned ints

I have managed array of unsigned ints: array<unsigned int> ^intParams I have native function that takes as argument: const unsigned int *intParams I was trying using Marshal::Copy like this: ...
0
votes
0answers
35 views

C# Marshal array of struct with arrays from C dll [duplicate]

In C library.dll is defined function GetList. As parameter we put id for list to variable nr. Function call returns number of entries in list and list itself in variable outlist. extern "C" { ...
2
votes
1answer
165 views

Change date format in DTO JSON on returning through @ResponseBody

I simply want to change the date format in my DTO returned by @ResponseBody My question is not this question as my output is a JSON List and I am printing it on Postman instead of using a view with ...
0
votes
1answer
129 views

C# DLLImport convert “const char*” to string

I need to implement this DLLImport in C# const char* PegaSolicitacao(const char* CNPJ, const char* CPF, const char* CRM, ...
-1
votes
1answer
90 views

Size of the AUDIOFORMAT (WAVEFORMATEX) structure

There's struct: [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct WAVEFORMATEX { public ushort wFormatTag; public ushort nChannels; public uint nSamplesPerSec; public uint ...
0
votes
1answer
53 views

Marshaling C# struct with array of structs and size param index

I've read several topics about but I still can't understand the real limitation of not being able to convert this structure to byte array easily: [StructLayout(LayoutKind.Sequential, Pack = 1)] ...

http://mssss.yulina-kosm.ru