[erlang-questions] use erlSoap package in Erlang

Thilani Abeysinghe <>
Tue Jun 3 08:36:01 CEST 2008


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/38e67d9c/attachment.html>


More information about the erlang-questions mailing list