日期:2014-05-17  浏览次数:20682 次

S2SH中如何暴露一个方法供别的系统调用,不用webservice
不用webservice,在s2sh框架想暴露一个方法给部署在一个服务器的另外一个系统调用,
用http的方法,例如http://192.168.22.22/test/test的http请求来调用,并且返回一个字符串就行了

谢谢
------解决方案--------------------
封装 http://192.168.22.22/test/test 的 servlet,返回一个字符串。
------解决方案--------------------
返回js的方式。    ajax  返回json   。然后url地址给别人。
------解决方案--------------------
url

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html>    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        <title>
            xxx
        </title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
        </script>
        <script type="text/javascript">
            jQuery(document).ready(function() {
                $.ajax({
                    type: "get",
                    async: false,
                    data: {                        
                    },
                    url: "http://www.geonames.org/postalCodeLookupJSON?postalcode=10504&country=US",
 
                    dataType: "jsonp",
                    jsonp: "callback",
                    success: function(json) {                        
                        for (var e in json.postalcodes[0]) {                       
                            document.write(e + "--->" + json.postalcodes[0][e]+"<br/>");