Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="webservices">
  <template name="itws" value="try {&#10;$WebServiceNameServiceLocator$ $locator$ = new $WebServiceNameServiceLocator$();&#10;$WebServiceName$ $service$ = $locator$.$getMethod$();&#10;  // If authorization is required&#10;  //(($WS_Soap_BindingStub$)$service$).setUsername(&quot;user3&quot;);&#10;  //(($WS_Soap_BindingStub$)$service$).setPassword(&quot;pass3&quot;);&#10; // invoke business method&#10;$service$.$businessMethod$($END$);&#10;} catch(javax.xml.rpc.ServiceException ex) { ex.printStackTrace(); }&#10;catch(java.rmi.RemoteException ex) { ex.printStackTrace(); }" description="Generate Axis web service invokation" toReformat="true" toShortenFQNames="false">
    <variable name="WebServiceNameServiceLocator" expression="descendantClassesEnum(&quot;org.apache.axis.client.Service&quot;)" defaultValue="&quot;MyServiceLocator&quot;" alwaysStopAt="true" />
    <variable name="locator" expression="&quot;locator&quot;" defaultValue="&quot;locator&quot;" alwaysStopAt="true" />
    <variable name="WebServiceName" expression="descendantClassesEnum(&quot;java.rmi.Remote&quot;)" defaultValue="&quot;MyServiceName&quot;" alwaysStopAt="true" />
    <variable name="service" expression="&quot;service&quot;" defaultValue="&quot;service&quot;" alwaysStopAt="true" />
    <variable name="getMethod" expression="completeSmart()" defaultValue="&quot;get&quot;" alwaysStopAt="true" />
    <variable name="WS_Soap_BindingStub" expression="descendantClassesEnum(&quot;org.apache.axis.client.Stub&quot;)" defaultValue="&quot;MyService_Soap_BindingStub&quot;" alwaysStopAt="false" />
    <variable name="businessMethod" expression="complete()" defaultValue="&quot;businessMethod&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="ixws" value="$WebServicePortType$ $port$ = new $PortLocator$().$getPort$();&#10;  //invoke business method&#10;$port$.$businessMethod$($END$);" description="Generate XFire web service invokation" toReformat="true" toShortenFQNames="false">
    <variable name="WebServicePortType" expression="annotated(&quot;javax.jws.WebService&quot;)" defaultValue="&quot;MyService&quot;" alwaysStopAt="true" />
    <variable name="port" expression="&quot;service&quot;" defaultValue="&quot;service&quot;" alwaysStopAt="true" />
    <variable name="PortLocator" expression="descendantClassesEnum(&quot;javax.xml.ws.Service&quot;)" defaultValue="&quot;PortLocator&quot;" alwaysStopAt="true" />
    <variable name="getPort" expression="completeSmart()" defaultValue="&quot;getPort&quot;" alwaysStopAt="true" />
    <variable name="businessMethod" expression="annotated(&quot;javax.jws.WebMethod&quot;, &quot;WebServicePortType&quot;)" defaultValue="&quot;businessMethod&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="iuxws" value="try {&#10;  Client $client$ = new Client(new java.net.URL(&quot;$url$&quot;));&#10;  Object[] $results$ = client.invoke(&quot;$methodname$&quot;, new Object[] {$END$});&#10;} catch(Exception e) {&#10;  e.printStackTrace();&#10;}" description="Generate XFire untyped web service invokation" toReformat="true" toShortenFQNames="false">
    <variable name="client" expression="&quot;client&quot;" defaultValue="&quot;client&quot;" alwaysStopAt="true" />
    <variable name="url" expression="&quot;url&quot;" defaultValue="&quot;url&quot;" alwaysStopAt="true" />
    <variable name="results" expression="&quot;results&quot;" defaultValue="&quot;results&quot;" alwaysStopAt="true" />
    <variable name="methodname" expression="&quot;methodname&quot;" defaultValue="&quot;methodname&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="mjo" value="try {&#10;  // create a JAXBContext capable of handling classes generated into package&#10;  javax.xml.bind.JAXBContext jaxbContext = javax.xml.bind.JAXBContext.newInstance( &quot;$mypackage$&quot; );&#10;  // create an object to marshal&#10;  $Type$ $object$ = new $Type$();&#10;  // create a Marshaller and do marshal&#10;  javax.xml.bind.Marshaller marshaller = jaxbContext.createMarshaller();&#10;  marshaller.setProperty( javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );&#10;  marshaller.marshal( $object$, new java.io.FileOutputStream(&quot;$filename$&quot;) );&#10;} catch( javax.xml.bind.JAXBException je ) {&#10;  je.printStackTrace();&#10;} catch( java.io.FileNotFoundException io ) {&#10;  io.printStackTrace();&#10;}" description="Generate JAXB object 2 xml serialization" toReformat="true" toShortenFQNames="false">
    <variable name="mypackage" expression="complete()" defaultValue="&quot;mypackage&quot;" alwaysStopAt="true" />
    <variable name="Type" expression="&quot;TypeToMarshal&quot;" defaultValue="&quot;TypeToMarshal&quot;" alwaysStopAt="true" />
    <variable name="object" expression="&quot;objectToMarshal&quot;" defaultValue="&quot;objectToMarshal&quot;" alwaysStopAt="true" />
    <variable name="filename" expression="complete()" defaultValue="&quot;filename.xml&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="ujo" value="try {&#10;  // create a JAXBContext capable of handling classes generated into package&#10;  javax.xml.bind.JAXBContext jaxbContext = javax.xml.bind.JAXBContext.newInstance( &quot;$mypackage$&quot; );&#10;  // create an Unmarshaller&#10;  javax.xml.bind.Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();&#10;  // unmarshal an instance document into a tree of Java content&#10;  // objects composed of classes from the package.&#10;  $Type$ $object$ = ($Type$)unmarshaller.unmarshal( new java.io.FileInputStream( &quot;$filename$&quot; ) );&#10;} catch( javax.xml.bind.JAXBException je ) {&#10;  je.printStackTrace();&#10;} catch( java.io.IOException ioe ) {&#10;  ioe.printStackTrace();&#10;}" description="Generate JAXB xml 2 object serialization" toReformat="true" toShortenFQNames="false">
    <variable name="mypackage" expression="complete()" defaultValue="&quot;mypackage&quot;" alwaysStopAt="true" />
    <variable name="Type" expression="&quot;TypeToUnmarshal&quot;" defaultValue="&quot;TypeToUnmarshal&quot;" alwaysStopAt="true" />
    <variable name="object" expression="&quot;unmarshalledObject&quot;" defaultValue="&quot;unmarshalledObject&quot;" alwaysStopAt="true" />
    <variable name="filename" expression="complete()" defaultValue="&quot;filename.xml&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="mxb" value="try {&#10;  $Type$ $object$ = $Type$.Factory.newInstance();&#10;  $object$.save(new java.io.File(&quot;$filename$&quot;));&#10;} catch (java.io.IOException e) {&#10;  e.printStackTrace();&#10;}" description="Generate XmlBeans object 2 xml serialization" toReformat="true" toShortenFQNames="false">
    <variable name="Type" expression="&quot;TypeToMarshal&quot;" defaultValue="&quot;TypeToMarshal&quot;" alwaysStopAt="true" />
    <variable name="object" expression="&quot;objectToMarshal&quot;" defaultValue="&quot;objectToMarshal&quot;" alwaysStopAt="true" />
    <variable name="filename" expression="complete()" defaultValue="&quot;filename.xml&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="uxb" value="try {&#10;  $Type$ $object$ = $Type$.Factory.parse(&#10;    new java.io.File(&quot;$filename$&quot;),&#10;    null&#10;  );&#10;} catch (java.io.IOException e) {&#10;  e.printStackTrace();&#10;} catch (org.apache.xmlbeans.XmlException e) {&#10;  e.printStackTrace();&#10;}" description="Generate XmlBeans xml 2 object deserialization" toReformat="true" toShortenFQNames="false">
    <variable name="Type" expression="&quot;TypeToUnmarshal&quot;" defaultValue="&quot;TypeToUnmarshal&quot;" alwaysStopAt="true" />
    <variable name="object" expression="&quot;unmarshalledObject&quot;" defaultValue="&quot;unmarshalledObject&quot;" alwaysStopAt="true" />
    <variable name="filename" expression="complete()" defaultValue="&quot;filename.xml&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="itaws" value="try {&#10;  $WebServiceStub$ $stub$ = new $WebServiceStub$();&#10;  // invoke business method&#10;  $stub$.$businessMethod$($END$);&#10;} catch(Exception ex) { ex.printStackTrace(); }&#10;" description="Generate Axis2 web service invokation" toReformat="true" toShortenFQNames="false">
    <variable name="WebServiceStub" expression="descendantClassesEnum(&quot;org.apache.axis2.client.Stub&quot;)" defaultValue="&quot;MyServiceStub&quot;" alwaysStopAt="true" />
    <variable name="stub" expression="&quot;stub&quot;" defaultValue="&quot;stub&quot;" alwaysStopAt="true" />
    <variable name="businessMethod" expression="complete()" defaultValue="&quot;businessMethod&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="ijws" value="$WebServicePortType$ $port$ = new $PortLocator$().$getPort$();&#10;  //invoke business method&#10;$port$.$businessMethod$($END$);" description="Generate JaxWS web service invokation" toReformat="true" toShortenFQNames="false">
    <variable name="WebServicePortType" expression="annotated(&quot;javax.jws.WebService&quot;)" defaultValue="&quot;MyService&quot;" alwaysStopAt="true" />
    <variable name="port" expression="&quot;service&quot;" defaultValue="&quot;service&quot;" alwaysStopAt="true" />
    <variable name="PortLocator" expression="descendantClassesEnum(&quot;javax.xml.ws.Service&quot;)" defaultValue="&quot;PortLocator&quot;" alwaysStopAt="true" />
    <variable name="getPort" expression="completeSmart()" defaultValue="&quot;getPort&quot;" alwaysStopAt="true" />
    <variable name="businessMethod" expression="annotated(&quot;javax.jws.WebMethod&quot;, &quot;WebServicePortType&quot;)" defaultValue="&quot;businessMethod&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="ijrws" value="try {&#10;  $WebServiceNameServiceLocator$ $locator$ = new $WebServiceNameServiceLocator$();&#10;  $WebServiceName$ $service$ = $locator$.$getMethod$();&#10;  // invoke business method&#10;  $service$.$businessMethod$($END$);&#10;} catch(java.rmi.RemoteException ex) { ex.printStackTrace(); }" description="Generate JaxRPC web service invokation" toReformat="true" toShortenFQNames="false">
    <variable name="WebServiceNameServiceLocator" expression="descendantClassesEnum(&quot;javax.xml.rpc.Service&quot;)" defaultValue="&quot;MyLocator&quot;" alwaysStopAt="true" />
    <variable name="locator" expression="&quot;locator&quot;" defaultValue="&quot;locator&quot;" alwaysStopAt="true" />
    <variable name="WebServiceName" expression="descendantClassesEnum(&quot;java.rmi.Remote&quot;)" defaultValue="&quot;MyServiceName&quot;" alwaysStopAt="true" />
    <variable name="service" expression="&quot;service&quot;" defaultValue="&quot;service&quot;" alwaysStopAt="true" />
    <variable name="getMethod" expression="completeSmart()" defaultValue="get" alwaysStopAt="true" />
    <variable name="businessMethod" expression="complete()" defaultValue="businessMethod" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="iwws" value="try {&#10;  $WebServiceNameServiceLocator$ $locator$ = new $WebServiceNameServiceLocator$();&#10;  $WebServiceName$ $service$ = $locator$.$getMethod$();&#10;  // invoke business method&#10;  $service$.$businessMethod$($END$);&#10;} catch(Exception ex) { ex.printStackTrace(); }" description="Generate WebSphere webservice invokation" toReformat="true" toShortenFQNames="false">
    <variable name="WebServiceNameServiceLocator" expression="descendantClassesEnum(&quot;javax.xml.rpc.Service&quot;)" defaultValue="&quot;MyLocator&quot;" alwaysStopAt="true" />
    <variable name="locator" expression="&quot;locator&quot;" defaultValue="&quot;locator&quot;" alwaysStopAt="true" />
    <variable name="WebServiceName" expression="descendantClassesEnum(&quot;java.rmi.Remote&quot;)" defaultValue="&quot;MyServiceName&quot;" alwaysStopAt="true" />
    <variable name="service" expression="&quot;service&quot;" defaultValue="&quot;service&quot;" alwaysStopAt="true" />
    <variable name="getMethod" expression="completeSmart()" defaultValue="&quot;getMethod&quot;" alwaysStopAt="true" />
    <variable name="businessMethod" expression="complete()" defaultValue="&quot;businessMethod&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="jaxrs" value="try {&#10;  com.sun.net.httpserver.HttpServer server = com.sun.jersey.api.container.httpserver.HttpServerFactory.create(&quot;http://localhost:9998/&quot;);&#10;  server.start();&#10;  &#10;  System.out.println(&quot;Server running&quot;);&#10;  System.out.println(&quot;Visit: http://localhost:9998/helloworld&quot;);&#10;  System.out.println(&quot;Hit return to stop...&quot;);&#10;  System.in.read();&#10;  System.out.println(&quot;Stopping server&quot;);   &#10;  server.stop(0);&#10;  System.out.println(&quot;Server stopped&quot;);&#10;} catch (java.io.IOException ioe) {&#10;  ioe.printStackTrace(System.err);&#10;}" description="Generate Axis web service invokation" toReformat="true" toShortenFQNames="false">
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
  <template name="iuws" value="try {  org.apache.axis.client.Service  $service$ = new org.apache.axis.client.Service();&#10;  org.apache.axis.client.Call     $call$    = (org.apache.axis.client.Call) $service$.createCall();&#10;  $call$.setTargetEndpointAddress( new java.net.URL(&quot;$targetUrl$&quot;) );&#10;  $call$.setOperationName(new javax.xml.namespace.QName(&quot;$targetNs$&quot;, &quot;$methodname$&quot;));&#10;  $call$.invoke( new Object[] {$END$} );&#10;} catch(javax.xml.rpc.ServiceException ex) { ex.printStackTrace(); }&#10;catch(java.rmi.RemoteException ex) { ex.printStackTrace(); }&#10;catch(java.net.MalformedURLException ex) { ex.printStackTrace(); }" description="Generate Axis untyped web service invokation" toReformat="true" toShortenFQNames="false">
    <variable name="service" expression="&quot;service&quot;" defaultValue="&quot;service&quot;" alwaysStopAt="true" />
    <variable name="call" expression="&quot;call&quot;" defaultValue="&quot;call&quot;" alwaysStopAt="true" />
    <variable name="targetUrl" expression="&quot;http://localhost:8080/MyService&quot;" defaultValue="&quot;http://localhost:8080/MyService&quot;" alwaysStopAt="true" />
    <variable name="targetNs" expression="&quot;http://localhost:8080/MyService&quot;" defaultValue="&quot;http://localhost:8080/MyService&quot;" alwaysStopAt="true" />
    <variable name="methodname" expression="&quot;businessMethod&quot;" defaultValue="&quot;businessMethod&quot;" alwaysStopAt="true" />
    <context>
      <option name="JAVA_CODE" value="true" />
      <option name="OTHER" value="true" />
    </context>
  </template>
</templateSet>

Commits for litesoft/trunk/zIntelliJ-Config/config/templates/webservices.xml

Diff revisions: vs.
Revision Author Commited Message
473 GeorgeS picture GeorgeS Fri 02 Sep, 2011 12:41:30 +0000