You searched for the word(s): 12
-
Agni, I was able to output with ''xml'' instead of ''Xml'', and here is what shows up in the Alert box -
<GetEmployeeInfoResult xmlns=''http://tempuri.org/''><empDS ...
-
If it is in InfoPath you need select the xml node and set the value to that node. And bind that xml node to a textbox in the UI.
Code would look like
thisXDocument.DOM.selectSingleNode(...<You need to write the XML XPAth here>...).text = System.Environment.UserName;
Note: Above code in ''c#''.
Agni
InfopathDev India
-
Sorry man the statement should be
XDocument.UI.Alert(''Xml: '' + getEmployeeInfoResultNode.xml);
Just now I realised that ''xml'' should be in lowercase.
Hope this helps.
Agni
InfopathDev India
-
hihihi
yeah it works now.
super duper thanks for this...saved me a lot of trouble, really! :D
-
Agni, according to your suggestion, the line:
var getEmployeeInfoResultNode = employeeInfoWS.selectSingleNode(''/dfs:myFields/dfs:dataFields/s0:GetEmployeeInfoResponse/s0:GetEmployeeInfoResult'');
XDocument.UI.Alert(getEmployeeInfoResultNode.Xml);
yields an empty popup box. If I replace the Alert code line to:
XDocument.UI.Alert(''Xml: '' + ...
-
So what would the code look like to use System.Environment.UserName in the on load event to get the username into a text box? I realize this is probably a stuped question but I'm new to Infopath and java.
-
Can you try this please
var getEmployeeInfoResultNode = employeeInfoWS.selectSingleNode(''/dfs:myFields/dfs:dataFields/s0:GetEmployeeInfoResponse/s0:GetEmployeeInfoResult'');
XDocument.UI.Alert(getEmployeeInfoResultNode.Xml);
Look at the xml you are getting here and Look for the XPATH in that xml and give it in the following statement.
var ...
-
Agni,
I am not longer using the partial XPath. As I specified in my post(just prior to yours), I am specifying the XPath only upto the point ''s0:GetEmployeeInfoResult'', and that atleast seems to get me an object, whose text I am able to print. If I go beyond ''GetEmployeeInfoResult'', into the web service returned XML which is as ...
-
First thing is you cannot assign a double value to a string directly.
Other than that everything looks fine for me.
One other thing that could be wrong is your ''XPATH''.
Agni
InfopathDev India
-
Hi Aswin,
My best suggestion for you is, debug your WebMethod (web service) method and look at ''xdd.DocumentElement'' value
in quick watch. This way you will know the what is the xml that you are getting into the Infopath.
With this you can write the Xpath from ''root element'' to the ''leaf element'' you want.
According to my investigation ...