Subversion Repositories XServices

Rev

Rev 127 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 127 Rev 177
1
/*
1
/*
2
 *   Copyright 2012 Brian Rosenberger (Brutex Network)
2
 *   Copyright 2012 Brian Rosenberger (Brutex Network)
3
 *
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
6
 *   You may obtain a copy of the License at
7
 *
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
14
 *   limitations under the License.
15
 */
15
 */
16
 
16
 
17
package net.brutex.xservices.ws;
17
package net.brutex.xservices.ws;
18
 
18
 
19
import javax.jws.WebMethod;
19
import javax.jws.WebMethod;
20
import javax.jws.WebParam;
20
import javax.jws.WebParam;
21
import javax.jws.WebService;
21
import javax.jws.WebService;
22
import javax.xml.bind.annotation.XmlElement;
22
import javax.xml.bind.annotation.XmlElement;
23
 
23
 
24
import net.brutex.xservices.types.AttributeType;
24
import net.brutex.xservices.types.AttributeType;
25
import net.brutex.xservices.types.NamespaceListType;
25
import net.brutex.xservices.types.NamespaceListType;
26
import net.brutex.xservices.types.StringSplitType;
26
import net.brutex.xservices.types.StringSplitType;
27
import net.brutex.xservices.types.ant.FileResource;
27
import net.brutex.xservices.types.ant.FileResource;
28
 
28
 
29
import org.apache.cxf.annotations.WSDLDocumentation;
29
import org.apache.cxf.annotations.WSDLDocumentation;
-
 
30
import org.apache.shiro.authz.annotation.RequiresPermissions;
30
 
31
 
31
/**
32
/**
32
 * @author Brian Rosenberger, bru(at)brutex.de
33
 * @author Brian Rosenberger, bru(at)brutex.de
33
 *
34
 *
34
 */
35
 */
