Guest User

Untitled

a guest
Dec 11th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. namespace MyMainService
  2. {
  3.  
  4. [System.Web.Services.WebServiceBindingAttribute(Name="MyMainServiceImplPortBinding", Namespace="http://webService.main.myService.com/")]
  5. public partial class MyMainServiceImplService : System.Web.Services.Protocols.SoapHttpClientProtocol {
  6.  
  7. public AuthenticationHeader AuthenticationHeaderValue;
  8.  
  9. public MyMainServiceImplService() {
  10. this.Url = "http://.../MyMainServiceImplService";
  11. }
  12.  
  13. [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://webService.main.myService.com/", ResponseNamespace="http://webService.main.myService.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
  14. [return: System.Xml.Serialization.XmlElementAttribute("return")]
  15. public string invokeTransaction(string request) {
  16. object[] results = this.Invoke("invokeTransaction", new object[] {
  17. request});
  18. return ((string)(results[0]));
  19. }
  20. }
  21.  
  22. public class AuthenticationHeader : SoapHeader
  23. {
  24. public string UserName;
  25. public string Password;
  26. }
  27. }
  28.  
  29. using (MyMainService.BlazeMainServiceImplService client = new MyMainService.MyMainServiceImplService())
  30. {
  31. client.AuthenticationHeaderValue = new MyMainService.AuthenticationHeader();
  32. client.AuthenticationHeaderValue.UserName = "username";
  33. client.AuthenticationHeaderValue.Password = "pwd";
  34.  
  35. ruleServiceResult = client.invokeTransaction(xmlRequest);
  36. }
Add Comment
Please, Sign In to add comment