DSMP.CS
1
using
System.Diagnostics;
2 using System.Web.Services;
3 using System.ComponentModel;
4 using System.Web.Services.Protocols;
5 using System;
6 using System.Xml.Serialization;
7
8 namespace DSMP
9 {
10 /// <remarks/>
11 [System.Web.Services.WebServiceBindingAttribute()]
12 public partial class Provision : System.Web.Services.Protocols.SoapHttpClientProtocol
13 {
14 private System.Threading.SendOrPostCallback UnSubscribeServiceReqOperationCompleted;
15 private System.Threading.SendOrPostCallback SubscribeServiceReqOperationCompleted;
16
17 private bool useDefaultCredentialsSetExplicitly;
18
19 /// <remarks/>
20 public Provision( string URL)
21 {
22 this .Url = URL;
23 if (( this .IsLocalFileSystemWebService( this .Url) == true ))
24 {
25 this .UseDefaultCredentials = true ;
26 this .useDefaultCredentialsSetExplicitly = false ;
27 }
28 else
29 {
30 this .useDefaultCredentialsSetExplicitly = true ;
31 }
32 }
33
34 public new string Url
35 {
36 get
37 {
38 return base .Url;
39 }
40 set
41 {
42 if (((( this .IsLocalFileSystemWebService( base .Url) == true )
43 && ( this .useDefaultCredentialsSetExplicitly == false ))
44 && ( this .IsLocalFileSystemWebService(value) == false )))
45 {
46 base .UseDefaultCredentials = false ;
47 }
48 base .Url = value;
49 }
50 }
51
52 public new bool UseDefaultCredentials
53 {
54 get
55 {
56 return base .UseDefaultCredentials;
57 }
58 set
59 {
60 base .UseDefaultCredentials = value;
61 this .useDefaultCredentialsSetExplicitly = true ;
62 }
63 }
64
65 /// <remarks/>
66 public new void CancelAsync( object userState)
67 {
68 base .CancelAsync(userState);
69 }
70
71 private bool IsLocalFileSystemWebService( string url)
72 {
73 if (((url == null )
74 || (url == string .Empty)))
75 {
76 return false ;
77 }
78 System.Uri wsUri = new System.Uri(url);
79 if (((wsUri.Port >= 1024 )
80 && ( string .Compare(wsUri.Host, " localHost " , System.StringComparison.OrdinalIgnoreCase) == 0 )))
81 {
82 return true ;
83 }
84 return false ;
85 }
86
87 private DSMPHeader dSMPHeaderValueField;
88 public DSMPHeader TransactionID
89 {
90 get
91 {
92 return this .dSMPHeaderValueField;
93 }
94 set
95 {
96 this .dSMPHeaderValueField = value;
97 }
98 }
99
100 [System.Web.Services.Protocols.SoapHeaderAttribute( " TransactionID " , Direction = System.Web.Services.Protocols.SoapHeaderDirection.InOut)]
101 [System.Web.Services.Protocols.SoapDocumentMethodAttribute( " http://www.monternet.com/dsmp/dsmp " , RequestElementName = " UnSubscribeServiceReq " , RequestNamespace = " http://www.monternet.com/dsmp/schemas/ " , ResponseElementName = " UnSubscribeServiceResp " , ResponseNamespace = " http://www.monternet.com/dsmp/schemas/ " , Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
102 public void UnSubscribeServiceReq( ref string MsgType, ref string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr, out int hRet)
103 {
104 object [] Ret = base .Invoke( " UnSubscribeServiceReq " , new object [] { MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr });
105
106 Version = ( string )Ret[ 0 ];
107 MsgType = ( string )Ret[ 1 ];
108 hRet = ( int )Ret[ 2 ];
109 }
110
111 [System.Web.Services.Protocols.SoapHeaderAttribute( " TransactionID " , Direction = System.Web.Services.Protocols.SoapHeaderDirection.InOut)]
112 [System.Web.Services.Protocols.SoapDocumentMethodAttribute( " http://www.monternet.com/dsmp/dsmp " , RequestElementName = " SubscribeServiceReq " , RequestNamespace = " http://www.monternet.com/dsmp/schemas/ " , ResponseElementName = " SubscribeServiceResp " , ResponseNamespace = " http://www.monternet.com/dsmp/schemas/ " , Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
113 public void SubscribeServiceReq( ref string MsgType, ref string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr, out int hRet, out string LinkID)
114 {
115 object [] Ret = base .Invoke( " SubscribeServiceReq " , new object [] { MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr });
116
117 Version = ( string )Ret[ 0 ];
118 MsgType = ( string )Ret[ 1 ];
119 hRet = ( int )Ret[ 2 ];
120 LinkID = ( string )Ret[ 3 ];
121 }
122
123 /// <remarks/>
124 public event UnSubscribeServiceReqCompletedEventHandler UnSubscribeServiceReqCompleted;
125
126 /// <remarks/>
127 public void UnSubscribeServiceReqAsync( string MsgType, string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr)
128 {
129 this .UnSubscribeServiceReqAsync(MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr, null );
130 }
131
132 /// <remarks/>
133 public void UnSubscribeServiceReqAsync( string MsgType, string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr, object userState)
134 {
135 if (( this .UnSubscribeServiceReqOperationCompleted == null )) {
136 this .UnSubscribeServiceReqOperationCompleted = new System.Threading.SendOrPostCallback( this .OnUnSubscribeServiceReqOperationCompleted);
137 }
138 this .InvokeAsync( " UnSubscribeServiceReq " , new object [] {
139 MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr}, this .UnSubscribeServiceReqOperationCompleted, userState);
140 }
141
142 private void OnUnSubscribeServiceReqOperationCompleted( object arg) {
143 if (( this .UnSubscribeServiceReqCompleted != null )) {
144 System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
145 this .UnSubscribeServiceReqCompleted( this , new UnSubscribeServiceReqCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
146 }
147 }
148
149 /// <remarks/>
150 public event SubscribeServiceReqCompletedEventHandler SubscribeServiceReqCompleted;
151
152 /// <remarks/>
153 public void SubscribeServiceReqAsync( string MsgType, string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr)
154 {
155 this .SubscribeServiceReqAsync(MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr, null );
156 }
157
158 /// <remarks/>
159 public void SubscribeServiceReqAsync( string MsgType, string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr, object userState)
160 {
161 if (( this .SubscribeServiceReqOperationCompleted == null ))
162 {
163 this .SubscribeServiceReqOperationCompleted = new System.Threading.SendOrPostCallback( this .OnSubscribeServiceReqOperationCompleted);
164 }
165 this .InvokeAsync( " SubscribeServiceReq " , new object [] {
166 MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr}, this .SubscribeServiceReqOperationCompleted, userState);
167 }
168
169 private void OnSubscribeServiceReqOperationCompleted( object arg)
170 {
171 if (( this .SubscribeServiceReqCompleted != null ))
172 {
173 System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
174 this .SubscribeServiceReqCompleted( this , new SubscribeServiceReqCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
175 }
176 }
177
178 }
179
180 [System.CodeDom.Compiler.GeneratedCodeAttribute( " System.Xml " , " 2.0.50727.42 " )]
181 [System.SerializableAttribute()]
182 [System.Diagnostics.DebuggerStepThroughAttribute()]
183 [System.ComponentModel.DesignerCategoryAttribute( " code " )]
184 [System.Xml.Serialization.XmlTypeAttribute(Namespace = " http://tempuri.org/ " )]
185 public partial class address_info
186 {
187 private int _DeviceType = 0 ;
188 public int DeviceType
189 {
190 get
191 {
192 return _DeviceType;
193 }
194 set
195 {
196 _DeviceType = value;
197 }
198 }
199
200 private string _DeviceID = "" ;
201 public string DeviceID
202 {
203 get
204 {
205 return _DeviceID;
206 }
207 set
208 {
209 _DeviceID = value;
210 }
211 }
212
213 public address_info() { }
214
215 public address_info( int DeviceType, string DeviceID)
216 {
217 this .DeviceType = DeviceType;
218 this .DeviceID = DeviceID;
219 }
220 }
221
222 [System.CodeDom.Compiler.GeneratedCodeAttribute( " System.Xml " , " 2.0.50727.42 " )]
223 [System.SerializableAttribute()]
224 [System.Diagnostics.DebuggerStepThroughAttribute()]
225 [System.ComponentModel.DesignerCategoryAttribute( " code " )]
226 [System.Xml.Serialization.XmlTypeAttribute(Namespace = " http://tempuri.org/ " )]
227 public partial class user_id
228 {
229 public int UserIDType = 1 ;
230 public string MSISDN = "" ;
231 public string PseudoCode = "" ;
232 public user_id() { }
233
234 public user_id( string Mobile)
235 {
236 MSISDN = Mobile;
237 }
238 }
239
240 [System.CodeDom.Compiler.GeneratedCodeAttribute( " System.Xml " , " 2.0.50727.42 " )]
241 [System.SerializableAttribute()]
242 [System.Diagnostics.DebuggerStepThroughAttribute()]
243 [System.ComponentModel.DesignerCategoryAttribute( " code " )]
244 [System.Xml.Serialization.XmlTypeAttribute(Namespace = " http://tempuri.org/ " )]
245 public partial class service_id
246 {
247 public int ServiceIDType = 1 ;
248 public string SPID = "" ;
249 public string SPServiceID = "" ;
250 public string AccessNo = "" ;
251 public string FeatureStr = "" ;
252 public service_id() { }
253
254 public service_id( int ServiceIDType, string Param1, string Param2)
255 {
256 Setting(ServiceIDType, Param1, Param2);
257 }
258
259 public service_id( string SPID, string SPServiceID)
260 {
261 Setting( 1 , SPID, SPServiceID);
262 }
263
264 public void Setting( int ServiceIDType, string Param1, string Param2)
265 {
266 this .ServiceIDType = ServiceIDType;
267 switch (ServiceIDType)
268 {
269 case 2 :
270 {
271 this .AccessNo = Param1;
272 this .FeatureStr = Param2;
273 break ;
274 }
275 default :
276 {
277 ServiceIDType = 1 ;
278 this .SPID = Param1;
279 this .SPServiceID = Param2;
280 break ;
281 }
282 }
283 }
284 }
285
286 /// <remarks/>
287 [System.CodeDom.Compiler.GeneratedCodeAttribute( " System.Xml " , " 2.0.50727.42 " )]
288 [System.SerializableAttribute()]
289 [System.Diagnostics.DebuggerStepThroughAttribute()]
290 [System.ComponentModel.DesignerCategoryAttribute( " code " )]
291 [System.Xml.Serialization.XmlTypeAttribute(Namespace = " http://www.w3.org/2001/XMLSchema " )]
292 [System.Xml.Serialization.XmlRootAttribute( " TransactionID " , Namespace = " http://www.monternet.com/dsmp/schemas/ " , IsNullable = false )]
293 public partial class DSMPHeader : System.Web.Services.Protocols.SoapHeader
294 {
295 [XmlTextAttribute( typeof ( string ))]
296 public string _TransactionID = " 000000000000 " ;
297
298
299 static public implicit operator DSMPHeader( string value)
300 {
301 DSMPHeader ret = new DSMPHeader();
302 ret._TransactionID = value;
303 return ret;
304 }
305
306 static public implicit operator string (DSMPHeader value)
307 {
308 return value._TransactionID;
309 }
310
311 private System.Xml.XmlAttribute[] anyAttrField;
312
313 /// <remarks/>
314 [System.Xml.Serialization.XmlAnyAttributeAttribute()]
315 public System.Xml.XmlAttribute[] AnyAttr
316 {
317 get
318 {
319 return this .anyAttrField;
320 }
321 set
322 {
323 this .anyAttrField = value;
324 }
325 }
326 }
327
328
329 /// <remarks/>
330 public delegate void UnSubscribeServiceReqCompletedEventHandler( object sender, UnSubscribeServiceReqCompletedEventArgs e);
331
332 /// <remarks/>
333 public partial class UnSubscribeServiceReqCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
334
335 private object [] results;
336
337 internal UnSubscribeServiceReqCompletedEventArgs( object [] results, System.Exception exception, bool cancelled, object userState) :
338 base (exception, cancelled, userState) {
339 this .results = results;
340 }
341
342 /// <remarks/>
343 public string Version
344 {
345 get
346 {
347 this .RaiseExceptionIfNecessary();
348 return (( string )( this .results[ 0 ]));
349 }
350 }
351
352 /// <remarks/>
353 public string MsgType
354 {
355 get
356 {
357 this .RaiseExceptionIfNecessary();
358 return (( string )( this .results[ 1 ]));
359 }
360 }
361
362 /// <remarks/>
363 public int hRet
364 {
365 get
366 {
367 this .RaiseExceptionIfNecessary();
368 return (( int )( this .results[ 2 ]));
369 }
370 }
371 }
372
373 /// <remarks/>
374 public delegate void SubscribeServiceReqCompletedEventHandler( object sender, SubscribeServiceReqCompletedEventArgs e);
375
376 /// <remarks/>
377 public partial class SubscribeServiceReqCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
378 {
379
380 private object [] results;
381
382 internal SubscribeServiceReqCompletedEventArgs( object [] results, System.Exception exception, bool cancelled, object userState)
383 :
384 base (exception, cancelled, userState)
385 {
386 this .results = results;
387 }
388
389 /// <remarks/>
390 public string Version
391 {
392 get
393 {
394 this .RaiseExceptionIfNecessary();
395 return (( string )( this .results[ 0 ]));
396 }
397 }
398
399 /// <remarks/>
400 public string MsgType
401 {
402 get
403 {
404 this .RaiseExceptionIfNecessary();
405 return (( string )( this .results[ 1 ]));
406 }
407 }
408
409 /// <remarks/>
410 public int hRet
411 {
412 get
413 {
414 this .RaiseExceptionIfNecessary();
415 return (( int )( this .results[ 2 ]));
416 }
417 }
418
419 /// <remarks/>
420 public string LinkID
421 {
422 get
423 {
424 this .RaiseExceptionIfNecessary();
425 return (( string )( this .results[ 3 ]));
426 }
427 }
428 }
429 }
2 using System.Web.Services;
3 using System.ComponentModel;
4 using System.Web.Services.Protocols;
5 using System;
6 using System.Xml.Serialization;
7
8 namespace DSMP
9 {
10 /// <remarks/>
11 [System.Web.Services.WebServiceBindingAttribute()]
12 public partial class Provision : System.Web.Services.Protocols.SoapHttpClientProtocol
13 {
14 private System.Threading.SendOrPostCallback UnSubscribeServiceReqOperationCompleted;
15 private System.Threading.SendOrPostCallback SubscribeServiceReqOperationCompleted;
16
17 private bool useDefaultCredentialsSetExplicitly;
18
19 /// <remarks/>
20 public Provision( string URL)
21 {
22 this .Url = URL;
23 if (( this .IsLocalFileSystemWebService( this .Url) == true ))
24 {
25 this .UseDefaultCredentials = true ;
26 this .useDefaultCredentialsSetExplicitly = false ;
27 }
28 else
29 {
30 this .useDefaultCredentialsSetExplicitly = true ;
31 }
32 }
33
34 public new string Url
35 {
36 get
37 {
38 return base .Url;
39 }
40 set
41 {
42 if (((( this .IsLocalFileSystemWebService( base .Url) == true )
43 && ( this .useDefaultCredentialsSetExplicitly == false ))
44 && ( this .IsLocalFileSystemWebService(value) == false )))
45 {
46 base .UseDefaultCredentials = false ;
47 }
48 base .Url = value;
49 }
50 }
51
52 public new bool UseDefaultCredentials
53 {
54 get
55 {
56 return base .UseDefaultCredentials;
57 }
58 set
59 {
60 base .UseDefaultCredentials = value;
61 this .useDefaultCredentialsSetExplicitly = true ;
62 }
63 }
64
65 /// <remarks/>
66 public new void CancelAsync( object userState)
67 {
68 base .CancelAsync(userState);
69 }
70
71 private bool IsLocalFileSystemWebService( string url)
72 {
73 if (((url == null )
74 || (url == string .Empty)))
75 {
76 return false ;
77 }
78 System.Uri wsUri = new System.Uri(url);
79 if (((wsUri.Port >= 1024 )
80 && ( string .Compare(wsUri.Host, " localHost " , System.StringComparison.OrdinalIgnoreCase) == 0 )))
81 {
82 return true ;
83 }
84 return false ;
85 }
86
87 private DSMPHeader dSMPHeaderValueField;
88 public DSMPHeader TransactionID
89 {
90 get
91 {
92 return this .dSMPHeaderValueField;
93 }
94 set
95 {
96 this .dSMPHeaderValueField = value;
97 }
98 }
99
100 [System.Web.Services.Protocols.SoapHeaderAttribute( " TransactionID " , Direction = System.Web.Services.Protocols.SoapHeaderDirection.InOut)]
101 [System.Web.Services.Protocols.SoapDocumentMethodAttribute( " http://www.monternet.com/dsmp/dsmp " , RequestElementName = " UnSubscribeServiceReq " , RequestNamespace = " http://www.monternet.com/dsmp/schemas/ " , ResponseElementName = " UnSubscribeServiceResp " , ResponseNamespace = " http://www.monternet.com/dsmp/schemas/ " , Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
102 public void UnSubscribeServiceReq( ref string MsgType, ref string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr, out int hRet)
103 {
104 object [] Ret = base .Invoke( " UnSubscribeServiceReq " , new object [] { MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr });
105
106 Version = ( string )Ret[ 0 ];
107 MsgType = ( string )Ret[ 1 ];
108 hRet = ( int )Ret[ 2 ];
109 }
110
111 [System.Web.Services.Protocols.SoapHeaderAttribute( " TransactionID " , Direction = System.Web.Services.Protocols.SoapHeaderDirection.InOut)]
112 [System.Web.Services.Protocols.SoapDocumentMethodAttribute( " http://www.monternet.com/dsmp/dsmp " , RequestElementName = " SubscribeServiceReq " , RequestNamespace = " http://www.monternet.com/dsmp/schemas/ " , ResponseElementName = " SubscribeServiceResp " , ResponseNamespace = " http://www.monternet.com/dsmp/schemas/ " , Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
113 public void SubscribeServiceReq( ref string MsgType, ref string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr, out int hRet, out string LinkID)
114 {
115 object [] Ret = base .Invoke( " SubscribeServiceReq " , new object [] { MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr });
116
117 Version = ( string )Ret[ 0 ];
118 MsgType = ( string )Ret[ 1 ];
119 hRet = ( int )Ret[ 2 ];
120 LinkID = ( string )Ret[ 3 ];
121 }
122
123 /// <remarks/>
124 public event UnSubscribeServiceReqCompletedEventHandler UnSubscribeServiceReqCompleted;
125
126 /// <remarks/>
127 public void UnSubscribeServiceReqAsync( string MsgType, string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr)
128 {
129 this .UnSubscribeServiceReqAsync(MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr, null );
130 }
131
132 /// <remarks/>
133 public void UnSubscribeServiceReqAsync( string MsgType, string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr, object userState)
134 {
135 if (( this .UnSubscribeServiceReqOperationCompleted == null )) {
136 this .UnSubscribeServiceReqOperationCompleted = new System.Threading.SendOrPostCallback( this .OnUnSubscribeServiceReqOperationCompleted);
137 }
138 this .InvokeAsync( " UnSubscribeServiceReq " , new object [] {
139 MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr}, this .UnSubscribeServiceReqOperationCompleted, userState);
140 }
141
142 private void OnUnSubscribeServiceReqOperationCompleted( object arg) {
143 if (( this .UnSubscribeServiceReqCompleted != null )) {
144 System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
145 this .UnSubscribeServiceReqCompleted( this , new UnSubscribeServiceReqCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
146 }
147 }
148
149 /// <remarks/>
150 public event SubscribeServiceReqCompletedEventHandler SubscribeServiceReqCompleted;
151
152 /// <remarks/>
153 public void SubscribeServiceReqAsync( string MsgType, string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr)
154 {
155 this .SubscribeServiceReqAsync(MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr, null );
156 }
157
158 /// <remarks/>
159 public void SubscribeServiceReqAsync( string MsgType, string Version, address_info Send_Address, address_info Dest_Address, user_id FeeUser_ID, user_id DestUser_ID, service_id Service_ID, string FeatureStr, object userState)
160 {
161 if (( this .SubscribeServiceReqOperationCompleted == null ))
162 {
163 this .SubscribeServiceReqOperationCompleted = new System.Threading.SendOrPostCallback( this .OnSubscribeServiceReqOperationCompleted);
164 }
165 this .InvokeAsync( " SubscribeServiceReq " , new object [] {
166 MsgType, Version, Send_Address, Dest_Address, FeeUser_ID, DestUser_ID, Service_ID, FeatureStr}, this .SubscribeServiceReqOperationCompleted, userState);
167 }
168
169 private void OnSubscribeServiceReqOperationCompleted( object arg)
170 {
171 if (( this .SubscribeServiceReqCompleted != null ))
172 {
173 System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
174 this .SubscribeServiceReqCompleted( this , new SubscribeServiceReqCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
175 }
176 }
177
178 }
179
180 [System.CodeDom.Compiler.GeneratedCodeAttribute( " System.Xml " , " 2.0.50727.42 " )]
181 [System.SerializableAttribute()]
182 [System.Diagnostics.DebuggerStepThroughAttribute()]
183 [System.ComponentModel.DesignerCategoryAttribute( " code " )]
184 [System.Xml.Serialization.XmlTypeAttribute(Namespace = " http://tempuri.org/ " )]
185 public partial class address_info
186 {
187 private int _DeviceType = 0 ;
188 public int DeviceType
189 {
190 get
191 {
192 return _DeviceType;
193 }
194 set
195 {
196 _DeviceType = value;
197 }
198 }
199
200 private string _DeviceID = "" ;
201 public string DeviceID
202 {
203 get
204 {
205 return _DeviceID;
206 }
207 set
208 {
209 _DeviceID = value;
210 }
211 }
212
213 public address_info() { }
214
215 public address_info( int DeviceType, string DeviceID)
216 {
217 this .DeviceType = DeviceType;
218 this .DeviceID = DeviceID;
219 }
220 }
221
222 [System.CodeDom.Compiler.GeneratedCodeAttribute( " System.Xml " , " 2.0.50727.42 " )]
223 [System.SerializableAttribute()]
224 [System.Diagnostics.DebuggerStepThroughAttribute()]
225 [System.ComponentModel.DesignerCategoryAttribute( " code " )]
226 [System.Xml.Serialization.XmlTypeAttribute(Namespace = " http://tempuri.org/ " )]
227 public partial class user_id
228 {
229 public int UserIDType = 1 ;
230 public string MSISDN = "" ;
231 public string PseudoCode = "" ;
232 public user_id() { }
233
234 public user_id( string Mobile)
235 {
236 MSISDN = Mobile;
237 }
238 }
239
240 [System.CodeDom.Compiler.GeneratedCodeAttribute( " System.Xml " , " 2.0.50727.42 " )]
241 [System.SerializableAttribute()]
242 [System.Diagnostics.DebuggerStepThroughAttribute()]
243 [System.ComponentModel.DesignerCategoryAttribute( " code " )]
244 [System.Xml.Serialization.XmlTypeAttribute(Namespace = " http://tempuri.org/ " )]
245 public partial class service_id
246 {
247 public int ServiceIDType = 1 ;
248 public string SPID = "" ;
249 public string SPServiceID = "" ;
250 public string AccessNo = "" ;
251 public string FeatureStr = "" ;
252 public service_id() { }
253
254 public service_id( int ServiceIDType, string Param1, string Param2)
255 {
256 Setting(ServiceIDType, Param1, Param2);
257 }
258
259 public service_id( string SPID, string SPServiceID)
260 {
261 Setting( 1 , SPID, SPServiceID);
262 }
263
264 public void Setting( int ServiceIDType, string Param1, string Param2)
265 {
266 this .ServiceIDType = ServiceIDType;
267 switch (ServiceIDType)
268 {
269 case 2 :
270 {
271 this .AccessNo = Param1;
272 this .FeatureStr = Param2;
273 break ;
274 }
275 default :
276 {
277 ServiceIDType = 1 ;
278 this .SPID = Param1;
279 this .SPServiceID = Param2;
280 break ;
281 }
282 }
283 }
284 }
285
286 /// <remarks/>
287 [System.CodeDom.Compiler.GeneratedCodeAttribute( " System.Xml " , " 2.0.50727.42 " )]
288 [System.SerializableAttribute()]
289 [System.Diagnostics.DebuggerStepThroughAttribute()]
290 [System.ComponentModel.DesignerCategoryAttribute( " code " )]
291 [System.Xml.Serialization.XmlTypeAttribute(Namespace = " http://www.w3.org/2001/XMLSchema " )]
292 [System.Xml.Serialization.XmlRootAttribute( " TransactionID " , Namespace = " http://www.monternet.com/dsmp/schemas/ " , IsNullable = false )]
293 public partial class DSMPHeader : System.Web.Services.Protocols.SoapHeader
294 {
295 [XmlTextAttribute( typeof ( string ))]
296 public string _TransactionID = " 000000000000 " ;
297
298
299 static public implicit operator DSMPHeader( string value)
300 {
301 DSMPHeader ret = new DSMPHeader();
302 ret._TransactionID = value;
303 return ret;
304 }
305
306 static public implicit operator string (DSMPHeader value)
307 {
308 return value._TransactionID;
309 }
310
311 private System.Xml.XmlAttribute[] anyAttrField;
312
313 /// <remarks/>
314 [System.Xml.Serialization.XmlAnyAttributeAttribute()]
315 public System.Xml.XmlAttribute[] AnyAttr
316 {
317 get
318 {
319 return this .anyAttrField;
320 }
321 set
322 {
323 this .anyAttrField = value;
324 }
325 }
326 }
327
328
329 /// <remarks/>
330 public delegate void UnSubscribeServiceReqCompletedEventHandler( object sender, UnSubscribeServiceReqCompletedEventArgs e);
331
332 /// <remarks/>
333 public partial class UnSubscribeServiceReqCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
334
335 private object [] results;
336
337 internal UnSubscribeServiceReqCompletedEventArgs( object [] results, System.Exception exception, bool cancelled, object userState) :
338 base (exception, cancelled, userState) {
339 this .results = results;
340 }
341
342 /// <remarks/>
343 public string Version
344 {
345 get
346 {
347 this .RaiseExceptionIfNecessary();
348 return (( string )( this .results[ 0 ]));
349 }
350 }
351
352 /// <remarks/>
353 public string MsgType
354 {
355 get
356 {
357 this .RaiseExceptionIfNecessary();
358 return (( string )( this .results[ 1 ]));
359 }
360 }
361
362 /// <remarks/>
363 public int hRet
364 {
365 get
366 {
367 this .RaiseExceptionIfNecessary();
368 return (( int )( this .results[ 2 ]));
369 }
370 }
371 }
372
373 /// <remarks/>
374 public delegate void SubscribeServiceReqCompletedEventHandler( object sender, SubscribeServiceReqCompletedEventArgs e);
375
376 /// <remarks/>
377 public partial class SubscribeServiceReqCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
378 {
379
380 private object [] results;
381
382 internal SubscribeServiceReqCompletedEventArgs( object [] results, System.Exception exception, bool cancelled, object userState)
383 :
384 base (exception, cancelled, userState)
385 {
386 this .results = results;
387 }
388
389 /// <remarks/>
390 public string Version
391 {
392 get
393 {
394 this .RaiseExceptionIfNecessary();
395 return (( string )( this .results[ 0 ]));
396 }
397 }
398
399 /// <remarks/>
400 public string MsgType
401 {
402 get
403 {
404 this .RaiseExceptionIfNecessary();
405 return (( string )( this .results[ 1 ]));
406 }
407 }
408
409 /// <remarks/>
410 public int hRet
411 {
412 get
413 {
414 this .RaiseExceptionIfNecessary();
415 return (( int )( this .results[ 2 ]));
416 }
417 }
418
419 /// <remarks/>
420 public string LinkID
421 {
422 get
423 {
424 this .RaiseExceptionIfNecessary();
425 return (( string )( this .results[ 3 ]));
426 }
427 }
428 }
429 }
东西并不神秘,和普通WEBService是一样的,只是数据定义稍微麻烦点
下面是测试代码:
反向订购:
1
DSMP.Provision request
=
new
DSMP.Provision(URL);
2
3 request.TransactionID = " 00120000000001 " ;
4 try
5 {
6 string Version = " 1.5.0 " ;
7 string MsgType = " SubscribeServiceReq " ;
8 int RetValue;
9 string LinkID;
10 request.SubscribeServiceReq( ref MsgType, ref Version, new DSMP.address_info( 400 , " 企业代码 " ), new DSMP.address_info( 0 , " 0012 " ), new DSMP.user_id( " 手机号码 " ), new DSMP.user_id( " 手机号码 " ), new DSMP.service_id( " 企业代码 " , " 计费代码 " ), "" , out RetValue, out LinkID);
11
12 MessageBox.Show(RetValue.ToString());
13 }
14 catch (Exception Err)
15 {
16 MessageBox.Show(Err.Message);
17 }
18
2
3 request.TransactionID = " 00120000000001 " ;
4 try
5 {
6 string Version = " 1.5.0 " ;
7 string MsgType = " SubscribeServiceReq " ;
8 int RetValue;
9 string LinkID;
10 request.SubscribeServiceReq( ref MsgType, ref Version, new DSMP.address_info( 400 , " 企业代码 " ), new DSMP.address_info( 0 , " 0012 " ), new DSMP.user_id( " 手机号码 " ), new DSMP.user_id( " 手机号码 " ), new DSMP.service_id( " 企业代码 " , " 计费代码 " ), "" , out RetValue, out LinkID);
11
12 MessageBox.Show(RetValue.ToString());
13 }
14 catch (Exception Err)
15 {
16 MessageBox.Show(Err.Message);
17 }
18
反向取消与此类似,我就不再罗嗦了