Using consumer side SoapExtensionAttribute in Beta 2 consuming Java WebServices

I have runnning and perfectly working SoapExtension project in the web application solution. The WebServices servers are a "BlackBox" to me.

I'm trying to:
1. Add an attribute to the SoapExtension.
2. Set a few values in SoapHeader's elements catching them in the AfterSerialize context of the ProcessMessage override.
3. The XPath, value, key, token and operation are supoosed to be extracted from the attribute.

I saw the article http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.soapextensionattribute, which says that the attribute has to be applied to "a method in an XML Web service client proxy class".

Nice, the proxy class objects are changed every time I refresh WebReference from Visual Studio project. So I have to go through multiple proxy classes to add the attribute again and again - services are still in development. :(

Is there any way I can "stick" the attribute to the Proxies

Is there any other way to communicate data from the WebApplication into the separate SoapExtension project
 
I was trying to utilize WSE 3.0 somehow, but unfortunately, Soap Headers I'm dealing with are customized partial mix of liberty, SAML, SASL and some other junk. :( May be WSE gurus have ideas about the best way of communication between the app and the SoapExtension

Thank you
Dmitry Cousin with DanteCo in DC




Answer this question

Using consumer side SoapExtensionAttribute in Beta 2 consuming Java WebServices

  • BpBonnett

    ===================================================
    Had an idea of creating XML files with header in the main application and stuff them into the SOAP header inside of the the SOAP Extension....

    Works nice as long as you have a SINGLE user, which is non-sense for a Web Application. Sync-ing up the headers with session would be too costly development effort, considering the deadline. :( 

    ====================================================
    Another idea of a productive solution was to use WSDL.EXE, produce bunch of the *.cs proxy files, and play with the files, which was dismissed earlier becasue of the time required for building the application and constantly changing WSDLs and XSDs. I was using Add Web Reference menu option instead.

    It failed to, becasue I'm getting warnings about WS-I Basic Profile v1.1 incompatibilities R2028, R2029, R2716 from WSDL.EXE and an error in the end, because WSDLs are separated from the XSDs and I have no control over them.....


    =====================================================
    So far the only productive option I can think of (considering the deadline for the demo) may be to get BEA Workshop and proceed with their XML beans. I'm trying to resist the temptation it as much as I can.

  • Husnok

    I have added SoapExtension a while ago out of desperation in the <webServices> <soapExtensionTypes> <add type="...... section of the web.config exactly as the article recomended by Daniel Roth describes. Actually, that's the very same article  I was using for developing the SoapExtension.

    Right now I have SoapExtension opening XmlDocument, containing the Liberty SOAP header sample and I use session encoded files to serialize the list of changes needed in the header, becasue there is no way I can access header in the ASP code (it's not in the WSDL, hence not in the proxies) and The only way to pass something into the Extension is Attributes....

    Now here is what I can and can not do:

    1. I can not change WSDLs and WSDLs contain no Soap Header description. It is assumed by the services developers that everybody's framework supports Liberty SOAP headers. :(
    2. I can get WSDLs from the services and XSDs supporting them, but any attempt to manually produce proxy classes from WSDLs and XSDs using WSDL.exe fails with different compatibility complaints.
    3. The only way I can use the Web Services is to go and Add Web Reference in the VS project management panel. Surprisingly that does not fail.

    Hence the question:

    Is there a way to generate proxies the same way Add Web Reference does and persist them for further usage with SoapHeader attributes or SoapExtensionAttribute-s



  • gireddy

    I think the easiest way to persist the proxy code is to get wsdl.exe working for the service and then modify the proxy type.

    Could you please post the steps that you follow and the errors that you are seeing when using wsdl.exe

    Thanks.

    Daniel Roth

  • Infosteo

    Now I have some WSDL working witht he WSDL.EXE. :) Java applications have been working fine for a while now, but I'm still trying to make VS-2005 (now release) to run the client at least. Actually with my hacks I was able to do so, but now I'm trying to investigate available ways of passing header info into the SOAP message, while WSDL files do not describe ANY HEADERS.

    I'm using right now a new set of the WSDL files (but still have no description of the headers in them) the WSDL complying to the Liberty 2.0 Draft schemas (http://www.projectliberty.org/) for Authentication, Discovery and Profile can not get compiled by WSDL.exe I can not provide WSDLs, XSDs or errors because of the NDA I have signed. :(  Even though I'm not 100% sure about the error messages, it's better to keep corp-lawers happy at all times. :)

    Thank you
    DC



  • slbteam08

    Proxy code for web references in Website projects is automatically regenerated at runtime, so using an attribute to add a SoapExtension is probably not the best route.  Instead, I would add your SoapExtension through the web.config file:
       http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpguide/html/cpconAlteringSOAPMessageUsingSOAPExtensions.asp

    I believe you can then filter down to the messages you are interested in.

    Daniel Roth

  • Bob Heitzman

    Actually, the question should be:

    How can I add attribute from VS into the proxy class
     
    No matter what attributes I add into the file, which I pull from VS as follows:
    1. Right click on the WebMethod call
    2. Select "Go to Definition" menu
    3. Modify the file shown.
    4. Save it.
    5. Try to compile/run/build site

    It ends with the following:

    6. Enjoy virginly new proxy file. :(
    =============================================

    Is there particular sequence of operations required to get a real modifiable proxy file




  • Rob R

    Same story with applying SoapHeader attribute in the proxy file as suggested by the article http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.soapheader. WebService proxy that I modify seems to disappear the moment I compile application. Is there any standard way to persist the proxy objects with modified attributes in the VS-2005

    Apparently, there was similar question on 09-23-2005 12:08 PM PST  in the post http://forums.microsoft.com/msdn/ShowPost.aspx PostID=94900



  • Using consumer side SoapExtensionAttribute in Beta 2 consuming Java WebServices