javax.jws.WebService类的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(637)

本文整理了Java中javax.jws.WebService类的一些代码示例,展示了WebService类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebService类的具体详情如下:
包路径:javax.jws.WebService
类名称:WebService

WebService介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

  1. /**
  2. * @author Juergen Hoeller
  3. */
  4. @WebService(serviceName="OrderService", portName="OrderService",
  5. endpointInterface = "org.springframework.remoting.jaxws.OrderService")
  6. public class OrderServiceImpl implements OrderService {
  7. @Resource
  8. private WebServiceContext webServiceContext;
  9. @Override
  10. public String getOrder(int id) throws OrderNotFoundException {
  11. Assert.notNull(this.webServiceContext, "WebServiceContext has not been injected");
  12. if (id == 0) {
  13. throw new OrderNotFoundException("Order 0 not found");
  14. }
  15. return "order " + id;
  16. }
  17. }

代码示例来源:origin: opensourceBIM/BIMserver

  1. public SService(SServicesMap servicesMap, SourceCodeFetcher sourceCodeFetcher, Class<? extends PublicInterface> interfaceClass) {
  2. this.servicesMap = servicesMap;
  3. this.sourceCodeFetcher = sourceCodeFetcher;
  4. this.interfaceClass = interfaceClass;
  5. this.nameSpace = interfaceClass.getAnnotation(WebService.class).targetNamespace();
  6. this.fullName = interfaceClass.getAnnotation(WebService.class).targetNamespace() + "." + interfaceClass.getAnnotation(WebService.class).name();
  7. this.simpleName = interfaceClass.getAnnotation(WebService.class).name();
  8. }

