471,073 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

How to grab unknown SOAP header, convert to string, and pass to class library parser?

Situation:

I have been tasked to provide a non-intrusive solution to allow .NET web services to grab an incoming SOAP header and process the credentials stored within in such a way that a credential object is returned to the web method so they can access the appropriate role information to add to database query.

In order to accomplish this, I created two class libraries, one that provides the "CredentialProfile" object definition, and one that actually parses the SOAP header to build the "CredentialProfile". These pieces function correctly when tested with a mock SOAP.xml file feed that simulates the incoming header.

The problem I am running into now is that I am using the standard approach to get SOAP headers without having to define them in the web service by using "SOAPUnknownHeader" and decorating the web method. This seems to be working, I can get the SOAP header and do some light processing on it to convert it to a string that gets passed to my parser class library but as soon as the parser library method gets invoked I get the following exception returned to me in the SOAP response:

System.IO.FileNotFoundException... could not find file C:\windows\system32\inetsrv\System.Web.Services.Pr otocols.SOAPUnknownHeader

This is being thrown from my parser class library right at the following line:

public CredentialProfile parseCredentials(string header)

So my question is, why would my parser class library care about finding SOAPUnknownHeader when the web service itself is converting the SOAPUnknownHeader to a string and sending it to the parser class library? Am I missing something?
Dec 11 '09 #1
4 4389
Situation:

I have been tasked to provide a non-intrusive solution to allow .NET web services to grab an incoming SOAP header and process the credentials stored within in such a way that a credential object is returned to the web method so they can access the appropriate role information to add to database query.

In order to accomplish this, I created two class libraries, one that provides the "CredentialProfile" object definition, and one that actually parses the SOAP header to build the "CredentialProfile". These pieces function correctly when tested with a mock SOAP.xml file feed that simulates the incoming header.

The problem I am running into now is that I am using the standard approach to get SOAP headers without having to define them in the web service by using "SOAPUnknownHeader" and decorating the web method. This seems to be working, I can get the SOAP header and do some light processing on it to convert it to a string that gets passed to my parser class library but as soon as the parser library method gets invoked I get the following exception returned to me in the SOAP response:

System.IO.FileNotFoundException... could not find file C:\windows\system32\inetsrv\System.Web.Services.Pr otocols.SOAPUnknownHeader

This is being thrown from my parser class library right at the following line:

public CredentialProfile parseCredentials(string header)

So my question is, why would my parser class library care about finding SOAPUnknownHeader when the web service itself is converting the SOAPUnknownHeader to a string and sending it to the parser class library? Am I missing something?
Dec 11 '09 #2
tlhintoq
3,525 Expert 2GB
Please don't double-post your questions. It divides attempts to help you in an organized and cohesive manner. Your threads have been merged
################################################## ################################################## #########
Dec 11 '09 #3
Sorry about that, I originally posted in .NET by mistake and re-posted in ASP.NET in hopes I could remove the original post from the .NET section. Thanks for the merge!
Dec 11 '09 #4
No one replyed so I assume no one has run into this issue but through much experimentation, I figured it out. In the end, I just sent the raw SoapUnknownHeader straight to my parser class and utlized the ".Element" property set associated with SoapUnknownHeader to parse and get what I needed. The sample from the start of my parser class is as follows:

public CredentialProfile parseCredentials(SoapUnknownHeader header)
{
credentialProfile = new SAMLTokenParser();
credentialProfile.setUid(getUID(header.Element));

XmlNodeList samlAttributes = header.Element.GetElementsByTagName(ATT_TAG);

By specifying header.Element, you can get full access to the XML properties. Hopefully this will help some lost soul in the future.
Dec 16 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Matthew Harvey | last post: by
6 posts views Thread by john deviney | last post: by
reply views Thread by Daniel Thune, MCSE | last post: by
reply views Thread by Jan Jacobs | last post: by
6 posts views Thread by Peter van der veen | last post: by
reply views Thread by Wijnand Kroes | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.