热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

javax.xml.ws.ServiceMode.()方法的使用及代码示例

本文整理了Java中javax.xml.ws.ServiceMode.()方法的一些代码示例,展示了ServiceMode.()的具体用法。这些代码示例主要来源于Github/Stackoverflo

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

ServiceMode.介绍

暂无

代码示例

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

@ServiceMode(value = Service.Mode.MESSAGE)
public class DOMMessageProvider extends AbstractDOMProvider implements Provider {
public DOMMessageProvider(Scriptable scope, Scriptable wspVar,
String epAddr, boolean isBaseAddr, boolean e4x) {
super(scope, wspVar, epAddr, isBaseAddr, e4x);
}
}

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

@ServiceMode(value = Service.Mode.MESSAGE)
public class DOMMessageProvider extends AbstractDOMProvider implements Provider {
public DOMMessageProvider(Scriptable scope, Scriptable wspVar,
String epAddr, boolean isBaseAddr, boolean e4x) {
super(scope, wspVar, epAddr, isBaseAddr, e4x);
}
}

代码示例来源:origin: org.apache.camel/camel-cxf

@WebServiceProvider(targetNamespace = "http://camel.apache.org/cxf/jaxws/provider")
@ServiceMode (value = javax.xml.ws.Service.Mode.PAYLOAD)
public interface DefaultPayloadProviderSEI extends Provider {
Source invoke(Source request);
}

代码示例来源:origin: com.carecon.fabric3/fabric3-binding-ws

/**
*
*/
@ServiceMode(value = Service.Mode.MESSAGE)
@WebServiceProvider()
public class F3Provider implements Provider {
public SOAPMessage invoke(SOAPMessage request) {
throw new UnsupportedOperationException();
}
}

代码示例来源:origin: org.fabric3/fabric3-binding-ws-metro

/**
*
*/
@ServiceMode(value = Service.Mode.MESSAGE)
@WebServiceProvider()
public class F3Provider implements Provider {
public SOAPMessage invoke(SOAPMessage request) {
throw new UnsupportedOperationException();
}
}

代码示例来源:origin: org.apache.camel/camel-example-cxf

@WebServiceProvider()
@ServiceMode(Mode.MESSAGE)
// END SNIPPET: e1
/**
* This class is used by Camel just for getting the endpoint configuration
* parameters. All the requests aimed at this class are intercepted and routed
* to the camel route specified. The route has to set the appropriate response
* message for the service to work.
*/
// START SNIPPET: e2
public class GreeterProvider implements Provider {
public SOAPMessage invoke(SOAPMessage message) {
// Requests should not come here as the Camel route will
// intercept the call before this is invoked.
throw new UnsupportedOperationException("Placeholder method");
}
}
// END SNIPPET: e2

代码示例来源:origin: org.apache.cxf/cxf-testutils

