Drkcore

13 12 2006 SOAP Tweet

SOAPなのに異種言語間で躓く

perl同士だと、うまく通信できてんのにpythonのクライアントだとこける。
が、原因がさっぱしわからん。

サーバー

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#!/usr/bin/perl -w

use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI   
  -> dispatch_to('Demo')     
  -> handle;

package Demo;

sub hi {                     
  return "hello, world";     
}

1;

perlクライアント

1
2
3
4
5
6
7
8
9
#!/usr/bin/perl -w

use SOAP::Lite;

print SOAP::Lite
  -> uri('http://localhost/Demo')
  -> proxy('http://localhost/cgi-bin/soap.cgi')
  -> hi()
  -> result;

でうまく動くのに、Dive into python 12章を参考にしたpythonクライアントは動かん。

>>> from SOAPpy import SOAPProxy
>>> server = SOAPProxy('http://localhost/cgi-bin/soap.cgi',namespace='urn:Demo')
>>> server.hi()

で実行すると、下のエラー

SOAPpy.Types.faultType: \
<Fault soap:Client: SOAPAction shall match 'uri#method' \ 
if present (got 'hi', expected 'urn:Demo#hi'

もうすこし、ちゃんと理解しないといけないなぁ。

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021