- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.codehaus.enunciate.contract.jaxws.WebMethod
类的一些代码示例,展示了WebMethod
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebMethod
类的具体详情如下:
包路径:org.codehaus.enunciate.contract.jaxws.WebMethod
类名称:WebMethod
[英]A method invoked on a web service.
[中]在web服务上调用的方法。
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
public Collection<WebMessagePart> getParts() {
ArrayList<WebMessagePart> parts = new ArrayList<WebMessagePart>();
for (WebParam webParam : this.webMethod.getWebParameters()) {
if ((webParam.isOutput()) && (!webParam.isHeader())) {
parts.add(webParam);
}
}
TypeMirror returnType = this.webMethod.getReturnType();
if (!(returnType instanceof VoidType)) {
parts.add(this.webMethod.getWebResult());
}
return parts;
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
protected Iterator<WebFault> getLoop(TemplateModel model) throws TemplateException {
WebMethod webMethod = this.webMethod;
if (webMethod == null) {
throw new MissingParameterException("webMethod");
}
return webMethod.getWebFaults().iterator();
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
/**
* The simple name of the method.
*
* @return The simple name of the method.
*/
public String getMessageName() {
return webMethod.getDeclaringEndpointInterface().getSimpleName() + "." + webMethod.getSimpleName();
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
/**
* Determine whether this web method is doc/lit wrapped.
*
* @return Whether this web method is doc/lit wrapped.
*/
public boolean isDocLitWrapped() {
return getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT &&
getSoapUse() == SOAPBinding.Use.LITERAL &&
getSoapParameterStyle() == SOAPBinding.ParameterStyle.WRAPPED;
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
/**
* This web parameter defines an implicit schema element if it is DOCUMENT binding style and either BARE or a header.
*
* @return Whether this web parameter is an implicit schema element.
*/
public boolean isImplicitSchemaElement() {
return isHeader() || (method.getSoapBindingStyle() != SOAPBinding.Style.RPC && method.getSoapParameterStyle() == SOAPBinding.ParameterStyle.BARE);
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
protected void addExplicitAnnotations(WebMethod webMethod, ClientClassnameForMethod conversion) {
String classname = conversion.convert(webMethod.getDeclaringEndpointInterface());
String methodName = webMethod.getSimpleName();
String methodKey = String.format("%s.%s", classname, methodName);
sbAnnotation.setStyle(webMethod.getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT ? SOAPBindingAnnotation.STYLE_DOCUMENT : SOAPBindingAnnotation.STYLE_RPC);
sbAnnotation.setParameterStyle(webMethod.getSoapParameterStyle() == SOAPBinding.ParameterStyle.BARE ? SOAPBindingAnnotation.PARAMETER_STYLE_BARE : SOAPBindingAnnotation.PARAMETER_STYLE_WRAPPED);
sbAnnotation.setUse(webMethod.getSoapUse() == SOAPBinding.Use.ENCODED ? SOAPBindingAnnotation.USE_ENCODED : SOAPBindingAnnotation.USE_LITERAL);
this.generatedAnnotations.method2SOAPBinding.put(methodKey, sbAnnotation);
wmAnnotation.setOperationName(webMethod.getOperationName());
wmAnnotation.setAction(webMethod.getAction());
this.generatedAnnotations.method2WebMethod.put(methodKey, wmAnnotation);
WebResult webResult = webMethod.getWebResult();
SerializableWebResultAnnotation wrAnnotation = new SerializableWebResultAnnotation();
wrAnnotation.setHeader(webResult.isHeader());
if (webMethod.isOneWay()) {
this.generatedAnnotations.oneWayMethods.add(methodKey);
for (WebMessage webMessage : webMethod.getMessages()) {
if (webMessage instanceof RequestWrapper) {
RequestWrapper requestWrapper = (RequestWrapper) webMessage;
for (WebParam webParam : webMethod.getWebParameters()) {
SerializableWebParamAnnotation wpAnnotation = new SerializableWebParamAnnotation();
wpAnnotation.setHeader(webParam.isHeader());
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
public ValidationResult validateWebMethod(WebMethod webMethod) {
ValidationResult result = new ValidationResult();
if (!webMethod.getModifiers().contains(Modifier.PUBLIC)) {
result.addError(webMethod.getPosition(), "A non-public method cannot be a web method.");
javax.jws.WebMethod annotation = webMethod.getAnnotation(javax.jws.WebMethod.class);
if ((annotation != null) && (annotation.exclude())) {
result.addError(webMethod.getPosition(), "A method marked as excluded cannot be a web method.");
if (webMethod.getSoapUse() == SOAPBinding.Use.ENCODED) {
result.addError(webMethod.getPosition(), "Enunciate doesn't support ENCODED-use web methods.");
boolean oneway = webMethod.isOneWay();
SOAPBinding.ParameterStyle parameterStyle = webMethod.getSoapParameterStyle();
SOAPBinding.Style soapBindingStyle = webMethod.getSoapBindingStyle();
if (oneway && (!(webMethod.getReturnType() instanceof VoidType))) {
result.addError(webMethod.getPosition(), "A one-way method must have a void return type.");
if (oneway && webMethod.getThrownTypes() != null && !webMethod.getThrownTypes().isEmpty()) {
result.addError(webMethod.getPosition(), "A one-way method can't throw any exceptions.");
result.addError(webMethod.getPosition(), "A BARE web method must have a DOCUMENT binding style.");
for (WebParam webParam : webMethod.getWebParameters()) {
if ((webParam.getMode() == javax.jws.WebParam.Mode.INOUT) && (!webParam.isHolder())) {
result.addError(webParam.getPosition(), "An INOUT parameter must have a type of javax.xml.ws.Holder");
for (WebMessage webMessage : webMethod.getMessages()) {
if (oneway && webMessage.isOutput()) {
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
this.annotation = getAnnotation(javax.jws.WebMethod.class);
this.oneWay = getAnnotation(Oneway.class) != null;
this.endpointInterface = endpointInterface;
TypeMirror returnType = getReturnType();
MapType mapType = MapTypeUtil.findMapType(returnType);
if (mapType != null) {
Collection<ParameterDeclaration> parameters = getParameters();
Collection<WebParam> webParameters = new ArrayList<WebParam>(parameters.size());
for (ParameterDeclaration parameter : parameters) {
for (ReferenceType referenceType : getThrownTypes()) {
if (!(referenceType instanceof DeclaredType)) {
throw new ValidationException(getPosition(), "Thrown type must be a declared type.");
throw new ValidationException(getPosition(), "Unknown declaration for " + referenceType);
SOAPBinding.Style bindingStyle = getSoapBindingStyle();
SOAPBinding.ParameterStyle parameterStyle = getSoapParameterStyle();
if (parameterStyle == SOAPBinding.ParameterStyle.WRAPPED) {
messages.add(new RequestWrapper(this));
if (!isOneWay()) {
messages.add(new ResponseWrapper(this));
if ((!isOneWay()) && (!(getReturnType() instanceof VoidType))) {
messages.add(webResult);
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
for (WebMessage webMessage : webMethod.getMessages()) {
if (webMessage instanceof RequestWrapper) {
javax.xml.ws.RequestWrapper annotation = webMethod.getAnnotation(javax.xml.ws.RequestWrapper.class);
if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) {
if (!webMethod.getDeclaringEndpointInterface().getTargetNamespace().equals(annotation.targetNamespace())) {
result.addError(webMethod.getPosition(), "Enunciate doesn't allow declaring a target namespace for a request wrapper that is different " +
"from the target namespace of the endpoint interface. If you really must, declare the parameter style BARE and use an xml root element from " +
"another namespace for the parameter.");
javax.xml.ws.ResponseWrapper annotation = webMethod.getAnnotation(javax.xml.ws.ResponseWrapper.class);
if ((annotation != null) && (annotation.targetNamespace() != null) && (!"".equals(annotation.targetNamespace()))) {
if (!webMethod.getDeclaringEndpointInterface().getTargetNamespace().equals(annotation.targetNamespace())) {
result.addError(webMethod.getPosition(), "Enunciate doesn't allow declaring a target namespace for a response wrapper that is " +
"different from the target namespace of the endpoint interface. If you really must, declare the parameter style BARE and use an xml root " +
"element from another namespace for the return value.");
WebMethod otherMethod = implicitElementNames.put(el.getElementName(), webMethod);
if (otherMethod != null) {
result.addError(webMethod.getPosition(), "Web method defines a message part named '" + el.getElementName() +
"' that is identical to the name of a web message part defined in " + otherMethod.getPosition() + ". Please use annotations to disambiguate.");
for (WebParam webParam : webMethod.getWebParameters()) {
javax.jws.WebParam annotation = webParam.getAnnotation(javax.jws.WebParam.class);
if ((annotation != null) && (!"".equals(annotation.targetNamespace()))) {
if (!annotation.targetNamespace().equals(webParam.getWebMethod().getDeclaringEndpointInterface().getTargetNamespace())) {
result.addError(webParam.getPosition(), "Enunciate doesn't allow declaring a target namespace for a web parameter that is different from the " +
代码示例来源:origin: org.codehaus.enunciate/enunciate-csharp
if (webMethod.getSoapBindingStyle() != SOAPBinding.Style.DOCUMENT || webMethod.getSoapUse() != SOAPBinding.Use.LITERAL) {
throw new TemplateModelException("No request document qname available for a " + webMethod.getSoapBindingStyle() + "/" + webMethod.getSoapUse() + " web method.");
if (webMethod.getRequestWrapper() != null) {
return new QName(webMethod.getRequestWrapper().getElementNamespace(), webMethod.getRequestWrapper().getElementName());
else if (webMethod.getSoapParameterStyle() == SOAPBinding.ParameterStyle.BARE) {
Collection<WebParam> params = webMethod.getWebParameters();
for (WebParam param : params) {
if (!param.isHeader()) {
return new QName(webMethod.getDeclaringEndpointInterface().getTargetNamespace(), param.getElementName());
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
/**
* Adds any type definitions referenced by a web method.
*
* @param webMethod The web method.
*/
protected void addReferencedTypeDefinitions(WebMethod webMethod) {
REFERENCE_STACK.get().addFirst("\"see also\" annotation");
addSeeAlsoTypeDefinitions(webMethod);
REFERENCE_STACK.get().removeFirst();
WebResult result = webMethod.getWebResult();
REFERENCE_STACK.get().addFirst("return type");
addReferencedTypeDefinitions(result.isAdapted() ? result.getAdapterType() : result.getType());
REFERENCE_STACK.get().removeFirst();
for (WebParam webParam : webMethod.getWebParameters()) {
REFERENCE_STACK.get().addFirst("parameter " + webParam.getSimpleName());
addReferencedTypeDefinitions(webParam.isAdapted() ? webParam.getAdapterType() : webParam.getType());
REFERENCE_STACK.get().removeFirst();
}
for (WebFault webFault : webMethod.getWebFaults()) {
REFERENCE_STACK.get().addFirst("thrown fault " + webFault.getSimpleName());
addReferencedTypeDefinitions(webFault);
REFERENCE_STACK.get().removeFirst();
}
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-csharp
/**
* Gets the client-side package for the type, type declaration, package, or their string values.
*
* @param list The arguments.
* @return The string value of the client-side package.
*/
public Object exec(List list) throws TemplateModelException {
if (list.size() < 1) {
throw new TemplateModelException("The responseDocumentQName method method must have a web method as a parameter.");
}
TemplateModel from = (TemplateModel) list.get(0);
Object unwrapped = BeansWrapper.getDefaultInstance().unwrap(from);
if (!(unwrapped instanceof WebMethod)) {
throw new TemplateModelException("A web method must be provided.");
}
WebMethod webMethod = (WebMethod) unwrapped;
if (webMethod.getSoapBindingStyle() != SOAPBinding.Style.DOCUMENT || webMethod.getSoapUse() != SOAPBinding.Use.LITERAL) {
throw new TemplateModelException("No response document qname available for a " + webMethod.getSoapBindingStyle() + "/" + webMethod.getSoapUse() + " web method.");
}
if (webMethod.getResponseWrapper() != null) {
return new QName(webMethod.getResponseWrapper().getElementNamespace(), webMethod.getResponseWrapper().getElementName());
}
else if (webMethod.getSoapParameterStyle() == SOAPBinding.ParameterStyle.BARE) {
WebResult wr = webMethod.getWebResult();
if (!wr.isHeader()) {
return new QName(wr.getTargetNamespace(), wr.getElementName());
}
}
return null;
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
TreeSet<WebFault> unvisitedFaults = new TreeSet<WebFault>(new ClassDeclarationComparator());
for (WebMethod webMethod : ei.getWebMethods()) {
for (WebMessage webMessage : webMethod.getMessages()) {
if (webMessage instanceof RequestWrapper) {
result.aggregate(validateRequestWrapper((RequestWrapper) webMessage, jaxwsBeans));
for (WebParam webParam : webMethod.getWebParameters()) {
if (webParam.getType() instanceof MapType) {
result.addError(webParam.getPosition(), "For some reason, JAXB doesn't support maps in return values or in parameters. Still need to investigate further the reason....");
if (webMethod.getWebResult().getType() instanceof MapType) {
result.addError(webMethod.getPosition(), "For some reason, JAXB doesn't support maps in return values or in parameters. Still need to investigate further the reason....");
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
if (!isSupported(webMethod.getWebResult())) {
result.addError(webMethod.getPosition(), "GWT doesn't support '" + webMethod.getWebResult() + "' as a return type.");
for (WebParam webParam : webMethod.getWebParameters()) {
if (!isSupported(webParam.getType())) {
result.addError(webParam.getPosition(), "GWT doesn't support '" + webParam.getType() + "' as a parameter type.");
allFaults.addAll(webMethod.getWebFaults());
代码示例来源:origin: org.codehaus.enunciate/enunciate-jaxws
TreeSet<WebFault> unvisitedFaults = new TreeSet<WebFault>(new TypeDeclarationComparator());
for (WebMethod webMethod : ei.getWebMethods()) {
for (WebMessage webMessage : webMethod.getMessages()) {
if (webMessage instanceof RequestWrapper) {
result.aggregate(validateRequestWrapper((RequestWrapper) webMessage, jaxwsBeans));
for (WebParam webParam : webMethod.getWebParameters()) {
if (webParam.getType() instanceof MapType) {
result.addError(webParam, "There's a bug in JAXB ruining support for maps in return values or in parameters. For more information, see " +
if (webMethod.getWebResult().getType() instanceof MapType) {
result.addError(webMethod, "There's a bug in JAXB ruining support for maps in return values or in parameters. For more information, see " +
"https://jaxb.dev.java.net/issues/show_bug.cgi?id=268 and http://forums.java.net/jive/thread.jspa?messageID=361990");
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
@Override
public ValidationResult validateEndpointInterface(EndpointInterface ei) {
ValidationResult result = super.validateEndpointInterface(ei);
if (!isAMFTransient(ei)) {
for (WebMethod webMethod : ei.getWebMethods()) {
if (!isAMFTransient(webMethod)) {
if (!isSupported(webMethod.getWebResult())) {
result.addError(webMethod.getPosition(), "AMF doesn't support '" + webMethod.getWebResult() + "' as a return type.");
}
for (WebParam webParam : webMethod.getWebParameters()) {
if (!isSupported(webParam.getType())) {
result.addError(webParam.getPosition(), "AMF doesn't support '" + webParam.getType() + "' as a parameter type.");
}
}
}
}
if (ei.getEndpointImplementations().size() > 1) {
ArrayList<String> impls = new ArrayList<String>();
for (EndpointImplementation impl : ei.getEndpointImplementations()) {
impls.add(impl.getQualifiedName());
}
result.addError(ei.getPosition(), "Sorry, AMF doesn't support two endpoint implementations for interface '" + ei.getQualifiedName() +
"'. Found " + ei.getEndpointImplementations().size() + " implementations (" + impls.toString() + ").");
}
}
return result;
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-csharp
Map<String, Declaration> paramsByName = new HashMap<String, Declaration>();
for (WebMethod webMethod : ei.getWebMethods()) {
for (WebParam webParam : webMethod.getWebParameters()) {
if (webMethod.getWebResult().isHeader()) {
Declaration conflict = paramsByName.put(webMethod.getWebResult().getElementName(), webMethod);
if (conflict != null) {
result.addError(webMethod, "C# requires that all header parameters defined in the same endpoint interface have unique names. " +
if (webMethod.getWebResult().getType() instanceof MapType) {
result.addError(webMethod, "C# can't handle types that are maps.");
if (capitalize(webMethod.getClientSimpleName()).equals(ei.getClientSimpleName())) {
result.addError(webMethod, "C# can't handle methods that are of the same name as their containing class. Either rename the method, or use the @org.codehaus.enunciate.ClientName annotation to rename the method (or type) on the client-side.");
代码示例来源:origin: org.codehaus.enunciate/enunciate-amf
for (WebMethod webMethod : ei.getWebMethods()) {
if (!isAMFTransient(webMethod)) {
if (!isSupported(webMethod.getWebResult())) {
result.addError(webMethod, "AMF doesn't support '" + webMethod.getWebResult() + "' as a return type.");
for (WebParam webParam : webMethod.getWebParameters()) {
if (!isSupported(webParam.getType())) {
result.addError(webParam, "AMF doesn't support '" + webParam.getType() + "' as a parameter type.");
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
@Override
public ValidationResult validateEndpointInterface(EndpointInterface ei) {
ValidationResult result = new ValidationResult();
HashSet<String> uniqueMethodNames = new HashSet<String>();
for (WebMethod webMethod : ei.getWebMethods()) {
if (!uniqueMethodNames.add(webMethod.getSimpleName())) {
result.addError(webMethod.getPosition(), "Sorry, the xfire client module doesn't support overloaded methods yet. Unfortunately, each method has " +
"to have a unique name.");
}
for (WebParam webParam : webMethod.getWebParameters()) {
if (webParam.isOutput()) {
//todo: add support for in in/out parameters.
result.addError(webParam.getPosition(), "The xfire client module doesn't support IN/OUT or OUT parameters yet....");
}
}
}
return result;
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
/**
* A set of the reference namespace for this method.
*
* @return A set of the reference namespace for this method.
*/
public Set<String> getReferencedNamespaces() {
HashSet<String> namespaces = new HashSet<String>();
Collection<WebMessage> messages = getMessages();
for (WebMessage message : messages) {
for (WebMessagePart part : message.getParts()) {
namespaces.add(part.getParticleQName().getNamespaceURI());
}
}
return namespaces;
}
我收到此错误消息: [WARNING] Ignoring: binding file "file:/home/jeusdi/projects/salut/hes/hes-visor-api-servi
查看来自 java.net 的 JAX-WS Maven 存储库 - http://download.java.net/maven/2/com/sun/xml/ws/ 有两个类似的文件夹 - jaxw
我正在使用 JAXWS 生成 Web 服务并使用 EndPoint.publish() 提供服务以及部署 war 文件,但是一旦它处理了 100 个请求,它就不会返回第 101 个请求回复。如何配置
我一直使用 wsimport 工具从 WSDL 文件生成客户端类。然后我将它们包含到项目的源代码树中,并将它们 checkin 版本控制系统。但最近我了解到有一个名为 jaxws-maven-plug
我尝试使用以下代码生成 java 类,但由于某些 gradle 插件问题而失败。 我搜索了一下,发现有很多插件可用于生成xsd类的java,但只有很少的插件用于生成代码形式wsdl.jaxb 是我想使
是否可能,如果可能,如何? 最佳答案 实际上,WebLogic 10.3 中捆绑的 JAX-WS 实现基于 JAX-WS RI 2.1.4,如 What's New in WebLogic Serve
由于 JAX-WS 依赖于 JAXB,并且由于我观察到在 JAX-B 引用实现中解压 XML bean 的代码,我猜没有区别并且 JAXWS 客户端总是返回一个空集合,即使 web 服务结果是空元素:
我有一个使用 Axis1 制作的可用 Web 服务,我正在将其迁移到 Jaxws 我正在使用 wsimport 和 maven 从我的工作 WSDL 文件创建客户端类。 我遇到的问题是,我可以在记录器
有人可以帮我吗? 我正在尝试连接 Web 服务;这是我的代码: public class test { static Logger logger = Logger.getLogger(test
这个问题在这里已经有了答案: How to change webservice url endpoint? (4 个回答) 关闭7年前。 如何动态更改我的 JAXWS 客户端正在使用的地址?此客户端由
我需要通过 SOAP Web 服务调用长时间运行的任务,在两端使用 JAXWS,特别是在两端使用 Apache CXF 2.6。 我看到我可以在 CXF 代码生成器中启用异步方法,它为每个操作创建两个
我在 maven 3 中使用 netbeans。当我尝试使用 jaxws-maven-plugin 进行编译时,出现以下错误。 这是我的 pom
我每次尝试使用 wsdl2java 工具时都会出现同样的错误。任何想法非常感谢-fe jaxbs 没有帮助。看起来找不到tools-plugin.xml。 15:18:37.618 [main] DE
我正在用Spring构建一个Web服务。我可以构建项目并将其部署到tomcat,但是当服务器启动时,出现以下错误: Invalid NamespaceHandler class [org.apache
我正在使用带有 JaxWS maven 插件的 NetBeans。我的应用程序有大约 5 个不同的 wsdls 我需要加载。我的问题是我想阻止 maven 或 wsimport 每次重新编译我的 ws
我有一个使用 JAX-WS 创建的 WebService,我编写了一个 JUnit 以通过以下方式连接到它: public class LicenseSvcClient { private s
我已经设置了一个 JAXWS 客户端并将一个 SoapHandler 实现添加到它的 Binding handlerChain。所有这一切都是为了在服务未正常运行时查看原始服务响应。 当一切正常时,我
我对编写网络服务相当陌生。我正在使用 JAXWS 开发 SOAP 服务。我希望能够让用户登录并在我的服务中知道哪个用户正在发出命令。换句话说,进行一些 session 处理。 我见过的一种方法是使用
您好,我已经编写了一个 WSDL 文件并生成了我的 Web 服务。我现在想像这样调用该服务: res = new UpdateCatalogWebService().getUpdateCatalogP
我使用 wsimport 从 wsdl 生成类。现在我正在解决缺少的依赖项,其中一些属于 javax.xml.ws:jaxws-api: 导入 javax.xml.ws.Service; 导入 jav
我是一名优秀的程序员,十分优秀!