@WebServiceProvider(portName = "SoapPort", serviceName = "SOAPService",
targetNamespace = "http://apache.org/hello_world_soap_http",
wsdlLocation = "wsdl/hello_world.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
public class HWSoapMessageProvider implements Provider {
//private static final Logger LOG =
// Logger.getLogger(AnnotatedGreeterImpl.class.getName());
private int invokeCount;
public HWSoapMessageProvider() {
//Complete
}
public SOAPMessage invoke(SOAPMessage source) {
invokeCount++;
return source;
}
public int getInvokeCount() {
return invokeCount;
}
}

代码示例来源:origin: org.objectweb.celtix/celtix-testutils

@WebServiceProvider(portName = "SoapPort", serviceName = "SOAPService",
targetNamespace = "http://objectweb.org/hello_world_soap_http",
wsdlLocation = "resources/wsdl/hello_world.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
public class HelloWorldServiceProvider implements Provider {
//private static final Logger LOG =
// Logger.getLogger(AnnotatedGreeterImpl.class.getName());
private int invokeCount;

public HelloWorldServiceProvider() {
//Complete
}
public DOMSource invoke(DOMSource source) {
invokeCount++;
return source;
}

public int getInvokeCount() {
return invokeCount;
}
}

代码示例来源:origin: org.objectweb.celtix/celtix-testutils

@WebServiceProvider(portName = "SoapPort", serviceName = "SOAPService",
targetNamespace = "http://objectweb.org/hello_world_soap_http",
wsdlLocation = "resources/wsdl/hello_world.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
public class HWSoapMessageProvider implements Provider {
//private static final Logger LOG =
// Logger.getLogger(AnnotatedGreeterImpl.class.getName());
private int invokeCount;

public HWSoapMessageProvider() {
//Complete
}
public SOAPMessage invoke(SOAPMessage source) {
invokeCount++;
return source;
}

public int getInvokeCount() {
return invokeCount;
}
}

代码示例来源:origin: org.apache.cxf/cxf-testutils

@WebServiceProvider(portName = "SoapPort", serviceName = "SOAPService",
targetNamespace = "http://apache.org/hello_world_soap_http",
wsdlLocation = "resources/wsdl/hello_world.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
public class HelloWorldServiceProvider implements Provider {
//private static final Logger LOG =
// Logger.getLogger(AnnotatedGreeterImpl.class.getName());
private int invokeCount;
public HelloWorldServiceProvider() {
//Complete
}
public DOMSource invoke(DOMSource source) {
invokeCount++;
return source;
}
public int getInvokeCount() {
return invokeCount;
}
}

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

@javax.xml.ws.WebServiceProvider(serviceName = "NullService",
portName = "NullPort")
@javax.xml.ws.ServiceMode(value = javax.xml.ws.Service.Mode.PAYLOAD)
public static class NullProviderService implements Provider {
public Source invoke(Source request) {
return null;
}
}

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

@WebServiceProvider(targetNamespace = "http://www.example.org/contract/DoubleIt",
portName = "DoubleItFaultPortSignThenEncrypt",
serviceName = "DoubleItService",
wsdlLocation = "classpath:/org/apache/cxf/systest/ws/security/DoubleIt.wsdl")
@ServiceMode(value = Mode.MESSAGE)
public static class DoubleItFaultProvider implements Provider {
public SOAPMessage invoke(SOAPMessage request) {
try {
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage msg = messageFactory.createMessage();
msg.getSOAPBody().addFault(new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server"),
"Foo");
return msg;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

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

@WebServiceProvider
@ServiceMode(value = Service.Mode.PAYLOAD)
public class AsyncEchoProvider implements Provider {
@Override
@UseAsyncMethod
public StreamSource invoke(StreamSource request) {
throw new RuntimeException("Should be async");
}
public Future invokeAsync(final StreamSource s, final AsyncHandler asyncHandler) {
final ServerAsyncResponse r = new ServerAsyncResponse<>();
new Thread() {
public void run() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// ignore
}
r.set(s);
asyncHandler.handleResponse(r);
}
} .start();
return r;
}
}

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

@WebServiceProvider(serviceName = "AddNumbersService",
portName = "AddNumbersOnlyAnonPort",
targetNamespace = "http://apache.org/cxf/systest/ws/addr_feature/",
wsdlLocation = "/wsdl_systest_wsspec/add_numbers.wsdl")
@ServiceMode(Mode.PAYLOAD)
public static class AddNumberProvider implements Provider {
public Source invoke(Source obj) {
//CHECK the incoming
Element el;
try {
el = StaxUtils.read(obj).getDocumentElement();
} catch (Exception e) {
throw new RuntimeException(e);
}
Map ns = new HashMap<>();
ns.put("ns", "http://apache.org/cxf/systest/ws/addr_feature/");
XPathUtils xp = new XPathUtils(ns);
String o = (String)xp.getValue("/ns:addNumbers/ns:number1", el, XPathConstants.STRING);
String o2 = (String)xp.getValue("/ns:addNumbers/ns:number2", el, XPathConstants.STRING);
int i = Integer.parseInt(o);
int i2 = Integer.parseInt(o2);
String resp = ""
+ "" + (i + i2) + "
";
return new StreamSource(new StringReader(resp));
}
}

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

@WebServiceProvider(targetNamespace = "http://www.example.org/contract/DoubleIt",
portName = "DoubleItPortSignThenEncrypt",
serviceName = "DoubleItService",
wsdlLocation = "classpath:/org/apache/cxf/systest/ws/security/DoubleIt.wsdl")
@ServiceMode(value = Mode.PAYLOAD)
public static class DoubleItProvider implements Provider {
public Source invoke(Source obj) {
//CHECK the incoming
Node el;
try {
el = StaxUtils.read(obj);
} catch (Exception e) {
throw new RuntimeException(e);
}
if (el instanceof Document) {
el = ((Document)el).getDocumentElement();
}
Map ns = new HashMap<>();
ns.put("ns2", "http://www.example.org/schema/DoubleIt");
XPathUtils xp = new XPathUtils(ns);
String o = (String)xp.getValue("//ns2:DoubleIt/numberToDouble", el, XPathConstants.STRING);
int i = Integer.parseInt(o);
String req = ""
+ "" + Integer.toString(i * 2) + "
";
return new StreamSource(new StringReader(req));
}
}

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

@WebServiceProvider(portName = "SoapProviderPort", serviceName = "SOAPProviderService",
targetNamespace = "http://apache.org/hello_world_soap_http")
@ServiceMode(value = Service.Mode.MESSAGE)
public class NBSoapMessageDocProvider implements Provider {
private SOAPMessage sayHiResponse;

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

@WebServiceProvider(serviceName = "HelloProviderService",
portName = "HelloProviderPort",
targetNamespace = "http://apache.org/hello_world_xml_http/bare")
@BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING)
@ServiceMode(value = javax.xml.ws.Service.Mode.PAYLOAD)
public class GreeterProvider implements Provider {
public Source invoke(Source req) {
return new StreamSource();
}
}
}

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

@WebServiceProvider(wsdlLocation = "classpath:/wsdl/schema_validation.wsdl",
serviceName = "SchemaValidationService",
portName = "SoapPort",
targetNamespace = "http://apache.org/schema_validation")
@ServiceMode(Service.Mode.MESSAGE)
@SchemaValidation
static class MessageProvider implements Provider {
@Override
public Source invoke(Source request) {
try {
Document doc = StaxUtils.read(request);
Element el = DOMUtils.getFirstElement(doc.getDocumentElement());
while (!"Body".equals(el.getLocalName())) {
el = DOMUtils.getNextElement(el);
}
el = DOMUtils.getFirstElement(el);
String name = el.getLocalName();
if ("SomeRequest".equals(name)) {
String v = DOMUtils.getFirstElement(el).getTextContent();
return new StreamSource(
new StringReader(""
+ "" + getResponse(v) + "
"));
}
} catch (XMLStreamException ex) {
ex.printStackTrace();
}
return null;
}
}

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

@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http")
@ServiceMode(value = javax.xml.ws.Service.Mode.PAYLOAD)
@WebServiceProvider(targetNamespace = "http://cxf.apache.org/", serviceName = "HelloWS", portName = "hello")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@EndpointProperties(value = {
@EndpointProperty(key = "schema-validation-enabled", value = "true"),
@EndpointProperty(key = "mtom-enabled", value = "true")
})
public class TestProvider implements Provider {
private String successRsp = ""
+ "Hello CXF" + "
";
public SAXSource invoke(SAXSource request) {
return new SAXSource(new InputSource(new StringReader(successRsp)));
}
}

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

@WebServiceProvider(wsdlLocation = "classpath:/wsdl/schema_validation.wsdl",
serviceName = "SchemaValidationService",
portName = "SoapPort",
targetNamespace = "http://apache.org/schema_validation")
@ServiceMode(Service.Mode.PAYLOAD)
@SchemaValidation
@Logging
static class PayloadProvider implements Provider {
@Override
public Source invoke(Source request) {
try {
Document doc = StaxUtils.read(request);
String name = doc.getDocumentElement().getLocalName();
if ("SomeRequest".equals(name)) {
String v = DOMUtils.getFirstElement(doc.getDocumentElement()).getTextContent();
return new StreamSource(new StringReader(getResponse(v)));
}
} catch (XMLStreamException e) {
e.printStackTrace();
}
return null;
}
}

推荐阅读
  • 本文介绍了如何使用C#制作Java+Mysql+Tomcat环境安装程序,实现一键式安装。通过将JDK、Mysql、Tomcat三者制作成一个安装包,解决了客户在安装软件时的复杂配置和繁琐问题,便于管理软件版本和系统集成。具体步骤包括配置JDK环境变量和安装Mysql服务,其中使用了MySQL Server 5.5社区版和my.ini文件。安装方法为通过命令行将目录转到mysql的bin目录下,执行mysqld --install MySQL5命令。 ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • 开发笔记:Java是如何读取和写入浏览器Cookies的
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了Java是如何读取和写入浏览器Cookies的相关的知识,希望对你有一定的参考价值。首先我 ... [详细]
  • Imtryingtofigureoutawaytogeneratetorrentfilesfromabucket,usingtheAWSSDKforGo.我正 ... [详细]
  • Java实战之电影在线观看系统的实现
    本文介绍了Java实战之电影在线观看系统的实现过程。首先对项目进行了简述,然后展示了系统的效果图。接着介绍了系统的核心代码,包括后台用户管理控制器、电影管理控制器和前台电影控制器。最后对项目的环境配置和使用的技术进行了说明,包括JSP、Spring、SpringMVC、MyBatis、html、css、JavaScript、JQuery、Ajax、layui和maven等。 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction ... [详细]
  • http:my.oschina.netleejun2005blog136820刚看到群里又有同学在说HTTP协议下的Get请求参数长度是有大小限制的,最大不能超过XX ... [详细]
  • 在重复造轮子的情况下用ProxyServlet反向代理来减少工作量
    像不少公司内部不同团队都会自己研发自己工具产品,当各个产品逐渐成熟,到达了一定的发展瓶颈,同时每个产品都有着自己的入口,用户 ... [详细]
  • 个人学习使用:谨慎参考1Client类importcom.thoughtworks.gauge.Step;importcom.thoughtworks.gauge.T ... [详细]
  • springmvc学习笔记(十):控制器业务方法中通过注解实现封装Javabean接收表单提交的数据
    本文介绍了在springmvc学习笔记系列的第十篇中,控制器的业务方法中如何通过注解实现封装Javabean来接收表单提交的数据。同时还讨论了当有多个注册表单且字段完全相同时,如何将其交给同一个控制器处理。 ... [详细]
  • flowable工作流 流程变量_信也科技工作流平台的技术实践
    1背景随着公司业务发展及内部业务流程诉求的增长,目前信息化系统不能够很好满足期望,主要体现如下:目前OA流程引擎无法满足企业特定业务流程需求,且移动端体 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
author-avatar
samiensfe_663
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有