所以我见过使用namespace和url编写的SOAP客户端程序
并在perl中使用uri和proxy,如下所示
python soap client
#!/usr/bin/python
import sys
from SOAPpy import SOAPProxy
option = sys.argv[1]
serverUrl='http://localhost:9000'
namespace='urn:/Date'
server = SOAPProxy(serverUrl, namespace)
response = server.dateInfo(option)
# read out the response
if (response == None):
print "Call returned error."
sys.exit(1)
print "Currently server date and time is " + responseperl soap client
#!perl -w
use SOAP::Lite;
$soap_response = SOAP::Lite
-> uri('http://www.soaplite.com/Demo')
-> proxy('http://services.soaplite.com/hibye.cgi')
-> languages();
@res = $soap_response->paramsout;
$res = $soap_response->result;
print "Result is $res, outparams are @res\n";在第一个程序中,名称空间是urn:/Date,在第二个程序中,uri是http://www.soaplite.com/Demo。
我知道uri和namespace是用来表示同一个名称空间的词,即SOAP用来注册服务的名称空间。
我的问题是,用于命名web服务的格式是urn:...还是http://...强制的,或者我是否可以简单地使用testwebservice之类的格式来注册web服务
发布于 2015-04-13 23:41:42
命名空间名称是绝对IRI。( IRI基本上是一个支持非ASCII字符的URI。)任何绝对IRI。方案(http、urn等)无关紧要。它不能是testwebservice,因为它不是有效的绝对IRI (或URI)。
名称空间名称仅用于标识目的。它不用于资源检索,所以使用返回404的HTTP IRI是非常好的。
https://stackoverflow.com/questions/29602172
复制相似问题