代码示例来源:origin: spring-projects/spring-framework

  1. String wsdl = ann.wsdlLocation();
  2. if (StringUtils.hasText(wsdl)) {
  3. try {
  4. String ns = ann.targetNamespace();
  5. if (StringUtils.hasText(ns)) {
  6. setNamespaceUri(ns);
  7. String sn = ann.serviceName();
  8. if (StringUtils.hasText(sn)) {
  9. setServiceName(sn);
  10. String pn = ann.portName();
  11. if (StringUtils.hasText(pn)) {
  12. setPortName(pn);

代码示例来源:origin: org.jboss.jbossts/jbossxts

  1. @WebService(targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", name = "ActivationPortType",
  2. @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
  3. @HandlerChain(file="/ws-c_handlers.xml")
  4. @Addressing(required=true)
  5. public class ActivationPortTypeImpl // implements ActivationPortType
  6. @Resource private WebServiceContext webServiceCtx;

代码示例来源:origin: org.openehealth.ipf.commons/ipf-commons-ihe-hpd

  1. @WebService(targetNamespace = "urn:ihe:iti:hpd:2010", name = "ProviderInformationDirectory_PortType", portName = "ProviderInformationDirectory_Port_Soap12")
  2. @XmlSeeAlso({ObjectFactory.class})
  3. @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
  4. public interface Iti58PortType {
  5. @WebMethod(operationName = "ProviderInformationQueryRequest")
  6. @Action(input = "urn:ihe:iti:2010:ProviderInformationQuery", output = "urn:ihe:iti:2010:ProviderInformationQueryResponse")
  7. @WebResult(name = "batchResponse", targetNamespace = "urn:oasis:names:tc:DSML:2:0:core", partName = "body")
  8. BatchResponse providerInformationQueryRequest(
  9. @WebParam(partName = "body", name = "batchRequest", targetNamespace = "urn:oasis:names:tc:DSML:2:0:core")
  10. BatchRequest body
  11. );
  12. }

代码示例来源:origin: citerus/dddsample-core

  1. /**
  2. * This class was generated by the JAX-WS RI.
  3. * JAX-WS RI 2.1.1 in JDK 6
  4. * Generated source version: 2.1
  5. *
  6. */
  7. @WebService(name = "HandlingReportService", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/")
  8. @XmlSeeAlso({
  9. ObjectFactory.class
  10. })
  11. public interface HandlingReportService {
  12. /**
  13. *
  14. * @param arg0
  15. * @throws HandlingReportErrors_Exception
  16. */
  17. @WebMethod
  18. @RequestWrapper(localName = "submitReport", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", className = "com.aggregator.SubmitReport")
  19. @ResponseWrapper(localName = "submitReportResponse", targetNamespace = "http://ws.handling.interfaces.dddsample.citerus.se/", className = "com.aggregator.SubmitReportResponse")
  20. public void submitReport(
  21. @WebParam(name = "arg0", targetNamespace = "")
  22. HandlingReport arg0)
  23. throws HandlingReportErrors_Exception
  24. ;
  25. }

代码示例来源:origin: spring-projects/spring-framework

  1. /**
  2. * @author Juergen Hoeller
  3. */
  4. @WebService
  5. @SOAPBinding(style = SOAPBinding.Style.RPC)
  6. public interface OrderService {
  7. String getOrder(int id) throws OrderNotFoundException;
  8. }

代码示例来源:origin: gmazza/blog-samples

  1. @WebService(targetNamespace = "http://www.example.org/contract/DoubleIt",
  2. portName = "DoubleItPort", serviceName = "DoubleItService",
  3. endpointInterface = "org.example.contract.doubleit.DoubleItPortType")
  4. @HandlerChain(file = "/handlers.xml")
  5. public class DoubleItPortTypeImpl implements DoubleItPortType {
  6. @Resource
  7. private WebServiceContext context;
  8. public int doubleIt(int numberToDouble) {
  9. HandlerUtils.printMessageContext("Web Service Provider", context.getMessageContext());
  10. // should fail (termOne has HANDLER scope)
  11. System.out.println("First Word: " + context.getMessageContext().get("termOne"));
  12. // should succeed (termTwo has APPLICATION scope)
  13. System.out.println("Second Word: " + context.getMessageContext().get("termTwo"));
  14. return numberToDouble * 2;
  15. }
  16. }

代码示例来源:origin: apache/cxf

  1. @WebService
  2. @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
  3. @Addressing(enabled = true, required = true)
  4. public interface EndToEndpoint {
  5. @Action(
  6. input = EventingConstants.ACTION_SUBSCRIPTION_END
  7. )
  8. void subscriptionEnd(@WebParam SubscriptionEnd subscriptionEnd);
  9. }

代码示例来源:origin: apache/cxf

  1. @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
  2. @Addressing(required = true, enabled = true)
  3. @XmlSeeAlso({
  4. org.apache.cxf.ws.mex.model._2004_09.ObjectFactory.class })
  5. @WebService(targetNamespace = "http://www.w3.org/2009/09/ws-mex")
  6. public interface MetadataExchange {
  7. @WebResult(name = "Metadata",
  8. targetNamespace = "http://schemas.xmlsoap.org/ws/2004/09/mex",
  9. partName = "body")
  10. @Action(input = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get",
  11. output = "http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse")
  12. @WebMethod(operationName = "Get2004")
  13. org.apache.cxf.ws.mex.model._2004_09.Metadata get2004();
  14. @WebResult(name = "Metadata",
  15. targetNamespace = "http://schemas.xmlsoap.org/ws/2004/09/mex",
  16. partName = "body")
  17. @Action(input = "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request",
  18. output = "http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Response")
  19. @WebMethod(operationName = "GetMetadata2004")
  20. org.apache.cxf.ws.mex.model._2004_09.Metadata getMetadata(
  21. @WebParam(partName = "body", name = "GetMetadata",
  22. targetNamespace = "http://schemas.xmlsoap.org/ws/2004/09/mex")
  23. org.apache.cxf.ws.mex.model._2004_09.GetMetadata body
  24. );
  25. }

代码示例来源:origin: apache/cxf

  1. @WebService(name = "Hello", serviceName = "HelloService", portName = "HelloPort",
  2. targetNamespace = "http://cxf.apache.org/systest/wsa/responses",
  3. endpointInterface = "org.apache.cxf.systest.ws.addr_responses.Hello")
  4. @Addressing(responses = Responses.NON_ANONYMOUS)
  5. public class HelloImpl implements Hello {
  6. public String sayHi(String arg0) {
  7. return "get" + arg0;
  8. }
  9. }

代码示例来源:origin: citerus/dddsample-core

  1. @WebService(endpointInterface = "com.aggregator.HandlingReportService")
  2. public class HandlingReportServiceImpl implements HandlingReportService {

代码示例来源:origin: org.apache.axis2/axis2-metadata

  1. public static WebServiceAnnot createFromAnnotation(Annotation annotation) {
  2. WebServiceAnnot returnAnnot = null;
  3. if (annotation != null && annotation instanceof javax.jws.WebService) {
  4. javax.jws.WebService ws = (javax.jws.WebService) annotation;
  5. return new WebServiceAnnot(ws.name(),
  6. ws.targetNamespace(),
  7. ws.serviceName(),
  8. ws.wsdlLocation(),
  9. ws.endpointInterface(),
  10. ws.portName());
  11. }
  12. return returnAnnot;
  13. }

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

  1. portName = wsAnnotations.get(x).portName();
  2. namespace = wsAnnotations.get(x).targetNamespace();
  3. name = wsAnnotations.get(x).name();

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

  1. String epi = webService.endpointInterface();
  2. if (epi.length() > 0) {
  3. try {
  4. String name = webService.name();
  5. if (name.length() == 0) {
  6. name = seiClass.getSimpleName();
  7. String tns = webService.targetNamespace();
  8. if (tns.isEmpty()) {
  9. tns = PackageUtils.getNamespace(PackageUtils.getPackageName(seiClass));

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

  1. && (!StringUtils.isEmpty(seiAnnotation.portName())
  2. || !StringUtils.isEmpty(seiAnnotation.serviceName())
  3. || !StringUtils.isEmpty(seiAnnotation.endpointInterface()))) {
  4. String expString = BUNDLE.getString("ILLEGAL_ATTRIBUTE_IN_SEI_ANNOTATION_EXC");
  5. throw new WebServiceException(expString);

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

  1. serviceName = wsAnnotations.get(x).serviceName();
  2. namespace = wsAnnotations.get(x).targetNamespace();

代码示例来源:origin: spring-projects/spring-framework

  1. @Override
  2. protected void publishEndpoint(Endpoint endpoint, WebService annotation) {
  3. endpoint.publish(buildHttpContext(endpoint, annotation.serviceName()));
  4. }

代码示例来源:origin: org.apache.openejb/openejb-core

  1. private static String getNameFromInterface(final Class<?> intf) {
  2. final WebService webService = intf.getAnnotation(WebService.class);
  3. if (webService != null) {
  4. return getName(intf, webService.name());
  5. }
  6. throw new IllegalArgumentException("The " + intf.getName() + " is not annotated");
  7. }

代码示例来源:origin: apache/cxf

  1. @SuppressWarnings({
  2. "unchecked", "rawtypes"
  3. })
  4. protected JAXBElement<?> convertToJAXBElement(Object evt) {
  5. final Class<?> eventClass = evt.getClass();
  6. String tns = endpointInterface.getAnnotation(WebService.class).targetNamespace();
  7. return new JAXBElement(new QName(tns, eventClass.getName()), eventClass, evt);
  8. }

相关文章