Added sendMailSimpleWithAttachment operation to MiscService
git-svn-id: https://brutex.net/svn/xservices/trunk@21 e7e49efb-446e-492e-b9ec-fcafc1997a86tag-20130205r
parent
146aae010c
commit
87e0ca8511
|
@ -13,12 +13,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.brutex.xservices.ws;
|
package net.brutex.xservices.ws;
|
||||||
|
|
||||||
import javax.jws.WebMethod;
|
import javax.jws.WebMethod;
|
||||||
import javax.jws.WebParam;
|
import javax.jws.WebParam;
|
||||||
import javax.jws.WebService;
|
import javax.jws.WebService;
|
||||||
|
import net.brutex.xservices.types.FileSetResource;
|
||||||
import net.brutex.xservices.types.HostConnection;
|
import net.brutex.xservices.types.HostConnection;
|
||||||
import net.brutex.xservices.types.ReturnCode;
|
import net.brutex.xservices.types.ReturnCode;
|
||||||
import net.brutex.xservices.util.BrutexNamespaces;
|
import net.brutex.xservices.util.BrutexNamespaces;
|
||||||
|
@ -27,20 +27,28 @@ import net.brutex.xservices.util.BrutexNamespaces;
|
||||||
*
|
*
|
||||||
* @author Brian Rosenberger, bru@brutex.de
|
* @author Brian Rosenberger, bru@brutex.de
|
||||||
*/
|
*/
|
||||||
@WebService(targetNamespace=BrutexNamespaces.WS_XSERVICES)
|
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
|
||||||
public interface MiscService {
|
public interface MiscService {
|
||||||
|
|
||||||
@WebMethod(operationName="getHostinfo")
|
@WebMethod(operationName = "getHostinfo")
|
||||||
public ReturnCode getHostinfo(@WebParam(name="hostname") String hostname);
|
public ReturnCode getHostinfo(@WebParam(name = "hostname") String hostname);
|
||||||
|
|
||||||
@WebMethod(operationName="sendMailSimple")
|
@WebMethod(operationName = "sendMailSimple")
|
||||||
public ReturnCode sendMailSimple(@WebParam(name="mailhost") HostConnection mailhost,
|
public ReturnCode sendMailSimple(@WebParam(name = "mailhost") HostConnection mailhost,
|
||||||
@WebParam(name="from") String from,
|
@WebParam(name = "from") String from,
|
||||||
@WebParam(name="to") String tolist,
|
@WebParam(name = "to") String tolist,
|
||||||
@WebParam(name="subject") String subject,
|
@WebParam(name = "subject") String subject,
|
||||||
@WebParam(name="message") String message);
|
@WebParam(name = "message") String message);
|
||||||
|
|
||||||
@WebMethod(operationName="sleep")
|
@WebMethod(operationName = "sendMailSimpleWithAttachment")
|
||||||
public ReturnCode sleep(@WebParam(name="minutes") int minutes,
|
public ReturnCode sendMailSimpleWithAttachment(@WebParam(name = "mailhost") HostConnection mailhost,
|
||||||
@WebParam(name="seconds") int seconds);
|
@WebParam(name = "from") String from,
|
||||||
|
@WebParam(name = "to") String tolist,
|
||||||
|
@WebParam(name = "subject") String subject,
|
||||||
|
@WebParam(name = "message") String message,
|
||||||
|
@WebParam(name = "attachments") FileSetResource res);
|
||||||
|
|
||||||
|
@WebMethod(operationName = "sleep")
|
||||||
|
public ReturnCode sleep(@WebParam(name = "minutes") int minutes,
|
||||||
|
@WebParam(name = "seconds") int seconds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,29 @@ public class MiscServiceImpl implements MiscService {
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ReturnCode sendMailSimpleWithAttachment(HostConnection mailhost, String from,
|
||||||
|
String tolist, String subject, String message,
|
||||||
|
FileSetResource res) {
|
||||||
|
return sendMail(from,
|
||||||
|
from,
|
||||||
|
tolist,
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
subject,
|
||||||
|
message,
|
||||||
|
"text/plain",
|
||||||
|
res,
|
||||||
|
mailhost.hostname,
|
||||||
|
mailhost.port,
|
||||||
|
mailhost.user,
|
||||||
|
mailhost.password,
|
||||||
|
"utf-8",
|
||||||
|
false,
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ReturnCode sleep(int minutes, int seconds) {
|
public ReturnCode sleep(int minutes, int seconds) {
|
||||||
return sleep(0, minutes, seconds, 0);
|
return sleep(0, minutes, seconds, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue