Hi Shanthi
Thanks for your answer, I'll try that too.
At the moment, I'm attempting to do a code-based call to the web service like virgul suggested :
try{
//Get a reference to the SendXMLNode secondary data source
IXMLDOMDocument2 objSendXMLNode =
(IXMLDOMDocument2)(thisXDocument.GetDOM("Envoi"));
objSendXMLNode.setProperty( "SelectionNamespaces", "xmlns:s1=\"http://joelallxp.microsoft.com/schema\" " +
"xmlns:s0=\"http://tempuri.org/\" " + "xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"" );
//Remove any data from the SendXMLNode secondary data source
IXMLDOMNode objData = objSendXMLNode.selectSingleNode(
"/dfs:myFields/dfs:queryFields/s0:SendXMLNode/s0:Envoi");
//Clone the XDocument (or the element with the repeating children)
IXMLDOMNode objClonedDocument =
thisXDocument.DOM.selectSingleNode("/tns:insererContenu").cloneNode(true);
objData.appendChild( objClonedDocument );
//Call the "Query" method of the secondary data source to send the data
thisXDocument.DataObjects["Envoi"].Query();
}
catch(Exception ex)
{
//eventObj.ReturnStatus = false;
}
With this code, the InfoPath form is successfully sent but again, the web service method can't fetch the contents of the submitted data.
Note that this was basically JScript code that I adapted into C#, so there may be mistakes.
In addition, several remarks come to my mind :
- The my: prefix problem might not be the point, since I've tried to contact another method of the web service taking a simple string as a parameter, and it worked perfectly.
- I was afraid to see how poorly documented the Infopath / web service interface is on the net, especially in terms of C# code.
I know that Infopath is not so widespread, but that product is now several years old, so there should be experience feedback now, not to mention official stuff from Microsoft...
- Infopath is supposed to "fully integrate with Web Services" and "provide a rich client experience for Web Services XML data". So why do you have to find such workarounds as the one Shanthi suggested to make (rather simple) things work ?
I think there's a problem there.
Anyway, I'll try that solution and let you know if it works...