@@ -57,7 +57,7 @@ public class Conversation : IWatsonService
57
57
private const string SERVICE_ID = "ConversationV1" ;
58
58
private static fsSerializer sm_Serializer = new fsSerializer ( ) ;
59
59
#endregion
60
-
60
+ /*
61
61
#region Workspaces
62
62
/// <summary>
63
63
/// Gets the available workspaces for the Conversation service
@@ -113,8 +113,9 @@ private void OnGetWorkspacesResp(RESTConnector.Request req, RESTConnector.Respon
113
113
((GetWorkspacesReq)req).Callback(resp.Success ? workspaces : null);
114
114
}
115
115
#endregion
116
-
116
+ */
117
117
#region Message
118
+ private const string SERVICE_MESSAGE = "/v1/workspaces" ;
118
119
/// <summary>
119
120
/// Message the specified workspaceId, input and callback.
120
121
/// </summary>
@@ -130,7 +131,7 @@ public bool Message(string workspaceId, string input, OnMessage callback)
130
131
if ( callback == null )
131
132
throw new ArgumentNullException ( "callback" ) ;
132
133
133
- RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , "/v2/rest/workspaces" ) ;
134
+ RESTConnector connector = RESTConnector . GetConnector ( SERVICE_ID , SERVICE_MESSAGE ) ;
134
135
if ( connector == null )
135
136
return false ;
136
137
@@ -140,6 +141,7 @@ public bool Message(string workspaceId, string input, OnMessage callback)
140
141
MessageReq req = new MessageReq ( ) ;
141
142
req . Callback = callback ;
142
143
req . Headers [ "Content-Type" ] = "application/json" ;
144
+ req . Parameters [ "version" ] = DataModels . CONVERSATION_VERSION ;
143
145
req . Function = "/" + workspaceId + "/message" ;
144
146
req . Send = Encoding . UTF8 . GetBytes ( reqString ) ;
145
147
req . OnResponse = MessageResp ;
@@ -227,18 +229,19 @@ public CheckServiceStatus(Conversation service, ServiceStatus callback)
227
229
if ( ! string . IsNullOrEmpty ( customServiceID ) )
228
230
{
229
231
230
- if ( ! m_Service . Message ( customServiceID , "Hello " , OnMessage ) )
232
+ if ( ! m_Service . Message ( customServiceID , "Ping " , OnMessage ) )
231
233
OnFailure ( "Failed to invoke Converse()." ) ;
232
234
else
233
235
m_ConversationCount += 1 ;
234
236
}
235
237
else
236
238
{
237
- if ( ! m_Service . GetWorkspaces ( OnGetWorkspaces ) )
238
- OnFailure ( "Failed to invoke GetDialogs()." ) ;
239
+ // if (!m_Service.GetWorkspaces(OnGetWorkspaces))
240
+ // OnFailure("Failed to invoke GetDialogs().");
241
+ OnFailure ( "Please define a workspace variable in config.json (" + SERVICE_ID + "_ID)" ) ;
239
242
}
240
243
}
241
-
244
+ /*
242
245
private void OnGetWorkspaces(DataModels.Workspaces workspaces)
243
246
{
244
247
if (m_Callback != null)
@@ -254,7 +257,7 @@ private void OnGetWorkspaces(DataModels.Workspaces workspaces)
254
257
else
255
258
OnFailure("GetMessages() failed.");
256
259
}
257
-
260
+ */
258
261
private void OnMessage ( DataModels . MessageResponse resp )
259
262
{
260
263
if ( m_ConversationCount > 0 )
0 commit comments