35
@WebService(targetNamespace="http://ws.xservices.brutex.net")
36
@WebService(targetNamespace="http://ws.xservices.brutex.net")
36
public abstract interface XmlService
37
public abstract interface XmlService
37
{
38
{
38
  public static final String SERVICE_NAME = "XmlService";
39
  public static final String SERVICE_NAME = "XmlService";
39
  public static final String OPERATION_APPENDTO = "appendTo";
40
  public static final String OPERATION_APPENDTO = "appendTo";
40
  public static final String OPERATION_REPLACE = "replaceNode";
41
  public static final String OPERATION_REPLACE = "replaceNode";
41
  public static final String PARAM_XPATH = "xpath";
42
  public static final String PARAM_XPATH = "xpath";
42
  public static final String PARAM_XML = "xmldata";
43
  public static final String PARAM_XML = "xmldata";
-
 
44
 
43
 
45
  @RequiresPermissions("insertNodes")
44
  @WebMethod(operationName="insertNodes")
46
  @WebMethod(operationName="insertNodes")
45
  @WSDLDocumentation("Insert an XML fragment into an XML document given as string.")
47
  @WSDLDocumentation("Insert an XML fragment into an XML document given as string.")
46
  public abstract String insertNodes(
48
  public abstract String insertNodes(
47
		  @WebParam(name="sourcexml") String source, 
49
		  @WebParam(name="sourcexml") String source, 
48
		  @WebParam(name="encoding") String encoding,
50
		  @WebParam(name="encoding") String encoding,
49
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
51
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
50
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1, 
52
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1, 
51
		  @WebParam(name="xmldata") String paramString2)
53
		  @WebParam(name="xmldata") String paramString2)
52
    throws XServicesFault;
54
    throws XServicesFault;
53
  
55
  
54
  @WebMethod(operationName="insertNodes2")
56
  @WebMethod(operationName="insertNodes2")
55
  @WSDLDocumentation("Insert an XML fragment into an XML document given as file.")
57
  @WSDLDocumentation("Insert an XML fragment into an XML document given as file.")
56
  public abstract String insertNodesFromFile(
58
  public abstract String insertNodesFromFile(
57
		  @WebParam(name="file") FileResource paramFileResource, 
59
		  @WebParam(name="file") FileResource paramFileResource, 
58
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
60
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
59
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1, 
61
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1, 
60
		  @WebParam(name="xmldata") String paramString2)
62
		  @WebParam(name="xmldata") String paramString2)
61
    throws XServicesFault;
63
    throws XServicesFault;
62
  
64
  
63
  @WebMethod(operationName="replaceNodes")
65
  @WebMethod(operationName="replaceNodes")
64
  @WSDLDocumentation("Replaces matched XML nodes with an XML document given as string.")
66
  @WSDLDocumentation("Replaces matched XML nodes with an XML document given as string.")
65
  public abstract String replaceNodes(
67
  public abstract String replaceNodes(
66
		  @WebParam(name="sourcexml") String source,
68
		  @WebParam(name="sourcexml") String source,
67
		  @WebParam(name="encoding") String encoding,
69
		  @WebParam(name="encoding") String encoding,
68
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
70
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
69
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1, 
71
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1, 
70
		  @WebParam(name="xmldata") String paramString2)
72
		  @WebParam(name="xmldata") String paramString2)
71
    throws XServicesFault;
73
    throws XServicesFault;
72
  
74
  
73
  @WebMethod(operationName="replaceNodes2")
75
  @WebMethod(operationName="replaceNodes2")
74
  @WSDLDocumentation("Replaces matched XML nodes with an XML document given as file.")
76
  @WSDLDocumentation("Replaces matched XML nodes with an XML document given as file.")
75
  public abstract String replaceNodesFromFile(
77
  public abstract String replaceNodesFromFile(
76
		  @WebParam(name="file") FileResource paramFileResource, 
78
		  @WebParam(name="file") FileResource paramFileResource, 
77
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
79
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
78
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1, 
80
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1, 
79
		  @WebParam(name="xmldata") String paramString2)
81
		  @WebParam(name="xmldata") String paramString2)
80
    throws XServicesFault;
82
    throws XServicesFault;
81
  
83
  
82
  @WebMethod(operationName="wrapInCDATA")
84
  @WebMethod(operationName="wrapInCDATA")
83
  @WSDLDocumentation("Wraps a String into a CDATA element")
85
  @WSDLDocumentation("Wraps a String into a CDATA element")
84
  public abstract String wrapInCDATA(@WebParam(name="data") @XmlElement(required=true) String data)
86
  public abstract String wrapInCDATA(@WebParam(name="data") @XmlElement(required=true) String data)
85
  	throws XServicesFault;
87
  	throws XServicesFault;
86
  
88
  
87
  @WebMethod(operationName="selectXPath")
89
  @WebMethod(operationName="selectXPath")
88
  @WSDLDocumentation("Select from xml document given as string using an XPath expression.")
90
  @WSDLDocumentation("Select from xml document given as string using an XPath expression.")
89
  public abstract StringSplitType selectXPath(
91
  public abstract StringSplitType selectXPath(
90
		  @WebParam(name="sourcexml") @XmlElement(required=true) String source,
92
		  @WebParam(name="sourcexml") @XmlElement(required=true) String source,
91
		  @WebParam(name="encoding") String encoding,
93
		  @WebParam(name="encoding") String encoding,
92
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
94
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
93
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1)
95
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1)
94
  	throws XServicesFault;
96
  	throws XServicesFault;
95
  
97
  
96
  @WebMethod(operationName="setAttribute")
98
  @WebMethod(operationName="setAttribute")
97
  @WSDLDocumentation("Set an attribute.")
99
  @WSDLDocumentation("Set an attribute.")
98
  public abstract String setAttribute(
100
  public abstract String setAttribute(
99
		  @WebParam(name="sourcexml") @XmlElement(required=true) String source,
101
		  @WebParam(name="sourcexml") @XmlElement(required=true) String source,
100
		  @WebParam(name="encoding") String encoding,
102
		  @WebParam(name="encoding") String encoding,
101
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
103
		  @WebParam(name="namespaceList") NamespaceListType paramNamespaceListType, 
102
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1,
104
		  @WebParam(name="xpath") @XmlElement(required=true) String paramString1,
103
		  @WebParam(name="attribute") @XmlElement(nillable=false, required=true) AttributeType attr)
105
		  @WebParam(name="attribute") @XmlElement(nillable=false, required=true) AttributeType attr)
104
  	throws XServicesFault;
106
  	throws XServicesFault;
105
 
107
 
106
}
108
}