Webservice Mobile Phone Number Search

本文介绍了如何利用Webxml接口和CXF工具进行WebService调用。首先,了解Webxml用于查询手机号码归属地的接口。然后,下载并使用CXF将WSDL转换为Java代码。通过示例展示了如何创建Java客户端,调用getMobileCodeInfo方法查询指定号码的归属地,最后验证了查询操作的成功。
摘要由CSDN通过智能技术生成

1 Conditions

1. Webxml

Firstly , you should know this web : Webxml

2.CXF

Secondly,you are supposed to down a file that is called CXF from this web :CXF

3.How to use ?

3-1 Webxml is an interface to search mobile phone number where is from ?
3-2 CXF is a tool to trans wsdl to java . So you are supposed to know this instruct : wsdl2java.

2 Example

1. Visit Webxml

http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL

在这里插入图片描述

2. WSDL2JAVA

  1. use this instruct under the bin mkdir :
http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL

在这里插入图片描述
2. into the bin mkdir , you can see this file , copy it to your project 在这里插入图片描述

在这里插入图片描述

3 Client

package cn.com.client;
import cn.com.webxml.MobileCodeWS;
import cn.com.webxml.MobileCodeWSSoap;
public class ClientMain {

	public static void main(String[] args) {
	         //创建一个MobileCodeWS工厂
	         MobileCodeWS factory = new MobileCodeWS();
	         //根据工厂创建一个MobileCodeWSSoap对象
	         MobileCodeWSSoap mobileCodeWSSoap = factory.getMobileCodeWSSoap();
	         //调用WebService提供的getMobileCodeInfo方法查询手机号码的归属地
	         String searchResult = mobileCodeWSSoap.getMobileCodeInfo("number", null);
	         System.out.println(searchResult);
	     }
	}


Visit it is OK !

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

PY_XAT_SFZL

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值