本文整理了Java中javax.jws.WebService
类的一些代码示例,展示了WebService
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebService
类的具体详情如下:
包路径:javax.jws.WebService
类名称:WebService
暂无
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Juergen Hoeller
*/
@WebService(serviceName="OrderService", portName="OrderService",
endpointInterface = "org.springframework.remoting.jaxws.OrderService")
public class OrderServiceImpl implements OrderService {
@Resource
private WebServiceContext webServiceContext;
@Override
public String getOrder(int id) throws OrderNotFoundException {
Assert.notNull(this.webServiceContext, "WebServiceContext has not been injected");
if (id == 0) {
throw new OrderNotFoundException("Order 0 not found");
}
return "order " + id;
}
}
代码示例来源:origin: opensourceBIM/BIMserver
public SService(SServicesMap servicesMap, SourceCodeFetcher sourceCodeFetcher, Class<? extends PublicInterface> interfaceClass) {
this.servicesMap = servicesMap;
this.sourceCodeFetcher = sourceCodeFetcher;
this.interfaceClass = interfaceClass;
this.nameSpace = interfaceClass.getAnnotation(WebService.class).targetNamespace();
this.fullName = interfaceClass.getAnnotation(WebService.class).targetNamespace() + "." + interfaceClass.getAnnotation(WebService.class).name();
this.simpleName = interfaceClass.getAnnotation(WebService.class).name();
}
代码示例来源:origin: spring-projects/spring-framework
String wsdl = ann.wsdlLocation();
if (StringUtils.hasText(wsdl)) {
try {
String ns = ann.targetNamespace();
if (StringUtils.hasText(ns)) {
setNamespaceUri(ns);
String sn = ann.serviceName();
if (StringUtils.hasText(sn)) {
setServiceName(sn);
String pn = ann.portName();
if (StringUtils.hasText(pn)) {
setPortName(pn);
代码示例来源:origin: org.jboss.jbossts/jbossxts
@WebService(targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", name = "ActivationPortType",
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@HandlerChain(file="/ws-c_handlers.xml")
@Addressing(required=true)
public class ActivationPortTypeImpl // implements ActivationPortType
@Resource private WebServiceContext webServiceCtx;
代码示例来源:origin: org.openehealth.ipf.commons/ipf-commons-ihe-hpd
@WebService(targetNamespace = "urn:ihe:iti:hpd:2010", name = "ProviderInformationDirectory_PortType", portName = "ProviderInformationDirectory_Port_Soap12")
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface Iti58PortType {
@WebMethod(operationName = "ProviderInformationQueryRequest")
@Action(input = "urn:ihe:iti:2010:ProviderInformationQuery", output = "urn:ihe:iti:2010:ProviderInformationQueryResponse")
@WebResult(name = "batchResponse", targetNamespace = "urn:oasis:names:tc:DSML:2:0:core", partName = "body")
BatchResponse providerInformationQueryRequest(
@WebParam(partName = "body", name = "batchRequest", targetNamespace = "urn:oasis:names:tc:DSML:2:0:core")
BatchRequest body
);
}
代码示例来源:origin: citerus/dddsample-core
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.1.1 in JDK 6
* Generated source version: 2.1
*
*/
@WebService(name = "HandlingReportService", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/")
@XmlSeeAlso({
ObjectFactory.class
})
public interface HandlingReportService {
/**
*
* @param arg0
* @throws HandlingReportErrors_Exception
*/
@WebMethod
@RequestWrapper(localName = "submitReport", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", className = "com.aggregator.SubmitReport")
@ResponseWrapper(localName = "submitReportResponse", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", className = "com.aggregator.SubmitReportResponse")
public void submitReport(
@WebParam(name = "arg0", targetNamespace = "")
HandlingReport arg0)
throws HandlingReportErrors_Exception
;
}
代码示例来源:origin: spring-projects/spring-framework
/**
* @author Juergen Hoeller
*/
@WebService
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface OrderService {
String getOrder(int id) throws OrderNotFoundException;
}
代码示例来源:origin: gmazza/blog-samples
@WebService(targetNamespace = "http://www.example.org/contract/DoubleIt",
portName = "DoubleItPort", serviceName = "DoubleItService",
endpointInterface = "org.example.contract.doubleit.DoubleItPortType")
@HandlerChain(file = "/handlers.xml")
public class DoubleItPortTypeImpl implements DoubleItPortType {
@Resource
private WebServiceContext context;
public int doubleIt(int numberToDouble) {
HandlerUtils.printMessageContext("Web Service Provider", context.getMessageContext());
// should fail (termOne has HANDLER scope)
System.out.println("First Word: " + context.getMessageContext().get("termOne"));
// should succeed (termTwo has APPLICATION scope)
System.out.println("Second Word: " + context.getMessageContext().get("termTwo"));
return numberToDouble * 2;
}
}
代码示例来源:origin: apache/cxf
@WebService
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@Addressing(enabled = true, required = true)
public interface EndToEndpoint {
@Action(
input = EventingConstants.ACTION_SUBSCRIPTION_END
)
void subscriptionEnd(@WebParam SubscriptionEnd subscriptionEnd);
}
代码示例来源:origin: apache/cxf
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@Addressing(required = true, enabled = true)
@XmlSeeAlso({
org.apache.cxf.ws.mex.model._2004_09.ObjectFactory.class })
@WebService(targetNamespace = "http://www.w3.org/2009/09/ws-mex")
public interface MetadataExchange {
@WebResult(name = "Metadata",
targetNamespace = "http://schemas.xmlsoap.org/ws/2004/09/mex",
partName = "body")
@Action(input = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get",
output = "http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse")
@WebMethod(operationName = "Get2004")
org.apache.cxf.ws.mex.model._2004_09.Metadata get2004();
@WebResult(name = "Metadata",
targetNamespace = "http://schemas.xmlsoap.org/ws/2004/09/mex",
partName = "body")
@Action(input = "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request",
output = "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Response")
@WebMethod(operationName = "GetMetadata2004")
org.apache.cxf.ws.mex.model._2004_09.Metadata getMetadata(
@WebParam(partName = "body", name = "GetMetadata",
targetNamespace = "http://schemas.xmlsoap.org/ws/2004/09/mex")
org.apache.cxf.ws.mex.model._2004_09.GetMetadata body
);
}
代码示例来源:origin: apache/cxf
@WebService(name = "Hello", serviceName = "HelloService", portName = "HelloPort",
targetNamespace = "http://cxf.apache.org/systest/wsa/responses",
endpointInterface = "org.apache.cxf.systest.ws.addr_responses.Hello")
@Addressing(responses = Responses.NON_ANONYMOUS)
public class HelloImpl implements Hello {
public String sayHi(String arg0) {
return "get" + arg0;
}
}
代码示例来源:origin: citerus/dddsample-core
@WebService(endpointInterface = "com.aggregator.HandlingReportService")
public class HandlingReportServiceImpl implements HandlingReportService {
代码示例来源:origin: org.apache.axis2/axis2-metadata
public static WebServiceAnnot createFromAnnotation(Annotation annotation) {
WebServiceAnnot returnAnnot = null;
if (annotation != null && annotation instanceof javax.jws.WebService) {
javax.jws.WebService ws = (javax.jws.WebService) annotation;
return new WebServiceAnnot(ws.name(),
ws.targetNamespace(),
ws.serviceName(),
ws.wsdlLocation(),
ws.endpointInterface(),
ws.portName());
}
return returnAnnot;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
portName = wsAnnotations.get(x).portName();
namespace = wsAnnotations.get(x).targetNamespace();
name = wsAnnotations.get(x).name();
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
String epi = webService.endpointInterface();
if (epi.length() > 0) {
try {
String name = webService.name();
if (name.length() == 0) {
name = seiClass.getSimpleName();
String tns = webService.targetNamespace();
if (tns.isEmpty()) {
tns = PackageUtils.getNamespace(PackageUtils.getPackageName(seiClass));
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
&& (!StringUtils.isEmpty(seiAnnotation.portName())
|| !StringUtils.isEmpty(seiAnnotation.serviceName())
|| !StringUtils.isEmpty(seiAnnotation.endpointInterface()))) {
String expString = BUNDLE.getString("ILLEGAL_ATTRIBUTE_IN_SEI_ANNOTATION_EXC");
throw new WebServiceException(expString);
代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws
serviceName = wsAnnotations.get(x).serviceName();
namespace = wsAnnotations.get(x).targetNamespace();
代码示例来源:origin: spring-projects/spring-framework
@Override
protected void publishEndpoint(Endpoint endpoint, WebService annotation) {
endpoint.publish(buildHttpContext(endpoint, annotation.serviceName()));
}
代码示例来源:origin: org.apache.openejb/openejb-core
private static String getNameFromInterface(final Class<?> intf) {
final WebService webService = intf.getAnnotation(WebService.class);
if (webService != null) {
return getName(intf, webService.name());
}
throw new IllegalArgumentException("The " + intf.getName() + " is not annotated");
}
代码示例来源:origin: apache/cxf
@SuppressWarnings({
"unchecked", "rawtypes"
})
protected JAXBElement<?> convertToJAXBElement(Object evt) {
final Class<?> eventClass = evt.getClass();
String tns = endpointInterface.getAnnotation(WebService.class).targetNamespace();
return new JAXBElement(new QName(tns, eventClass.getName()), eventClass, evt);
}
内容来源于网络,如有侵权,请联系作者删除!