Bram Cymet | 3 May 22:29 2007

Yaws and Soap on a MAC(OS X)

Hi,

I was wondering if anyone has tried running yaws on OS X. We are trying
to get it working. Serving webpages works just fine including using json
to make erlang callbacks. The problem we are having is when we try to
make a soap call it keeps returning {error, connection refused}. The
exact same code works fine on linux.

Thanks,

Bram Cymet

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Claes Wikstrom | 3 May 23:07 2007

Re: Yaws and Soap on a MAC(OS X)

Bram Cymet wrote:
> Hi,
> 
> I was wondering if anyone has tried running yaws on OS X. We are trying
> to get it working. Serving webpages works just fine including using json
> to make erlang callbacks. The problem we are having is when we try to
> make a soap call it keeps returning {error, connection refused}. The
> exact same code works fine on linux.
> 

I develop on OS X. I suggest you take another look at your config files.

connection refused means ... well, just that. Do netstat to see
which ports are listened to.
Start yaws with -i and see which ports it claims to listen to.

-klacke

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Bram Cymet | 4 May 17:09 2007

Re: Yaws and Soap on a MAC(OS X)

Hi Claes,

I checked and yaws is listening on port 8282, which is the port that I
want to use. I looked at the inets_request on both the mac and linux
boxes and they are the same. So everything looks like it should work but
I still get the connection refused error. I know that yaws is working
fine because I can connect to the website I have running on yaws on the
mac.
On May 03, 2007 05:07 PM, Claes Wikstrom <klacke@...> wrote:

>Bram Cymet wrote:
>>Hi,
>>
>>I was wondering if anyone has tried running yaws on OS X. We are
>>trying
>>to get it working. Serving webpages works just fine including using
>>json
>>to make erlang callbacks. The problem we are having is when we try to
>>make a soap call it keeps returning {error, connection refused}. The
>>exact same code works fine on linux.
>>
>
>
>I develop on OS X. I suggest you take another look at your config
>files.
>
>connection refused means ... well, just that. Do netstat to see
>which ports are listened to.
>Start yaws with -i and see which ports it claims to listen to.
>
(Continue reading)

Claes Wikström | 4 May 17:25 2007

Re: Yaws and Soap on a MAC(OS X)

Bram Cymet wrote:
> Hi Claes,
> 
> I checked and yaws is listening on port 8282, which is the port that I
> want to use. I looked at the inets_request on both the mac and linux
> boxes and they are the same. So everything looks like it should work but
> I still get the connection refused error. I know that yaws is working
> fine because I can connect to the website I have running on yaws on the
> mac.

Next step is then to telnet to the port and issue any command manually
and see what happens. Connection refused _means_ that no one is listening to
the port.

/klacke

--

-- 
Claes Wikstrom                        -- Caps lock is nowhere and
http://www.tail-f.com                 -- everything is under control
cellphone: +46 70 2097763

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Michael Arnoldus | 4 May 21:43 2007
Picon

Re: Yaws and Soap on a MAC(OS X)

Just a guess, but do you have access through the firewall?

Michael Arnoldus

Den 04/05/2007 kl. 17.09 skrev Bram Cymet:

> Hi Claes,
>
> I checked and yaws is listening on port 8282, which is the port that I
> want to use. I looked at the inets_request on both the mac and linux
> boxes and they are the same. So everything looks like it should  
> work but
> I still get the connection refused error. I know that yaws is working
> fine because I can connect to the website I have running on yaws on  
> the
> mac.
> On May 03, 2007 05:07 PM, Claes Wikstrom <klacke@...> wrote:
>
>> Bram Cymet wrote:
>>> Hi,
>>>
>>> I was wondering if anyone has tried running yaws on OS X. We are
>>> trying
>>> to get it working. Serving webpages works just fine including using
>>> json
>>> to make erlang callbacks. The problem we are having is when we  
>>> try to
>>> make a soap call it keeps returning {error, connection refused}. The
>>> exact same code works fine on linux.
>>>
(Continue reading)

