marshalling

Jaxb XSD validationevent isn't working after migration to WebLogic12

一世执手 提交于 2021-02-20 04:53:25
问题 I am trying to validate Jaxb objects against an xsd by marshalling them. This was working fine in weblogic11 but after migration to weblogic12c it isn't working. For example, even if the mandatory tags are missing, there is no error and xml is being formed successfully! I noticed event.getLinkedException() is returning null. ValidateXml.java import java.io.File; import java.io.StringWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;

Get type of binary on filesystem via C# running in 64 bit

和自甴很熟 提交于 2021-02-20 03:49:37
问题 I have a C# application, compiled in Visual Studio 2017 on the 'Any CPU' target, with the 'Prefer 32-bit' option disabled. In this application, I am trying to pinvoke kernel32!GetBinaryType(). When running with 'Prefer 32-bit' enabled, it works fine. When running in either 32 or 64-bit mode from a C++ executable, it works fine. I am not sure what I am doing wrong with the 64-bit C# application. This is my pinvoke signature: [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError =

Get type of binary on filesystem via C# running in 64 bit

拈花ヽ惹草 提交于 2021-02-20 03:47:04
问题 I have a C# application, compiled in Visual Studio 2017 on the 'Any CPU' target, with the 'Prefer 32-bit' option disabled. In this application, I am trying to pinvoke kernel32!GetBinaryType(). When running with 'Prefer 32-bit' enabled, it works fine. When running in either 32 or 64-bit mode from a C++ executable, it works fine. I am not sure what I am doing wrong with the 64-bit C# application. This is my pinvoke signature: [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError =

Setting CharacterEscapeHandler variable on a Marshaller doesn't work as expected in CXF

强颜欢笑 提交于 2021-02-19 04:16:00
问题 I'm using Apache CXF to implement some WebServices at server side. I have to implement a WebService that returns a string (Holder) with some values separated by tab character. Apache CXF encodes character tab as a tab, but our client (that can not be change...) doesn't accept it and only read tabs encoded as . So I tried to simply make a replaceAll on the string to change \t for , but an escapeHandler on Marshaller changes it to 	 . Then I tried to create a customCharacterEscapeHandler

Setting CharacterEscapeHandler variable on a Marshaller doesn't work as expected in CXF

两盒软妹~` 提交于 2021-02-19 04:14:38
问题 I'm using Apache CXF to implement some WebServices at server side. I have to implement a WebService that returns a string (Holder) with some values separated by tab character. Apache CXF encodes character tab as a tab, but our client (that can not be change...) doesn't accept it and only read tabs encoded as . So I tried to simply make a replaceAll on the string to change \t for , but an escapeHandler on Marshaller changes it to 	 . Then I tried to create a customCharacterEscapeHandler

Passing pointer to pointer of array of structure from C# to C++

五迷三道 提交于 2021-02-17 00:01:12
问题 I want to pass pointer to pointer of an array of structure from C# to C++. With following code I only get the first element in c++, second and third element of the array is not passed. Why? Also, tried using StructureToPtr but didn't help. What I am doing wrong? C++ code struct structure { short ps; }; __declspec(dllexport)short Testmethod(structure** aa) { if (aa!= 0 && aa[0]->ps == 26 && aa[1]->ps == 27) { return 1; } return 0; } C# code [DllImport("Wrapper.dll", CallingConvention =

Passing pointer to pointer of array of structure from C# to C++

ε祈祈猫儿з 提交于 2021-02-17 00:00:16
问题 I want to pass pointer to pointer of an array of structure from C# to C++. With following code I only get the first element in c++, second and third element of the array is not passed. Why? Also, tried using StructureToPtr but didn't help. What I am doing wrong? C++ code struct structure { short ps; }; __declspec(dllexport)short Testmethod(structure** aa) { if (aa!= 0 && aa[0]->ps == 26 && aa[1]->ps == 27) { return 1; } return 0; } C# code [DllImport("Wrapper.dll", CallingConvention =

Passing byte array to PInvoke call changes it to null

夙愿已清 提交于 2021-02-11 17:46:15
问题 After migration from Visual Studio 2012 to 2013 some PInvoke calls not working as previously. For example, I'm struggling with this code: Signature: [DllImport(LzoDll64Bit)] private static extern int lzo1x_decompress(byte[] src, int src_len, byte[] dst, ref int dst_len, byte[] wrkmem); Usage: byte[] dst = new byte[origlen]; int outlen = origlen; if (Is64Bit()) lzo1x_decompress(src, src.Length - 4, dst, ref outlen, _workMemory); else lzo1x_decompress32(src, src.Length - 4, dst, ref outlen,

Cannot marshal 'return value': Invalid managed/unmanaged type combination

故事扮演 提交于 2021-02-10 16:41:08
问题 I have this function in an unmanaged library and I want to call it in C#: unsigned char __stdcall InitDev(unsigned char comport, long BaudRate) and this is in C# [System.Security.SuppressUnmanagedCodeSecurity] [DllImport("*.dll", CallingConvention = CallingConvention.Cdecl,CharSet =CharSet.Auto)] public static extern byte[] InitDev(byte[] comport, [Out]long BaudRate); but when I call this function in C# I get the following error "Cannot marshal 'return value': Invalid managed/unmanaged type

How to map a C array to C#?

谁都会走 提交于 2021-02-10 02:32:18
问题 My question has to do with trying to call a function written in C from C#. I've looked in a header file that came with the C library to understand the functions as they exist in the C dll. Here's what I see: C code (for a function called "LocGetLocations"): typedef enum { eLocNoError, eLocInvalidCriteria, eLocNoMatch, eLocNoMoreLocations, eLocConnectionError, eLocContextError, eLocMemoryError } tLocGetStatus; typedef void *tLocFindCtx; typedef void *tLocation; PREFIX unsigned int POSTFIX