Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting a SOAP header parameter with SelectSingleNode
Message
De
19/01/2004 11:33:14
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00867946
Message ID:
00868168
Vues:
24
>I don't see a need for you to change the way the header is generated. The XML fragment you are receiving is correct as far as the W3C recommendation is concerned.
>
>All you need to do is to adapt your code to use XML Namespace prefixes in the XPath expressions. The XPath 1.0 specification doesn't support default XML Namespaces (Namespaces without a prefix). So, as your XML fragment uses a default namespace, you need a way to map it with a prefix and this is what the SetProperty/SelectionNamespaces is doing.
>
>Does this make sense?

Well, this is the SOAP header on the client side for the IHeaderHandler_readHeader event:
PROTECTED FUNCTION IHeaderHandler_readHeader(toReader As MSSOAPLib30.ISoapReader,;
 toHeaderNode As MSXML2.IXMLDOMNode,toObject As Object) AS Boolean
IF toHeaderNode.baseName<>'EnteteHere' OR toHeaderNode.namespaceURI<>'http://tempuri.org/MyHeader'
   RETURN .F.
ENDIF

* Adjust namespace so MSXML4 can be used
* Otherwise, SelectSingleNode() won't work
toHeaderNode.SetProperty('SelectionNamespaces',"xmlns:x='http://tempuri.org/MyHeader'")

This.FirstNode=toHeaderNode.SelectSingleNode('/x:EnteteHere/x:FirstNode').Text

RETURN .T.
ENDFUNC
The problem is that MSXML2.IXMLDOMNode doesn't include the SetProperty() method.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform