Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ppmRouter.get("/get_time_sheet",(req,res,next) => {
- var resourceid = req.query.param_resourceid
- var soap = require('soap');
- var url = config.wsdlObjectPath + "TimePeriods"
- var sheader = { "Auth": {Username: config.xog_user, Password: config.password}}
- var args = {
- ":NikuDataBus": {
- ":Header":{
- attributes: {
- version: "6.0.11",
- action: "read",
- objectType: "timeperiod",
- externalSource: "NIKU"
- }
- },
- ":Query": {
- ":Filter": {
- attributes: {
- name: "resourceID",
- criteria: "EQUALS"
- },
- $value: resourceid
- }
- }
- }
- };
- var wsdlOptions = {
- overrideRootElement: {
- namespace: 'tns',
- xmlnsAttributes: []
- }
- };
- soap.createClient(url, wsdlOptions, function(err, client) {
- client.addSoapHeader(sheader,"","","");
- client.setEndpoint(config.xog_url)
- client.ReadTimeperiod(args,(error,result)=>{
- console.log(client.lastRequest)
- if (error) throw error;
- console.log(result)
- res.send(result)
- })
- });
- })
Add Comment
Please, Sign In to add comment