<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Services</title><link>https://www.infopathdev.com:443/forums/48.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: maybe i am dot using web services corretcly</title><link>https://www.infopathdev.com:443/forums/thread/20009.aspx</link><pubDate>Wed, 16 May 2007 08:25:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:20009</guid><dc:creator>basescu</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/20009.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=20009</wfw:commentRss><description>&lt;p&gt;First of all thank u for your response, but&amp;nbsp;system.environment.username works in forms not fully trusted.&lt;/p&gt;&lt;p&gt;Then i must say that giveing me vb code doesn&amp;#39;t help me very much because i don&amp;#39;t know it.&lt;/p&gt;&lt;p&gt;I&amp;nbsp;don&amp;#39;t know what code u want. If u explain me more maybe i can.&lt;/p&gt;&lt;p&gt;:)&lt;/p&gt;&lt;p&gt;Basescu&lt;/p&gt;</description></item><item><title>Re: maybe i am dot using web services corretcly</title><link>https://www.infopathdev.com:443/forums/thread/19734.aspx</link><pubDate>Thu, 10 May 2007 08:36:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19734</guid><dc:creator>ahardin</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19734.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=19734</wfw:commentRss><description>&lt;p&gt;system.environment.username only works on fully trusted forms outside of VStudio.&lt;/p&gt;&lt;p&gt;I run this internally with a VB web service and get it to work but need help converting it to C# so perhaps we can swap ideas?&lt;/p&gt;&lt;p&gt;What i did was add a data connection, select receive data, select web service, then type in the .....asmx?WSDL location and click next, name the connection and click finish.&lt;/p&gt;&lt;p&gt;Now I add the code below to my form to pull off the detail i need then&amp;nbsp;go&amp;nbsp;in Tools - Form Options - Open and Save - Rules add a rule that says if CONDITION X (where condition X only occurs on the opening of the form) set @FieldA to (Secondary Data Source Web Service) Given Name, @FieldB to sn and so on.&amp;nbsp; Works a treat&amp;nbsp;&lt;/p&gt;&lt;p&gt;Sub XDocument_OnLoad(eventObj) Set xmlFirstName = XDocument.DOM.SelectSingleNode(&amp;quot;/my:myFields/my:req_first_name&amp;quot;) Set xmlLastName = XDocument.DOM.SelectSingleNode(&amp;quot;/my:myFields/my:req_last_name&amp;quot;) Set xmlTitle = XDocument.DOM.SelectSingleNode(&amp;quot;/my:myFields/my:req_title&amp;quot;) Set xmlMail = XDocument.DOM.SelectSingleNode(&amp;quot;/my:myFields/my:req_email&amp;quot;) Set xmlDepartment = XDocument.DOM.SelectSingleNode(&amp;quot;/my:myFields/my:req_dept_num&amp;quot;) End Sub&lt;/p&gt;&lt;p&gt;Any chance you could send me the code for this query in C#?&lt;/p&gt;&lt;p&gt;This way no extra coding and Infopath handles all the tricky bits.&lt;/p&gt;&lt;p&gt;Any problems&amp;nbsp;I am here to help.&lt;/p&gt;&lt;p&gt;Adam&lt;/p&gt;</description></item><item><title>maybe i am dot using web services corretcly</title><link>https://www.infopathdev.com:443/forums/thread/19692.aspx</link><pubDate>Wed, 09 May 2007 12:59:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19692</guid><dc:creator>basescu</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19692.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=19692</wfw:commentRss><description>&lt;p&gt;Hello.&lt;/p&gt;&lt;p&gt;I use a web service to qery the AD to get the givenname and the surname of the preson hwo opens the form. The form is published on sharepoint. When someone wants to fill a form, he goes on sharepoint, on the form library and clicks on &amp;quot;fill this form&amp;quot;. I want that the givenname and the surname of theperson that opens the form to be completed on load.&lt;/p&gt;&lt;p&gt;So in my infopath project made in vs 2005 with c# i added a web reference to the web service. This reference is named SP2007.&lt;/p&gt;&lt;p&gt;The web service contains two web methods &lt;/p&gt;&lt;p&gt;string GetSurname(string userName){}&lt;/p&gt;&lt;p&gt;string GetGivenName(string userName){}&lt;/p&gt;&lt;p&gt;And&amp;nbsp; then i add a on_load event, end write code to complete the textboxes with the strings returned by methods:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;p&gt;public&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; OnLoad(&lt;/font&gt;&lt;font color="#008080" size="2"&gt;DocReturnEvent&lt;/font&gt;&lt;font size="2"&gt; e)&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;// Write your code here.&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; userName = System.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Environment&lt;/font&gt;&lt;font size="2"&gt;.UserName;&lt;p&gt;sp2007.&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt; serviciu= &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; sp2007.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt;();&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; nume = serviciu.GetNume(userName);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; OnLoad(&lt;/font&gt;&lt;font color="#008080" size="2"&gt;DocReturnEvent&lt;/font&gt;&lt;font size="2"&gt; e)&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;// Write your code here.&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; userName = System.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Environment&lt;/font&gt;&lt;font size="2"&gt;.UserName;&lt;p&gt;sp2007.&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt; serviciu= &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; sp2007.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt;();&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; nume = serviciu.GetNume(userName);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// Write your code here.&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; userName = System.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Environment&lt;/font&gt;&lt;font size="2"&gt;.UserName;&lt;p&gt;sp2007.&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt; serviciu= &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; sp2007.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt;();&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; nume = serviciu.GetNume(userName);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; userName = System.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Environment&lt;/font&gt;&lt;font size="2"&gt;.UserName;&lt;p&gt;sp2007.&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt; serviciu= &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; sp2007.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt;();&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; nume = serviciu.GetNume(userName);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt; serviciu= &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; sp2007.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Service&lt;/font&gt;&lt;font size="2"&gt;();&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; nume = serviciu.GetNume(userName);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; nume = serviciu.GetNume(userName);&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;thisXDocument.DOM.selectSingleNode(&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:nume&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text =serviciu.GetSurname(userName);&lt;p&gt;thisXDocument.DOM.selectSingleNode(&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:prenume&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text = serviciu.GetGivenname(userName);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:nume&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text =serviciu.GetSurname(userName);&lt;p&gt;thisXDocument.DOM.selectSingleNode(&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:prenume&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text = serviciu.GetGivenname(userName);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:prenume&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text = serviciu.GetGivenname(userName);&lt;/font&gt;&lt;p&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;/p&gt;&lt;p&gt;ok&lt;/p&gt;&lt;p&gt;that is all my code.&lt;/p&gt;&lt;p&gt;I&amp;nbsp;am not using any data connections.&amp;nbsp;I am not using WebServiceAdapter2 or anything like that. is it a problem? Should have i use these?&lt;/p&gt;&lt;p&gt;The thing is when i run the form from within vs2005 all works fine. After i published on sharepoint the web service doesn&amp;#39;t work.&lt;/p&gt;&lt;p&gt;I&amp;nbsp;get this:&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span class="xdtextboxctrl1ms-xedit-plaintext"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;System.Security.SecurityException: Request for the permission of type &amp;#39;System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;#39; failed. at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp;amp; stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) at System.Net.HttpRequestCreator.Create(Uri Uri) at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) at System.Net.WebRequest.Create(Uri requestUri) at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at CerereInvoire.sp2007.Service.GetNume(String userName) at CerereInvoire.CerereInvoire.OnLoad(DocReturnEvent e) The action that failed was: Demand The type of the first permission that failed was: System.Net.WebPermission The Zone of the assembly that failed was: Intranet&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span class="xdtextboxctrl1ms-xedit-plaintext"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Please help me a little. i am stuck.&lt;/p&gt;&lt;p&gt;Basescu&lt;/p&gt;</description></item></channel></rss>