The root element is missing and soapExtension

C

cordata5

Hi I'm using the example posted on Ron Howard's site for encryting the
body of an xml file located at http://www.gotdotnet.com/team/rhoward/
I'm running into trouble where i'm getting an error of this type:

System.Web.Services.Protocols.SoapException: Server was unable to
process request. ---> System.Xml.XmlException: The root element is
missing. at System.Xml.XmlTextReader.Read() at
System.Xml.XmlReader.MoveToContent() at
System.Web.Services.Protocols.SoapServerProtocolHelper.GetHelper(SoapServerProtocol
protocol) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.Invoke() at
System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
--- End of inner exception stack trace ---

Does anyone have experience doing encryption of xml file via use of
soapextensions? I'm using the code directly from this example and
it's not working.
 
D

Dan Rogers

Hi,
Typically, this error means that the text reader or DOM encountered two
root nodes. This can happen if you try to load the document not starting
in the beginning of the XML stream. It can also happen if you try to
process the data by directly loading the incoming request into a text
reader. The incoming request may have an HTTP header that you have to
strip off before you get to the SOAP envelope - which you can then load.

Verify what you are reading as input (add in George Lindsay's trace
extension - this is the easiest way to see what you are getting). If you
are seeing more than one root node, then the sender may be at fault. If
you are trying to load the HTML document, then you need to peel off the
HTTP header and start of the HTML to only load the SOAP request.

Hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 
S

Stefan Lucyshyn

Thanks for your quick response. I did fix the problem and the
soapextension is now encrypting the response and passing back encrypted
data. Now the next step in my process is encrypting the request from
the client web page to the server side web service. Using the
encryptMOde = Request doesn't seem to be doing anything different from
the encryptMode = response. Am I missing something?
 
D

Dan Rogers

Remember, that to encrypt the calling side, you need to add the web service
extension into the client application configuration. If your web page
(server side) is making a web service call, it would be the config file in
that proxy scope that needs to be intercepted. As far as going direct from
the browser to a web service, this isn't something that is normal - you'd
have to have some kind of executable helper on the client side, or doing
hand crafted XML and posting direct. In that case you would probably want
to use SSL.


--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top