Skip to content

Commit 1567904

Browse files
committed
update base service and license
1 parent 5cbb24c commit 1567904

File tree

3 files changed

+118
-5
lines changed

3 files changed

+118
-5
lines changed

mdws/src/lib/SchedulingLib.cs

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
using System;
1+
#region CopyrightHeader
2+
//
3+
// Copyright by Contributors
4+
//
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0.txt
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
//
17+
#endregion
18+
19+
using System;
220
using System.Collections.Generic;
321
using gov.va.medora.mdws.dto;
422
using gov.va.medora.mdo;

mdws/src/svc/BaseService.cs

+80-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
using System.Web.Script.Services;
2323
using System.ComponentModel;
2424
using gov.va.medora.mdws.dto;
25+
using System.ServiceModel;
26+
using System.ServiceModel.Activation;
2527

2628
namespace gov.va.medora.mdws
2729
{
@@ -32,19 +34,35 @@ namespace gov.va.medora.mdws
3234
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
3335
[ToolboxItem(false)]
3436
[ScriptService]
35-
public partial class BaseService : System.Web.Services.WebService
37+
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
38+
public partial class BaseService : System.Web.Services.WebService, IBaseService
3639
{
3740
public const string VERSION = "1.1.0";
3841

3942
public BaseService()
4043
{
44+
//if (!OperationContext.Current
45+
//OperationContext.Current.IncomingMessageProperties.Add("MySession", new MySession(this.GetType().Name));
46+
//RequestContext wcfContext = this.
47+
//if (OperationContext.Current == null || String.IsNullOrEmpty(OperationContext.Current.SessionId))
48+
//{
49+
// return;
50+
//}
4151
// If not Http request has been made yet Session is null
4252
// This happens before the Startup page is displayed
43-
if (HttpContext.Current.Session == null)
53+
54+
if (OperationContext.Current != null)
55+
{
56+
System.Console.WriteLine("You're sooo cool Joel");
57+
}
58+
59+
if (HttpContext.Current == null || HttpContext.Current.Session == null)
4460
{
4561
return;
4662
}
4763

64+
65+
4866
// At this point a request has been made to a web service page
4967
if (HttpContext.Current.Session["MySession"] == null)
5068
{
@@ -86,7 +104,7 @@ public TextTO getFacadeVersion()
86104
}
87105
catch (Exception)
88106
{
89-
result.fault = new FaultTO("This facade does not contain any version information");
107+
result.fault = new FaultTO("This facade does not contain any version information");
90108
}
91109
return result;
92110
}
@@ -102,5 +120,64 @@ public TextArray getRpcs()
102120
{
103121
return (TextArray)MySession.execute("ConnectionLib", "getRpcs", new object[] { });
104122
}
123+
124+
[WebMethod(EnableSession = true, Description = "Get all VHA sites")]
125+
public RegionArray getVHA()
126+
{
127+
return (RegionArray)MySession.execute("SitesLib", "getVHA", new object[] { });
128+
}
129+
130+
[OperationContract]
131+
[WebMethod(EnableSession = true, Description = "Connect to a single VistA system")]
132+
public DataSourceArray connect(string sitelist)
133+
{
134+
return (DataSourceArray)MySession.execute("ConnectionLib", "connectToLoginSite", new object[] { sitelist });
135+
}
136+
137+
[OperationContract]
138+
[WebMethod(EnableSession = true, Description = "Log onto a single VistA system")]
139+
public UserTO login(string username, string pwd, string context)
140+
{
141+
return (UserTO)MySession.execute("AccountLib", "login", new object[] { username, pwd, context });
142+
}
143+
144+
[OperationContract]
145+
[WebMethod(EnableSession = true, Description = "Disconnect all Vista systems")]
146+
public TaggedTextArray disconnect()
147+
{
148+
return (TaggedTextArray)MySession.execute("ConnectionLib", "disconnectAll", new object[] { });
149+
}
150+
151+
}
152+
153+
[ServiceContract]
154+
public interface IBaseService
155+
{
156+
[OperationContract]
157+
string getVersion();
158+
159+
[OperationContract]
160+
SiteTO addDataSource(string id, string name, string datasource, string port, string modality, string protocol, string region);
161+
162+
[OperationContract]
163+
TextTO getFacadeVersion();
164+
165+
[OperationContract]
166+
SiteArray setVha(string sitesFileName);
167+
168+
[OperationContract]
169+
TextArray getRpcs();
170+
171+
[OperationContract]
172+
RegionArray getVHA();
173+
174+
[OperationContract]
175+
DataSourceArray connect(string sitelist);
176+
177+
[OperationContract]
178+
TaggedTextArray disconnect();
179+
180+
[OperationContract]
181+
UserTO login(string username, string pwd, string context);
105182
}
106183
}

mdws/src/svc/SchedulingSvc.cs

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
using System.Web.Services;
1+
#region CopyrightHeader
2+
//
3+
// Copyright by Contributors
4+
//
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0.txt
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
//
17+
#endregion
18+
19+
using System.Web.Services;
220
using System.ComponentModel;
321
using gov.va.medora.mdws.dto;
422
using System.ServiceModel;

0 commit comments

Comments
 (0)