[racket] xmlrpc with racket problem

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Sep 23 15:21:41 EDT 2010

Since you didn't post any programs or how you ran them, it is hard for
me to tell what the problem is. It appears that you tried to run the
"server" code as a module-based servlet, which it is not because it
does not provide interface-version, manager, or start as specified
here:

http://docs.racket-lang.org/web-server/servlet.html#(part._servlet-example)

Since I can tell this code is based on the code in the docs, it
appears that you just aren't calling (run-server!) as you'd need to
actually run the server. Attached is code that will work and makes
everything explicit.

Jay

On Thu, Sep 23, 2010 at 12:40 PM, Tobias Salzmann
<salty83 at googlemail.com> wrote:
> Hello
>
> many thanks for the quick help.
> But I still have a problem
>
> Here is my code:
> Server:
>  (define (add x y) (+ x y))
>   (define xml-rpc-adder
>     (make-handle-xml-rpc
>      (hasheq 'math.add add
>              'math.+ +
>              'addFun add)))
>   (define (run-server!)
>     (serve/servlet xml-rpc-adder
>                    #:port 8888
>                    #:servlet-path "/servlets/rpc/xmlrpc.rkt"
>                    #:command-line? #t))
> Client:
>   (define adder
>       (xml-rpc-server (string->url
> "http://localhost:8888/servlets/rpc/xmlrpc.rkt")))
>     (define math.add (adder 'math.add))
>     (math.add 3 4)
>  And the answer here:
> Received invalid XMLRPC response (html (head (title Servlet Error) (link (@
> (rel stylesheet) (href /error.css)))) (body (div (@ (class section)) (div (@
> (class title)) Exception) (p The application raised an exception with the
> message: (pre dynamic-require: name is not provided: 'interface-version by
> module: #<resolved-module-path:"C:\Program Files
> (x86)\Racket\collects\web-server\default-web-root\htdocs\servlets\rpc\xmlrpc.rkt">))
> (p Stack trace: (pre <unknown procedure> at:
>   line 121, column 2, in file C:\Program Files
> (x86)\Racket\collects\web-server\servlet\setup.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> hash-ref! at:
>   line 399, column 13, in file C:\Program Files
> (x86)\Racket\collects\racket\private\more-scheme.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 57, column 2, in file C:\Program Files
> (x86)\Racket\collects\web-server\dispatchers\dispatch-servlets.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> select-handler/no-breaks at:
>   line 173, column 2, in file C:\Program Files
> (x86)\Racket\collects\racket\private\more-scheme.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> select-handler/no-breaks at:
>   line 173, column 2, in file C:\Program Files
> (x86)\Racket\collects\racket\private\more-scheme.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> select-handler/no-breaks at:
>   line 173, column 2, in file C:\Program Files
> (x86)\Racket\collects\racket\private\more-scheme.rkt
> select-handler/no-breaks at:
>   line 173, column 2, in file C:\Program Files
> (x86)\Racket\collects\racket\private\more-scheme.rkt
> select-handler/no-breaks at:
>   line 173, column 2, in file C:\Program Files
> (x86)\Racket\collects\racket\private\more-scheme.rkt
> select-handler/no-breaks at:
>   line 173, column 2, in file C:\Program Files
> (x86)\Racket\collects\racket\private\more-scheme.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> <unknown procedure> at:
>   line 1445, column 3, in file C:\Program Files
> (x86)\Racket\collects\racket\contract\private\arrow.rkt
> connection-loop at:
>   line 62, column 2, in file C:\Program Files
> (x86)\Racket\collects\web-server\private\dispatch-server-unit.rkt
> )))))
>
> Where is my mistake? :)
>
>>
>> Cheers,
>> Tobi
>
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client.rkt
Type: application/octet-stream
Size: 215 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20100923/d133f238/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: serve.rkt
Type: application/octet-stream
Size: 420 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20100923/d133f238/attachment-0001.obj>

Posted on the users mailing list.