Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting a SOAP header parameter with SelectSingleNode
Message
From
19/01/2004 10:50:06
 
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00867946
Message ID:
00868150
Views:
27
>Please, try the following code and see if it works:
>
>
>LOCAL lcXML  as String
>LOCAL loDOM  as MSXML2.DOMDocument
>LOCAL loNode as MSXML2.IXMLDOMNode
>
>TEXT TO lcXML TEXTMERGE NOSHOW PRETEXT 1+2+4
>  <EnteteHere xmlns="http://tempuri.org/MyHeader">
>     <FirstNode>20040118182337229</FirstNode>
>  </EnteteHere>
>ENDTEXT
>
>loDOM = CREATEOBJECT("MSXML2.DOMDocument.4.0")
>loDOM.loadXML(lcXML)
>
>loDOM.setProperty("SelectionNamespaces", "xmlns:x='http://tempuri.org/MyHeader'")
>loNode = loDOM.selectSingleNode("/x:EnteteHere/x:FirstNode")
>
>MESSAGEBOX(loNode.Text)
>
>STORE null TO loNode, loDOM
>
>
>Notice that I prefixed your elements with a Namespace prefix of "x" in order to fulfill the XPath requirement.

Ok, that works. But, that header is created by a SOAP header such as:
toSerializer.startHeaderElement('EnteteHere','http://tempuri.org/MyHeader')
I can't find a way to plug that in there. Also, the client has specific requirements for sending that header. I don't think I can modify that.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform