基本信息
源码名称:java调用webservice 例子源码(含服务端以及客户端源码)
源码大小:0.02M
文件格式:.zip
开发语言:Java
更新时间:2015-12-21
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
package com.hyan.client;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.1.6 in JDK 6
* Generated source version: 2.1
*
*/
@WebServiceClient(name = "ServiceHelloService", targetNamespace = "http://service.hyan.com/", wsdlLocation = "http://localhost:9001/Service/ServiceHello?wsdl")
public class ServiceHelloService
extends Service
{
private final static URL SERVICEHELLOSERVICE_WSDL_LOCATION;
private final static Logger logger = Logger.getLogger(com.hyan.client.ServiceHelloService.class.getName());
static {
URL url = null;
try {
URL baseUrl;
baseUrl = com.hyan.client.ServiceHelloService.class.getResource(".");
url = new URL(baseUrl, "http://localhost:9001/Service/ServiceHello?wsdl");
} catch (MalformedURLException e) {
logger.warning("Failed to create URL for the wsdl Location: 'http://localhost:9001/Service/ServiceHello?wsdl', retrying as a local file");
logger.warning(e.getMessage());
}
SERVICEHELLOSERVICE_WSDL_LOCATION = url;
}
public ServiceHelloService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public ServiceHelloService() {
super(SERVICEHELLOSERVICE_WSDL_LOCATION, new QName("http://service.hyan.com/", "ServiceHelloService"));
}
/**
*
* @return
* returns ServiceHello
*/
@WebEndpoint(name = "ServiceHelloPort")
public ServiceHello getServiceHelloPort() {
return super.getPort(new QName("http://service.hyan.com/", "ServiceHelloPort"), ServiceHello.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns ServiceHello
*/
@WebEndpoint(name = "ServiceHelloPort")
public ServiceHello getServiceHelloPort(WebServiceFeature... features) {
return super.getPort(new QName("http://service.hyan.com/", "ServiceHelloPort"), ServiceHello.class, features);
}
}