Skip to content
This repository
Newer
Older
100644 410 lines (348 sloc) 17.08 kb
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
1
2 <erl>
3
4
5 box(Str) ->
6 {'div',[{class,"box"}],
7 {pre,[], yaws_api:htmlize(Str)}}.
8
9 tbox(T) ->
10 box(lists:flatten(io_lib:format("~p",[T]))).
11
12
13 ssi(File) ->
14 {'div',[{class,"box"}],
15 {pre,[],
16 {ssi, File,[],[]}}}.
17
18 ss(A, File) ->
19 {ok, B} = file:read_file(
0be3c7e8 »
2008-02-14 untabified all of yaws
20 filename:join([A#arg.docroot, File])),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
21 box(binary_to_list(B)).
22
23
78112471 »
2011-10-31 whitespace cleanup
24
25 out(A) ->
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
26 [{ssi, "TAB.inc", "%%",[{"soap_intro", "choosen"}]},
27 {ehtml,
28 {'div', [{id, "entry"}],
29
30 [{h1, [], "SOAP with Yaws"},
78112471 »
2011-10-31 whitespace cleanup
31
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
32 {p, [],
0be3c7e8 »
2008-02-14 untabified all of yaws
33 ["SOAP is an XML-based protocol for communication over a network "
34 "connection. The main focus of SOAP is remote procedure calls (RPCs) "
35 "transported via HTTP. "
36 "SOAP is similar to XML-RPC but makes use of XML Schema to define "
9bcdaf60 »
2010-10-04 fix typos on soap intro page (reported by Wes James)
37 "the data types it uses. "
0be3c7e8 »
2008-02-14 untabified all of yaws
38 ]},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
39
40 {h2, [], "Preparations"},
41
42 {p, [],
9bcdaf60 »
2010-10-04 fix typos on soap intro page (reported by Wes James)
43 ["Yaws uses the 'erlsom' XML Schema "
0be3c7e8 »
2008-02-14 untabified all of yaws
44 "parser and some SOAP specific library code. "
45 "Thus, to be able to use SOAP with Yaws you need to have "
46 "'erlsom' installed. Currently, the easiest way of installing "
9bcdaf60 »
2010-10-04 fix typos on soap intro page (reported by Wes James)
47 "'erlsom' is to check out the library from github.com and "
0be3c7e8 »
2008-02-14 untabified all of yaws
48 "install it from there (you can also download a released version "
49 "of erlsom and install it)."]},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
50
51 {p,[],"To install 'erlsom' do:"},
52
9bcdaf60 »
2010-10-04 fix typos on soap intro page (reported by Wes James)
53 box("git clone http://github.com/willemdj/erlsom.git\n"
54 "cd erlsom; chmod a+x configure; ./configure; make\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
55 "sudo make install # iff you want to install as root\n"
56 ),
78112471 »
2011-10-31 whitespace cleanup
57
58 {p, [],
9bcdaf60 »
2010-10-04 fix typos on soap intro page (reported by Wes James)
59 "<b>Important:</b> The SOAP-specific code that makes use of erlsom has some limitations "
0be3c7e8 »
2008-02-14 untabified all of yaws
60 "that it is important to be aware of. Only the Soap <i>'document'</i> binding "
61 "style is supported. There is no support for non-soap bindings, nor for the "
62 "RPC binding style. Also, only the <i>'literal'</i> encoding is supported "
63 "There is no support for <i>'soap-encoding'</i>. For an explanation of the differences "
64 "between these concepts, see this "
65 "<a href=\"http://www-128.ibm.com/developerworks/webservices/library/ws-whichwsdl/\">description</a>."},
78112471 »
2011-10-31 whitespace cleanup
66
67
0be3c7e8 »
2008-02-14 untabified all of yaws
68 {h2, [], "The SOAP client side"},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
69
70 {p, [],
0be3c7e8 »
2008-02-14 untabified all of yaws
71 ["The SOAP interface is defined by a WSDL specification, which "
72 "simply is a (rather verbose) piece of XML document that specifies "
73 "the public interface for a web service. As a client, "
74 "we don't need to understand everything in the WSDL specification "
75 "The parts that are most interesting is the name of the operation "
76 "we want to perform (i.e the function we want to call) and what "
77 "input data it expects."
78 ]},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
79
80 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
81 ["As an example, lets have a look at a public SOAP service that "
82 "returns some weather data for the location we send to it. "
83 "The WSDL specification can be found here: ",
78112471 »
2011-10-31 whitespace cleanup
84 {a, [{href, "http://www.webservicex.net/WeatherForecast.asmx?WSDL"}],
0be3c7e8 »
2008-02-14 untabified all of yaws
85 "http://www.webservicex.net/WeatherForecast.asmx?WSDL "}
86 ]},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
87
88 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
89 ["We start by finding the operation named: ",
90 {i, [], "GetWeatherByPlaceName, "},
91 "which is the operation we want to invoke. As can be seen, we have "
92 "one input message and one output message defined. The input message is "
93 "the one we (as a client) will send to the server. "
94 ]},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
95
96 box("<wsdl:operation name=\"GetWeatherByPlaceName\">\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
97 " <documentation>\n"
98 " Get one week weather forecast for a place name(USA)\n"
99 " </documentation>\n"
100 " <wsdl:input message=\"tns:GetWeatherByPlaceNameSoapIn\"/>\n"
101 " <wsdl:output message=\"tns:GetWeatherByPlaceNameSoapOut\"/>\n"
102 "</wsdl:operation>\n"),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
103
104 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
105 ["Now, follow the reference to the message: ",
106 {i, [], "tns:GetWeatherByPlaceNameSoapIn, "},
78112471 »
2011-10-31 whitespace cleanup
107 "to where it is defined: "
0be3c7e8 »
2008-02-14 untabified all of yaws
108 ]},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
109
110 box("<wsdl:message name=\"GetWeatherByPlaceNameSoapIn\">\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
111 "<wsdl:part name=\"parameters\" element=\"tns:GetWeatherByPlaceName\"/>\n"
112 "</wsdl:message>\n"),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
113
114 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
115 ["Continue by following the reference to: ",
116 {i, [], "tns:GetWeatherByPlaceName, "},
117 "and you will end up with an XML Schema type definition: "
118 ]},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
119
120 box("<s:element name=\"GetWeatherByPlaceName\">\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
121 "<s:complexType>\n"
122 "<s:sequence>\n"
123 "<s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"PlaceName\" type=\"s:string\"/>\n"
124 "</s:complexType>\n"
125 "</s:sequence>\n"
126 "</s:element>\n"),
78112471 »
2011-10-31 whitespace cleanup
127
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
128 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
129 "This tells us that the function we want to call takes one argument "
130 "of a string type (which apparently denotes a Name of a place in the US). "
131 "Left for us is just to call the function from an Erlang shell which has "
132 "got the Yaws ebin directory in the path:"
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
133 },
134
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
135 box("1> inets:start().\n"
136 "ok\n"
137 "2> yaws_soap_lib:call(\n"
d8cc8be0 »
2008-11-25 git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk…
138 " \"http://www.webservicex.net/WeatherForecast.asmx?WSDL\",\n"
139 " \"GetWeatherByPlaceName\",\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
140 " [\"Boston\"]).\n"
141 "{ok,undefined,\n"
142 " [{'p:GetWeatherByPlaceNameResponse',\n"
143 " [],\n"
144 " {'p:WeatherForecasts',[],\n"
145 " \"40.3044128\",\n"
146 " \"79.81284\",\n"
147 " \"0.000453\",\n"
148 " \"42\",\n"
149 " \"BOSTON\",\n"
150 " \"PA\",\n"
151 " undefined,\n"
152 " {'p:ArrayOfWeatherData',\n"
153 " [],\n"
154 " [{'p:WeatherData',\n"
155 " [],\n"
156 " \"Friday, December 08, 2006\"|...},\n"
157 " .....\n"),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
158
159 {p,[],
9bcdaf60 »
2010-10-04 fix typos on soap intro page (reported by Wes James)
160 "So what happened here? We specified the URL to the WSDL file. "
0be3c7e8 »
2008-02-14 untabified all of yaws
161 "The yaws_soap_lib:call/3 function then went to retrieve the file, parsed it, "
162 "created a proper message, sent off the message, waited for the "
163 "reply and finally returned a parsed reply as Erlang records. "
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
164 },
165
166 {p,[],
9bcdaf60 »
2010-10-04 fix typos on soap intro page (reported by Wes James)
167 "Even though this is very convenient, we probably want do more than just one call "
0be3c7e8 »
2008-02-14 untabified all of yaws
168 "to the web service. So to avoid retrieving and parsing the WSDL file for every "
169 "call. We can do it in two steps: "
170 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
171
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
172 box("1> inets:start().\n"
173 "ok\n"
174 "2> Wsdl = yaws_soap_lib:initModel(\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
175 " \"http://www.webservicex.net/WeatherForecast.asmx?WSDL\").\n"
176 "...\n"
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
177 "3> yaws_soap_lib:call(\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
178 " Wsdl,\n"
179 " \"GetWeatherByPlaceName\"\n"
180 " [\"Boston\"]).\n"
181 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
182
183 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
184 "To be able to work with the records that we get in the response, "
185 "we can create a header file that we can include in our source code. In our example "
186 "the generated '.hrl' file will look like this: "
187 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
188
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
189 box("4> yaws_soap_lib:write_hrl(Wsdl, \"/tmp/wfc.hrl\").\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
190 "...\n"
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
191 "5> {ok,Bin}=file:read_file(\"/tmp/wfc.hrl\"),io:fwrite(binary_to_list(Bin)).\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
192 "-record('soap:detail', {anyAttribs, choice}).\n"
193 "-record('soap:Fault', {anyAttribs, 'faultcode', 'faultstring', 'faultactor', 'detail'}).\n"
194 "-record('soap:Body', {anyAttribs, choice}).\n"
195 "-record('soap:Header', {anyAttribs, choice}).\n"
196 "-record('soap:Envelope', {anyAttribs, 'Header', 'Body', choice}).\n"
197 "-record('p:GetWeatherByPlaceNameResponse', {anyAttribs, 'GetWeatherByPlaceNameResult'}).\n"
198 "-record('p:GetWeatherByPlaceName', {anyAttribs, 'PlaceName'}).\n"
199 "-record('p:WeatherData', {anyAttribs, 'Day', 'WeatherImage', 'MaxTemperatureF', \n"
200 " 'MinTemperatureF', 'MaxTemperatureC', 'MinTemperatureC'}).\n"
201 "-record('p:ArrayOfWeatherData', {anyAttribs, 'WeatherData'}).\n"
202 "-record('p:WeatherForecasts', {anyAttribs, 'Latitude', 'Longitude', 'AllocationFactor', \n"
203 " 'FipsCode', 'PlaceName', 'StateCode', 'Status', 'Details'}).\n"
204 "-record('p:GetWeatherByZipCodeResponse', {anyAttribs, 'GetWeatherByZipCodeResult'}).\n"
205 "-record('p:GetWeatherByZipCode', {anyAttribs, 'ZipCode'}).\n"
206 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
207
208 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
209 "As you can see, every record in our header has an XML namespace prefix prepended "
210 "in the name of the record. The prefix 'p' as shown above is the default prefix you'll "
211 "get if you don't specify a prefix yourself. This is probably good enough, but if you "
212 "want to set it to something else, you can do it as shown below:"
213 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
214
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
215 box("6> yaws_soap_lib:initModel(... , \"foo\"). % foo is my prefix\n"
216 "7> yaws_soap_lib:write_hrl(... , ... , \"foo\").\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
217 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
218
219 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
220 ["Some final notes:",
221 {ul, [],
222 [{li, [],
223 "The \"http://...\" URL given as the first argument to the "
224 "functions above may as well be a local file, and thus written as \"file://....\". "},
225 {li, [],
226 "When we retrieve a HTTP located file, we will use 'ibrowse' if it exist "
ec553ffd »
2011-10-29 Allow to pass options to erlsom (fix issue #65)
227 "in the code path. Otherwise we will use the OTP 'http' client."},
78112471 »
2011-10-31 whitespace cleanup
228 {li, [],
ec553ffd »
2011-10-29 Allow to pass options to erlsom (fix issue #65)
229 "The prefix ('foo' in the example above) is passed to erlsom - it is one of erlsom's "
230 "options. If you want to specify other options, you can also pass the regular erlsom "
231 "options to yaws_soap_lib:initModel/2 and yaws_soap_lib:write_hrl/3. For example, to "
232 "specify how files that the XSD inside the WSDL refers to via 'include' statements "
233 "can be retrieved, you can pass it a function GetIncludes/4 by specifying "
234 "[{include_fun, GetIncludes}]. See the erlsom documentation for other options that you "
235 "could specify."}
0be3c7e8 »
2008-02-14 untabified all of yaws
236 ]}]},
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
237
238 {h2, [], "The SOAP server side"},
239
240 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
241 "If we want to run our own weather service we need to take the WSDL "
242 "and add our own location to it. Either we can just study the WSDL file to "
243 "see which URL we need to change in the 'service' part of the document, or "
9bcdaf60 »
2010-10-04 fix typos on soap intro page (reported by Wes James)
244 "we can make use of some nice access functions that work on the "
0be3c7e8 »
2008-02-14 untabified all of yaws
245 "#wsdl{} record that yaws_soap_lib:initModel/2 returned, as shown below: "
246 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
247
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
248 box("8> Ops = yaws_soap_lib:wsdl_operations(Wsdl).\n"
249 "9> {ok,Op} = yaws_soap_lib:get_operation(Ops, \"GetWeatherByPlaceName\").\n"
250 "10> yaws_soap_lib:wsdl_op_address(Op).\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
251 "\"http://www.webservicex.net/WeatherForecast.asmx\"\n"
252 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
253
254 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
255 "Now, edit the WSDL file and change the above URL to something like this:"
256 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
257
258 box("<wsdl:service name=\"WeatherForecast\">\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
259 " <documentation xmlns=......\n"
260 " <wsdl:port name=\"WeatherForecastSoap\".....\n"
261 " <soap:address location=\"http://localhost:8181/WeatherForecast.yaws\" />\n"
262 " </wsdl:port>\n"
263 ".....\n"
264 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
265
266
267 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
268 "Next, start an Erlang shell and start Yaws with SOAP enabled. We need to write "
269 "the code that returns the weather info. This is done in a callback module that "
270 "the Yaws SOAP code will call with the incoming message. The message will be an "
271 "Erlang record and what we return must also be an Erlang record. So we will need "
272 "to create a .hrl containing the record definitions that we can include: "
273 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
274
275 box("1> Docroot = \"/tmp\".\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
276 "\n"
277 "2> GL = [{enable_soap,true}, % <== THIS WILL ENABLE SOAP IN A YAWS SERVER!!\n"
278 " {trace, false},\n"
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
279 " {tmpdir,Docroot},{logdir,Docroot},\n"
d9342f8b »
2011-05-04 server-specific logger_mod and auth_mod (capflam)
280 " {flags,[{tty_trace, false},{copy_errlog, true}]}].\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
281 "\n"
282 "3> SL = [{port,8181},{servername,\"localhost\"},{dir_listings, true},\n"
d9342f8b »
2011-05-04 server-specific logger_mod and auth_mod (capflam)
283 " {listen,{127,0,0,1}},{flags,[{auth_log,false},{access_log,false}]}].\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
284 "\n"
285 "% BELOW, WE CREATE THE .hrl FILE!!\n"
286 "4> yaws_soap_lib:write_hrl(\"file:///tmp/MyWeatherService.wsdl\", \"/tmp/my_soap.hrl\").\n"
287 "\n"
288 "% WE MUST ADD A PATH TO OUR CALLBACK CODE!!\n"
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
289 "5> code:add_path(Docroot).\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
290 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
291
292 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
293 "We continue by writing our weather forecast callback module:"
294 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
295
296 box("# cat /tmp/my_soap.erl\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
297 "-module(my_soap).\n"
298 "-export([handler/4]).\n"
299 "-include(\"my_soap.hrl\"). % .hrl file generated by erlsom\n"
300 "\n"
301 "handler(_Header,\n"
302 " [#'p:GetWeatherByPlaceName'{'PlaceName' = Place}],\n"
303 " _Action, \n"
304 " _SessionValue) ->\n"
305 " {ok, undefined, get_weather_info(Place)}.\n"
306 "\n"
307 "get_weather_info(Place) ->\n"
308 " WeatherData =\n"
309 " #'p:WeatherData'{anyAttribs = [],\n"
310 " 'Day' = \"Sunday, December 10, 2006\",\n"
311 " 'WeatherImage' = \"http://www.nws.noaa.gov/weather/images/fcicons/nfew.jpg\",\n"
312 " 'MaxTemperatureF' = \"51\",\n"
313 " 'MinTemperatureF' = \"28\",\n"
314 " 'MaxTemperatureC' = \"11\",\n"
315 " 'MinTemperatureC' = \"-2\"\n"
316 " },\n"
317 "\n"
318 " ArrayOfWeatherData =\n"
319 " #'p:ArrayOfWeatherData'{anyAttribs = [],\n"
320 " 'WeatherData' = [WeatherData]\n"
321 " },\n"
322 "\n"
323 " Forecast =\n"
324 " #'p:WeatherForecasts'{anyAttribs = [],\n"
325 " 'Latitude' = \"40.3044128\",\n"
326 " 'Longitude' = \"79.81284\",\n"
327 " 'AllocationFactor' = \"0.000453\",\n"
328 " 'FipsCode' = \"42\",\n"
329 " 'PlaceName' = Place,\n"
330 " 'StateCode' = \"PA\",\n"
331 " 'Status' = undefined,\n"
332 " 'Details' = ArrayOfWeatherData\n"
333 " },\n"
334 "\n"
335 " Response =\n"
336 " #'p:GetWeatherByPlaceNameResponse'{anyAttribs = [],\n"
337 " 'GetWeatherByPlaceNameResult' = Forecast\n"
338 " },\n"
339 "\n"
340 " [Response]. \n"
341 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
342
343 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
344 "The final piece on the server side is the '.yaws' file that invokes the "
345 "Yaws SOAP server (note that we are using the same way of hooking in our "
346 "callback module as for Json and HaXe):"
347 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
348
349 box("# cat /tmp/WeatherForecast.yaws\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
350 "<erl>\n"
351 "out(A) ->\n"
352 " yaws_rpc:handler_session(A, {my_soap, handler}).\n"
353 "</erl>\n"
354 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
355
356 {p,[],
ec553ffd »
2011-10-29 Allow to pass options to erlsom (fix issue #65)
357 "Now, in your Yaws shell, setup the Soap server as shown below. (If required, for "
358 "example to specify a prefix or a function to retrieve included files, you can specify "
359 "options similar to what we saw above for yaws_soap_lib:initModel/2 and "
78112471 »
2011-10-31 whitespace cleanup
360 "yaws_soap_lib:write_hrl/3 , using yaws_soap_srv:setup/3.)"
0be3c7e8 »
2008-02-14 untabified all of yaws
361 },
7795c70b »
2007-01-26 Adding missing description on call to: yaws_soap_srv:setup/2.
362
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
363 box("6> yaws:start_embedded(Docroot,SL,GL).\n"
364 "=INFO REPORT==== 29-Nov-2008::20:03:50 ===\n"
365 "Yaws: Listening to 127.0.0.1:8181 for servers\n"
366 " - http://localhost:8181 under /tmp\n"
367 "ok\n"
368 "7> yaws_soap_srv:setup({my_soap, handler}, \"file:///tmp/MyWeatherService.wsdl\").\n"
369 "ok\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
370 ),
7795c70b »
2007-01-26 Adding missing description on call to: yaws_soap_srv:setup/2.
371
372 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
373 "We are now ready to try it out. Start another Erlang shell and call it: "
374 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
375
89a16d7c »
2008-12-02 better soap docs by Stu Bailey
376 box("1> inets:start().\n"
377 "ok\n"
378 "2> yaws_soap_lib:call(\"file:///tmp/MyWeatherService.wsdl\",\n"
0be3c7e8 »
2008-02-14 untabified all of yaws
379 " \"GetWeatherByPlaceName\",\n"
380 " [\"Stockholm\"]).\n"
381 "{ok,undefined,\n"
382 " [{'p:GetWeatherByPlaceNameResponse', [],\n"
383 " {'p:WeatherForecasts',[],\n"
384 " \"40.3044128\",\n"
385 " \"79.81284\",\n"
386 " \"0.000453\",\n"
387 " \"42\",\n"
388 " \"Stockholm\", % <=== Yippie, it works !!\n"
389 " \"PA\",\n"
390 " undefined,\n"
391 " {'p:ArrayOfWeatherData', [],\n"
392 " [{'p:WeatherData', [],\n"
393 " \"Sunday, December 10, 2006\"|...}]}}}]}\n"
394 "\n"
395 ),
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
396
397 {p,[],
0be3c7e8 »
2008-02-14 untabified all of yaws
398 "There you have it! "
399 },
c332fc22 »
2006-12-10 Adding SOAP processing capabilities to Yaws.
400
401
402 {ssi, "END2",[],[]}
403 ]}}].
404
405
406
407
408 </erl>
409
Something went wrong with that request. Please try again.