tags:

views:

60

answers:

2

Is this even valid?

  XmlDocument doc = new XmlDocument();
     doc.InnerXml = @"<?xml version='1.0' encoding='utf-8'?><soap:Envelope
                 xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'&gt;
                 <soap:Body><Authenticate xmlns='https://na.ntrsupport.com'&gt;
                 <IdOwner>99999</IdOwner>
                 <Login>MyLogin</Login>" +
                 "<Pwd>myPass</Pwd>" +
                 "<PwdInterfaces>interfacePass</PwdInterfaces>" +
                 "<Platform>domain</Platform>" +
                 "<H>" + getMd5EncodedHash(NtrHash) + "</H>" + 
                 "</Authenticate></soap:Body></soap:Envelope>";

I am just getting an undefined error returned from the web service...

+2  A: 

You could use the SoapClient class. That way, you don't have to create a message yourself.

Sjoerd
+5  A: 

Crafting XML by string manipulation will get you in trouble. What is Login och Pwd contains any of the following characters: åäö<>&? Use XmlDocument or similar instead.

Can you access the WSDL for the web service? If so, use "Add service reference" in Visual studio to create a typed proxy for you web service.

Andreas Paulsson