[erlang-questions] use erlSoap package in Erlang

Willem de Jong <>
Tue Jun 3 20:10:24 CEST 2008


Hello Thilani,

Unfortunately erlsoap and erlsom are not part of the standard erlang
distribution, so you
will have to download and compile them. To do that for the first time can be
a bit of a
puzzle, but it isn't particularly difficult.

Both projects are hosted on sourceforge. You will find erlsoap under
http://www.sourceforge.net/projects/erlsoap and erlsom under
http://www.sourceforge.net/projects/erlsom

To install erlsom you have to download the tar.gz file (use the 'download
erlsom' button), unzip it (you may need to download another tool for
that...), put the files in the right location
(probably something like "C:\Program Files\erl5.6.1\lib\erlsom-1.2.1") and
compile them (start the erlang shell, cd to the right directory and compile
them ( make:all([{outdir, "../ebin"}]). ). It is explained in a bit more
detail in the erlsom documentation.
There is no tar.gz file for erlsoap, so you will have to get the files from
SVN. You
will need a SVN client for that. TortoiseSVN is probably a good choice. Once
you have downloaded the files you need to put them in the right location
(C:\Program Files\erl5.6.1\lib\erlsoap-0.4.3) and compile them. Note that
you also have to make sure that a couple of .xsd files and a .conf file are
in the 'priv' (directory C:\Program Files\erl5.6.1\lib\erlsoap-0.4.3\priv)

Good luck...
Willem
On Tue, Jun 3, 2008 at 8:36 AM, Thilani Abeysinghe <>
wrote:

> At the moment can you please guide me how to configure these erlsom and
> erlsoap packages.
>
> Normally in erlang shell I can invoke erlang modules like
>
> module_name:fundction(parameters).
>
> How to configure above packages with the existing erlang system.
>
> Thanks in advance for your kind reply
>
>   Regards
>    Thilani
>
>    Computer Science and Engineering
>    University of Moratuwa
>    Sri Lanka
>    http://www.thilani.blogspot.com
>    http://www.cgmax.blogspot.com
>
>   On Tue, Jun 3, 2008 at 11:49 AM, Willem de Jong <>
> wrote:
>
>> Hi Thilani,
>>
>> Do you need to implement a client (sending a request and receiving a
>> response) or a server (receiving a request and sending a response)?
>>
>> For a server the code could look something like this:
>>
>> -module(minimal_soap_server).
>> -compile(export_all).
>>
>> -include("sms.hrl").  % .hrl file generated by erlsom
>>
>> start() ->
>>  mod_soap:start(),
>>  ok = mod_soap:add_callback("/parlay_sms",
>>                "parlayx_sms_send_service_3_1.wsdl",
>>                fun(_I, _Header, Body) -> handler(Body) end).
>>
>> handler([#'p:sendSms'{addresses = To,
>>                      message = Text}]) ->
>>     {ok, send(To, Text)}.
>>
>> send(To, Text) ->
>>   [#'p:sendSmsResponse'{'result' = "sending " ++ Text ++ " to: " ++ To}].
>> As you can see, you need to have a WSDL.
>>
>> You need to install erlsoap and erlsom. That should be relatively easy:
>> download the files, put them in the right place and compile them. I think
>> you also need to provide a simple configuration file for erlsoap. Let me
>> know if you need more information.
>>
>> A simple client might look like this:
>>
>> -module(minimal_client).
>> -export([sms/2]).
>>
>> -include("sms.hrl").
>> sms(To, Text) ->
>>   Wsdl = yaws_soap_lib:initModel("
>> file://parlayx_sms_send_service_3_1.wsdl"),
>>   Sms = #'p:sendSms'{addresses = [To],
>>                      senderName = "Sender",
>>                      message = Text},
>>   yaws_soap_lib:call(Wsdl, "sendSms", [], [Sms]).
>>
>> This uses the soap client code provided with yaws, but the erlsoap client
>> is essentially the same. Again you will need a WSDL, and erlsom has to be
>> installed.
>>
>> Good luck,
>> Willem
>>
>>   On 6/2/08, Thilani Abeysinghe <> wrote:
>>
>>>   Hi All
>>>    I want to use ErlSoap package for sending SOAP messages using Erlang.
>>>    Can you please tell me how to configure the  Erlsoap package.I use
>>> windows
>>>    platform
>>>    Thanks in Advance
>>>
>>>    Regards
>>>    Thilani
>>>
>>>    Computer Science and Engineering
>>>    University of Moratuwa
>>>    Sri Lanka
>>>    http://www.thilani.blogspot.com
>>>    http://www.cgmax.blogspot.com
>>> _______________________________________________
>>> erlang-questions mailing list
>>> 
>>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080603/b1895439/attachment.html>


More information about the erlang-questions mailing list