Brian Templeton | 9 May 07:51 2007

Unicode and json:encode

json:encode assumes that any strings containing characters > 255 are
lists of Unicode scalar values, and encodes them as UTF-8. This isn't
enough, though, because there are Unicode scalar values < 255 which
need to be encoded to produce an equivalent UTF-8 string. For example,
LATIN SMALL LETTER A WITH DIAERESIS (U+00E4) is encoded in UTF-8 as
<<16#C3, 16#A4>>. It's better to leave the strings as-is and allow the
user to encode the result if necessary. json:encode will then work
correctly with both Unicode-scalar-value strings and UTF-8-code-point
strings.

I've attached a patch fixing this problem (I also removed comment
parsing).

Attachment (json.diff): text/x-diff, 3593 bytes
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@...
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Joe Armstrong | 9 May 21:20 2007
Picon

bug in yaw-1.68

Seems to be a bug in yaws-1.68

With this config

<server localhost>
	port = 8080
	# listen = 127.0.0.1
	listen = 0.0.0.0
        docroot = /home/joe/2007/yaws/project1	
	dir_listings = true
	dav = true
 </server>

I get no director listings

If I comment out the dav=true then I *do* get directory listings

dav and directory_listings are not independent

/Joe

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Claes Wikstrom | 10 May 01:30 2007

Re: Unicode and json:encode

Brian Templeton wrote:
> json:encode assumes that any strings containing characters > 255 are
> lists of Unicode scalar values, and encodes them as UTF-8. This isn't

Patch looks good. Anyone on the list has an opinion  here ??

/klacke

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Gaspar Chilingarov | 10 May 21:49 2007
Picon

Re: Unicode and json:encode

Hi there!

Claes Wikstrom wrote:
> Brian Templeton wrote:
>> json:encode assumes that any strings containing characters > 255 are
>> lists of Unicode scalar values, and encodes them as UTF-8. This isn't
> 
> Patch looks good. Anyone on the list has an opinion  here ??
> 
> 
> /klacke

We'd implemented unicode encoding in json module because it's sometimes 
too difficult to run around whole data structure going out in request or 
going to client in the server's answer and convert unicode lists to 
utf-8 or some another encoding.

This change at least will break some things our application as we expect 
  that stings will be converted to unicode automagically ;)
Anyway, may be it's better to provide more consistent support for 
outgoing data encoding? I.e. allowing programmer to pass some options to 
jsonrpc:call and yaws_jsonrpc:handler functoins, which will control 
automatic encoding of data?

about the patch - it seems to break some logic too.
in this part only line with unicode detection should be removed.
in case if illegal list is passed into encode function it should report 
error and not fail later in encode_string with strange message.

encode(L) when is_list(L) ->
(Continue reading)

Brian Templeton | 11 May 20:26 2007

Re: Unicode and json:encode

Gaspar Chilingarov <nm@...> writes:

> Hi there!
>
> Claes Wikstrom wrote:
>> Brian Templeton wrote:
>>> json:encode assumes that any strings containing characters > 255 are
>>> lists of Unicode scalar values, and encodes them as UTF-8. This isn't
>> 
>> Patch looks good. Anyone on the list has an opinion  here ??
>> 
>> 
>> /klacke
>
[...]

> about the patch - it seems to break some logic too.
> in this part only line with unicode detection should be removed.
> in case if illegal list is passed into encode function it should report 
> error and not fail later in encode_string with strange message.
>
> encode(L) when is_list(L) ->
>      case is_string(L) of
> 	yes -> encode_string(L);
> 	unicode -> encode_string(xmerl_ucs:to_utf8(L));
> 	no -> exit({json_encode, {not_string, L}})
>      end;
>

I don't see why L should be checked both in is_string and
(Continue reading)


Gmane