Search Results

Search found 3 results on 1 pages for 'soapextension'.

Page 1/1 | 1 

  • Using SoapExtensionAttributes on client side with async web methods

    - by Maxim Polishchuk
    Hey, I have a simple question. I implemented custom soap extension and registered it into client application configuration file. It works fine. (I would like to implement progress bar functionality like http://msdn.microsoft.com/en-us/library/aa480520.aspx) But I don't like some thing - custom soap extension is invoked by every call of my web service. In order to fix this situation (call WS just by required methods) I implemented custom SoapExtensionAttribute like below: [AttributeUsage(AttributeTargets.Method)] public class CustomSoapExtensionAttribute : SoapExtensionAttribute { public override int Priority { get; set; } public CustomSoapExtensionAttribute() : this (1) { } public CustomSoapExtensionAttribute(int priority) { Priority = priority; } public override Type ExtensionType { get { return typeof(CustomSoapExtension); } } } I added this attribute to required methods of web service proxy classes (and removed registration into client configuration file). My soap extension doesn't invoke when required web methods are calling. Can someone help me to solve this problem or select any other solution? Anotherone, I don't know it is important or not - my required methods are async web methods. Best regards, Maxim

    Read the article

  • Global Error Handling for Web Services

    - by jusaskin
    I have a web project consisting of only web services. I need a global way of handling errors on the server so I can send emails, log in event log, etc. Global.asax doesn't work according to MSDN. How should I go about this? I have tried creating a soapExtension, but it is never hit.

    Read the article

  • Solution to Jira web service getWorklogs method error: Object of type System.Xml.XmlNode[] cannot be stored in an array of this type

    - by DigiMortal
    When using Jira web service methods that operate on work logs you may get the following error when running your .NET application: Object of type System.Xml.XmlNode[] cannot be stored in an array of this type. In this posting I will show you solution to this problem. I don’t want to go to deep in details about this problem. I think it’s enough for this posting to mention that this problem is related to one small conflict between .NET web service support and Axis. Of course, Jira team is trying to solve it but until this problem is solved you can use solution provided here. There is good solution to this problem given by Jira forum user Kostadin. You can find it from Jira forum thread RemoteWorkLog serialization from Soap Service in C#. Solution is simple – you have to use SOAP extension class to replace new class names with old ones that .NET found from WSDL. Here is the code by Kostadin. public class JiraSoapExtensions : SoapExtension {     private Stream _streamIn;     private Stream _streamOut;       public override void ProcessMessage(SoapMessage message)     {         string messageAsString;         StreamReader reader;         StreamWriter writer;           switch (message.Stage)         {             case SoapMessageStage.BeforeSerialize:                 break;             case SoapMessageStage.AfterDeserialize:                 break;             case SoapMessageStage.BeforeDeserialize:                 reader = new StreamReader(_streamOut);                 writer = new StreamWriter(_streamIn);                 messageAsString = reader.ReadToEnd();                 switch (message.MethodInfo.Name)                 {                     case "getWorklogs":                     case "addWorklogWithNewRemainingEstimate":                     case "addWorklogAndAutoAdjustRemainingEstimate":                     case "addWorklogAndRetainRemainingEstimate":                         messageAsString = messageAsString.                             .Replace("RemoteWorklogImpl", "RemoteWorklog")                             .Replace("service", "beans");                         break;                 }                 writer.Write(messageAsString);                 writer.Flush();                 _streamIn.Position = 0;                 break;             case SoapMessageStage.AfterSerialize:                 _streamIn.Position = 0;                 reader = new StreamReader(_streamIn);                 writer = new StreamWriter(_streamOut);                 messageAsString = reader.ReadToEnd();                 writer.Write(messageAsString);                 writer.Flush(); break;         }     }       public override Stream ChainStream(Stream stream)     {         _streamOut = stream;         _streamIn = new MemoryStream();         return _streamIn;     }       public override object GetInitializer(Type type)     {         return GetType();     }       public override object GetInitializer(LogicalMethodInfo info,         SoapExtensionAttribute attribute)     {         return null;     }       public override void Initialize(object initializer)     {     } } To get this extension work with Jira web service you have to add the following block to your application configuration file (under system.web section). <webServices>   <soapExtensionTypes>    <add type="JiraStudioExperiments.JiraSoapExtensions,JiraStudioExperiments"           priority="1"/>   </soapExtensionTypes> </webServices> Weird thing is that after successfully using this extension and disabling it everything still works.

    Read the article

1