Recent Post

Categories

Archives

Cow Computing

09 Sep 8

Combine All DLL and EXE into One

Often when we are developing on the .NET platform, we might try to link some external library or even create our very own to facilitate the development. This usually results in a bunch of dll together with the exe sitting inside the bin folder. It’s ugly and troublesome for user in case certain dll is missing.

Now, we got a solution from a microsoft researcher. ILMerge is a utility developed to merge multiple dll/exe into one.

// To merge into a single exe.
ILMerge.exe /out:Combined.exe path_to_bin/original.exe path_to_lib/lib.dll

// To merge into a single dll
ILMerge.exe /out:Combined.dll path_to_lib/lib.dll path_to_lib/lib2.dll

*note that, the merge only work good with dll created under .NET platform.

09 Sep 7

.NET code to interact with Java’s Web Service

Recently, i am working on a library to allow .NET developer to interact with a web service built on Java. It’s a SwA (Soap with Attachment). The reason for me to do this is because there’s been no support for such operation in .NET framework and users who want to deal with such scenario will have to write their own code bit by bit to accomplish the job, which is TEDIOUS…

The library i built relies on an open source library called PocketSoap. Its support on Attachment and its ease of use is appealing and i at last chosen to give it a try and build a POC on top of it. Below is a simple usage sample for the PocketSoap library.

using System;
using PocketSOAP;
using PocketSOAPAttachments;

namespace PSTryout
{
    public class psWS
    {
        CoEnvelope e = new CoEnvelopeClass();
        e.Body.Create("id", 1, "", null, null);
        e.EncodingStyle = "";

        HTTPTransport h = new HTTPTransport();
        h.SOAPAction = "query";
        h.Timeout = 30000;
        h.Send("http://localhost:8080/ws/", e.Serialize());

        string enc = "";
        e.Parse(h, enc);
    }
}