Hi,
I followed your recommendation and now the web service takes a string as a parameter instead of a complex type :
[WebMethod]
public bool testInsertion(String s)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(s);
try
{
string titre = doc.SelectSingleNode("my:insererContenu/my:titre").InnerText;
with an Infopath SOAP request that looks like this :
<my:insererContenu xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-08-25T08-37-41">
<my:titre>titre test</my:titre>
...
</my:insererContenu>
The problem is, the XmlDocument can't handle elements with "my:" prefix !
When I debug the web service and try to access the value of
doc.SelectSingleNode("my:insererContenu/my:titre"), I get this error :
System.SystemException. Namespace manager or XsltContext is required. This query has a prefix, a variable, or a user-defined function.
So it seems that the LoadXML() method doesn't detect the namespace definition contained in the <my:insererContenu> root node...
Is there a way I can make that work, either by using another method or removing the "my:" prefixes from the SOAP request sent by Infopath ?
My boss is getting fed up with InfoPath and wants me to change for OpenOffice (which would be far less simple for me), so if you have a solution ;)
Thanks