Spring-Cloud SOA面向服务架构(一个简单的例子)

版权声明:版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_42248764/article/details/84668946

什么是SOA

在这里插入图片描述

玩法

  • 新建一个java项目

  • 点击右键选择 web Service Client 服务
    在这里插入图片描述

  • 这里选择WSDL地址,点击下一步自动生成代码
    在这里插入图片描述

  • 调用main方法测试,这里测试的是国内手机号码归属地查询WEB服务

  • 网址:WEB服务

public static void main(String[] args) throws ServiceException, RemoteException {
		MobileCodeWSLocator  mcs = new MobileCodeWSLocator();
		MobileCodeWSSoap mcss = mcs.getMobileCodeWSSoap();
		String mobileCodeInfo = mcss.getMobileCodeInfo("xxxxxxx", null);  
		System.out.println(mobileCodeInfo);
	}

    
    
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 测试效果如下
十一月 30, 2018 10:56:07 上午 org.apache.axis.utils.JavaUtils isAttachmentSupported
警告: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
xxxxxxx:湖南 长沙 湖南联通GSM卡

    
    
  • 1
  • 2
  • 3
        </div>
					<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-a47e74522c.css" rel="stylesheet">
            </div>

什么是SOA

在这里插入图片描述

玩法

  • 新建一个java项目

  • 点击右键选择 web Service Client 服务
    在这里插入图片描述

  • 这里选择WSDL地址,点击下一步自动生成代码
    在这里插入图片描述

  • 调用main方法测试,这里测试的是国内手机号码归属地查询WEB服务

    扫描二维码关注公众号,回复: 4560411 查看本文章
  • 网址:WEB服务

public static void main(String[] args) throws ServiceException, RemoteException {
		MobileCodeWSLocator  mcs = new MobileCodeWSLocator();
		MobileCodeWSSoap mcss = mcs.getMobileCodeWSSoap();
		String mobileCodeInfo = mcss.getMobileCodeInfo("xxxxxxx", null);  
		System.out.println(mobileCodeInfo);
	}

  
  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 测试效果如下
十一月 30, 2018 10:56:07 上午 org.apache.axis.utils.JavaUtils isAttachmentSupported
警告: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
xxxxxxx:湖南 长沙 湖南联通GSM卡

  
  
  • 1
  • 2
  • 3
        </div>
					<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-a47e74522c.css" rel="stylesheet">
            </div>

猜你喜欢

转载自blog.csdn.net/weixin_42248764/article/details/84668946
今日推荐