Click here to Skip to main content
15,891,567 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problems printing Pin
naglbitur28-Nov-05 12:45
naglbitur28-Nov-05 12:45 
GeneralRe: Problems printing Pin
Heath Stewart28-Nov-05 20:37
protectorHeath Stewart28-Nov-05 20:37 
GeneralRe: Problems printing Pin
naglbitur29-Nov-05 6:40
naglbitur29-Nov-05 6:40 
QuestionMail Server Windows App C# Pin
TAREQ F ABUZUHRI5-Nov-05 6:04
TAREQ F ABUZUHRI5-Nov-05 6:04 
AnswerRe: Mail Server Windows App C# Pin
Heath Stewart5-Nov-05 11:54
protectorHeath Stewart5-Nov-05 11:54 
QuestionSend EnterKey to telnet Pin
Niles Davis5-Nov-05 3:51
Niles Davis5-Nov-05 3:51 
AnswerRe: Send EnterKey to telnet Pin
Heath Stewart5-Nov-05 11:45
protectorHeath Stewart5-Nov-05 11:45 
QuestionCan't parse SOAP with XPath Pin
Zhornyk5-Nov-05 3:23
Zhornyk5-Nov-05 3:23 
I develop web service with extensions that encrypt and compress some parameters of web method.

So I need get certain node("soap:Envelope/soap:Body/SendServiceDataInHeader/Body") in SOAP
message(got by serialization of web method) with XPath expression.
Here is SOAP message:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<ProtocolData xmlns="http://tempuri.org/">
<IsEncrypted>true</IsEncrypted>
<IsCompressed>true</IsCompressed>
</ProtocolData>
</soap:Header>
<soap:Body>
<SendServiceDataInHeader xmlns="http://tempuri.org/">
<To>zhornick@mail.ru</To>
<Cc />
<Subject>Subj</Subject>
<Body>Body</Body>
</SendServiceDataInHeader>
</soap:Body>
</soap:Envelope>

I tried with below code snippet but it doesn't work. It may be due to default namespace.

XmlDocument xd = new XmlDocument();

xd.Load("d:\\x.xml");

XmlNamespaceManager nm = new XmlNamespaceManager(xd.NameTable);

nm.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");

nm.AddNamespace(String.Empty, "http://tempuri.org/");

XmlNode n =
xd.SelectSingleNode("soap:Envelope/soap:Body/SendServiceDataInHeader/Body", nm);

Of course I can get this node by writing:

XmlNode n =
xd.SelectSingleNode("soap:Envelope/soap:Body",

nm).FirstChild.FirstChild.NextSibling.NextSibling;

but it is not reliable and I want through direct XPath expression.

Help me resolve task please!

Andriy Zhornyk
AnswerRe: Can't parse SOAP with XPath Pin
leppie5-Nov-05 3:32
leppie5-Nov-05 3:32 
GeneralRe: Can't parse SOAP with XPath Pin
Zhornyk5-Nov-05 4:00
Zhornyk5-Nov-05 4:00 
GeneralRe: Can't parse SOAP with XPath Pin
leppie5-Nov-05 4:14
leppie5-Nov-05 4:14 
QuestionNetLocalGroupAddMembers Pin
g00fyman5-Nov-05 0:14
g00fyman5-Nov-05 0:14 
AnswerRe: NetLocalGroupAddMembers Pin
S. Senthil Kumar5-Nov-05 2:02
S. Senthil Kumar5-Nov-05 2:02 
GeneralRe: NetLocalGroupAddMembers Pin
g00fyman5-Nov-05 2:12
g00fyman5-Nov-05 2:12 
GeneralRe: NetLocalGroupAddMembers Pin
S. Senthil Kumar5-Nov-05 3:26
S. Senthil Kumar5-Nov-05 3:26 
GeneralRe: NetLocalGroupAddMembers Pin
g00fyman5-Nov-05 11:33
g00fyman5-Nov-05 11:33 
GeneralRe: NetLocalGroupAddMembers Pin
g00fyman5-Nov-05 12:05
g00fyman5-Nov-05 12:05 
GeneralRe: NetLocalGroupAddMembers Pin
S. Senthil Kumar6-Nov-05 19:02
S. Senthil Kumar6-Nov-05 19:02 
QuestionTrain free @Microsoft Pin
vikas amin4-Nov-05 22:50
vikas amin4-Nov-05 22:50 
AnswerRe: Train free @Microsoft Pin
Glaxalg7-Nov-05 6:19
Glaxalg7-Nov-05 6:19 
QuestionTrain free @Microsoft Pin
vikas amin4-Nov-05 22:50
vikas amin4-Nov-05 22:50 
QuestionCreate Array In Method Paremeters Pin
budidharma4-Nov-05 19:54
budidharma4-Nov-05 19:54 
AnswerRe: Create Array In Method Paremeters Pin
leppie4-Nov-05 20:52
leppie4-Nov-05 20:52 
AnswerRe: Create Array In Method Paremeters Pin
Jon Rista8-Nov-05 7:06
Jon Rista8-Nov-05 7:06 
QuestionReading XML attribute and write into datagrid Pin
dunbshy4-Nov-05 14:47
dunbshy4-Nov-05 14:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.