<?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: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17695.aspx</link><pubDate>Wed, 21 Sep 2005 07:24:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17695</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17695.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17695</wfw:commentRss><description>Why write script? Why not write C# in your InfoPath form?&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17694.aspx</link><pubDate>Tue, 20 Sep 2005 12:25:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17694</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17694.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17694</wfw:commentRss><description>That is a bummer.  &lt;br /&gt;&lt;br /&gt;When writing script code in InfoPath you be surprised how many times I would have to write the following code which is doing the same thing as the XmlNamespaceManager class.&lt;br /&gt;&lt;br /&gt;XDocument.DataObjects("data connection").DOM.setProperty("SelectionNamespaces", "xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-07-21T20:40:37""")&lt;br /&gt;&lt;br /&gt;Glad to hear you were able to get over the hurdle.</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17693.aspx</link><pubDate>Tue, 20 Sep 2005 09:05:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17693</guid><dc:creator>glebur</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17693.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17693</wfw:commentRss><description>For now I have solved my problem by using a XmlNamespaceManager and referring to it each time I use the SelectSingleNode method :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[WebMethod]&lt;br /&gt;		public bool testInsertion(String s) &lt;br /&gt;		{&lt;br /&gt;			XmlDocument doc = new XmlDocument();&lt;br /&gt;			doc.LoadXml(s);&lt;br /&gt;			XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);&lt;br /&gt;			nsmgr.AddNamespace("my", "http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-08-25T08-37-41");&lt;br /&gt;&lt;br /&gt;string titre = doc.SelectSingleNode("my:insererContenu/my:titre", nsmgr).InnerText;&lt;br /&gt;...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It's a bit tiresome but it works.&lt;br /&gt;&lt;br /&gt;Thanks for the serialization suggestion, I'll have a look at it.</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17692.aspx</link><pubDate>Tue, 20 Sep 2005 06:03:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17692</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17692.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17692</wfw:commentRss><description>Serialization is good! Yes.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17691.aspx</link><pubDate>Mon, 19 Sep 2005 19:40:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17691</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17691.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17691</wfw:commentRss><description>Yes, that is another great approach.  Make your .NET classes XML Serializable.  I was lead to believe the original implementation of the web service was not in .NET code.  Otherwise that great practice.</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17690.aspx</link><pubDate>Mon, 19 Sep 2005 19:29:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17690</guid><dc:creator>Sumeet</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17690.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17690</wfw:commentRss><description>Hi Guys,&lt;br /&gt;&lt;br /&gt;I have been researching this topic for almost three days and this is the way I found to pass a complex type(object) to and from a web-service. Convert it to an XML string and then reconstruct the object on the web-service side from the string and then do stuff and then do the whole process of converting it to a string again and then deserializing the XML string and re-constructing the object.&lt;br /&gt;&lt;br /&gt;A perfect example can be found at&lt;a target="_blank" href=http://www.codeproject.com/soap/XmlToClassAndBack.asp.&gt;http://www.codeproject.com/soap/XmlToClassAndBack.asp.&lt;/a&gt; Remember to add the reference to System.XML.Serialization and  [XmlType(Namespace="xyz")] attribute to the class. &lt;br /&gt;&lt;br /&gt;Hope this helps.</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17689.aspx</link><pubDate>Mon, 19 Sep 2005 13:52:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17689</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17689.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17689</wfw:commentRss><description>Yeah...the namespace issue will bite you...it has with me in the past.  I personally do not like this "my" namespace that InfoPath shoves on you.  I would love to sit down and write an article on XSD management with InfoPath in an enterprise.  The problem is, which I can see as becoming a problem, is that developers do not see a bigger picture when developing an InfoPath form and the underlying XSD they are building for thier form.&lt;br /&gt;&lt;br /&gt;Two suggestions, and maybe Patrick would like to chime in:&lt;br /&gt;&lt;br /&gt;1 - Check into adding the namespace to your XmlDocument object just like you would in script in InfoPath.  Not sure how to do offhand.&lt;br /&gt;2 - Export the XSD that you currently have in your InfoPath form, and then load it into your XmlDocument object to validate the XML.&lt;br /&gt;&lt;br /&gt;Another thing you can do in the future is to write you own XSD and do not use the one generated by InfoPath.  This will allow you to independantly publish and XSD that you can use in InfoPath, Webservice or another layer of your enterprise architecture.  There are some Pros and Cons.</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17688.aspx</link><pubDate>Mon, 19 Sep 2005 12:28:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17688</guid><dc:creator>glebur</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17688.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17688</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I followed your recommendation and now the web service takes a string as a parameter instead of a complex type :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;[WebMethod]&lt;br /&gt;		public bool testInsertion(String s) &lt;br /&gt;		{&lt;br /&gt;			XmlDocument doc = new XmlDocument();&lt;br /&gt;			doc.LoadXml(s);&lt;br /&gt;			&lt;br /&gt;			try &lt;br /&gt;			{&lt;br /&gt;				string titre = doc.SelectSingleNode("my:insererContenu/my:titre").InnerText;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;with an Infopath SOAP request that looks like this :&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;my:insererContenu xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-08-25T08-37-41"&amp;gt;&lt;br /&gt;&amp;lt;my:titre&amp;gt;titre test&amp;lt;/my:titre&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;/my:insererContenu&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The problem is, the XmlDocument can't handle elements with "my:" prefix !&lt;br /&gt;&lt;br /&gt;When I debug the web service and try to access the value of &lt;i&gt;doc.SelectSingleNode("my:insererContenu/my:titre")&lt;/i&gt;, I get this error :&lt;br /&gt;&lt;br /&gt;System.SystemException. Namespace manager or XsltContext is required. This query has a prefix, a variable, or a user-defined function.&lt;br /&gt;&lt;br /&gt;So it seems that the LoadXML() method doesn't detect the namespace definition contained in the &amp;lt;my:insererContenu&amp;gt; root node...&lt;br /&gt;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 ?&lt;br /&gt;&lt;br /&gt;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 ;)&lt;br /&gt;&lt;br /&gt;Thanks</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17687.aspx</link><pubDate>Thu, 08 Sep 2005 01:08:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17687</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17687.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17687</wfw:commentRss><description>Wow...did not know you were have problems getting InfoPath working with a web service that is not in .NET.  Will have to give that a try sometime soon...had assumed there would be no issues there.</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17686.aspx</link><pubDate>Wed, 07 Sep 2005 15:27:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17686</guid><dc:creator>glebur</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17686.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17686</wfw:commentRss><description>Vt, don't get me wrong. I'm not calling you a MS propagandist at all.&lt;br /&gt;&lt;br /&gt;But the point is, I tried to set up a non-DotNet web service for my InfoPath form to communicate with.&lt;br /&gt;I created the wsdl myself, respecting the xsd standards and everything (the web service was in PHP, but who cares).&lt;br /&gt;&lt;br /&gt;It worked perfectly with a classical web service client but there's no way I could make it function in conjunction with Infopath because InfoPath *didn't accept* the wsdl definition. &lt;br /&gt;That's why I thought an automatically generated DotNet web service could do the trick (though I was quite reluctant about it at first).&lt;br /&gt;&lt;br /&gt;So I'm just saying that if InfoPath is not able to correctly interface with a slightly complex .NET web service, Microsoft have to stop their marketing b*****t about that product ("fully integrates with Web Services",  "provides a rich client experience for Web Services XML data" and blah blah blah)...&lt;br /&gt;&lt;br /&gt;Now if I have to change my web service parameters so that it takes a string instead of a complex type, I'll do it but it won't be very clean or self-descriptive.</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17685.aspx</link><pubDate>Wed, 07 Sep 2005 07:57:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17685</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17685.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17685</wfw:commentRss><description>Great article!&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17684.aspx</link><pubDate>Tue, 06 Sep 2005 22:56:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17684</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17684.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17684</wfw:commentRss><description>Great article on 5 five things that a web service should not do.&lt;br /&gt;&lt;br /&lt;a target="_blank" href=http://www.theserverside.net/articles/showarticle.tss?id=Top5WSMistakes&gt;http://www.theserverside.net/articles/showarticle.tss?id=Top5WSMistakes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I know this is an InfoPath forum but the first mistake is directly tied to this thread...</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17683.aspx</link><pubDate>Tue, 06 Sep 2005 17:29:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17683</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17683.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17683</wfw:commentRss><description>Well, this really is not a Microsoft issue.  When I referred to the word above "Portability" that means the code is not technology or platform dependant.  This is why a lot of people do down the Java path.  I do not to go off a tangent, but this is why InfoPath is SO powerful.  XML is an independent standard that is not Microsoft defined.  For instance lets say I create a web service in .NET, that web service can be called my a Microsoft .NET application or even a Java application running on a desperate machine not within an current enterprise of a company.  So, if you are writing .NET complex objects into the web service method signature you could run into issues when other applications try to call the web service (suggest you do some research into Remoting as well and review the trade offs of a web service and remoting in .NET).  If I were to use pure XML with a XSD there are no integration issues.  Right now, I am writing an InfoPath form that makes web service calls to populate combos and lists directly from SQL Server, a Mainframe system and still allow for future requirements to access a SAP.  Wow!!!  I now have a completely integrated front end that is pulling data from all of these data sources and the InfoPath form is completely decoupled from the data sources because it calls a web service that passes back raw XML.  Plus I can now re-use the web services in other technologies across this enterprise which may not be using .NET applications.  As well, I am not an expert on SOAP but again it is a non Microsoft based technology that is an industry standard.  This is not some Microsoft propaganda.  Suggest you looking into the Gang of Four design patterns.  Something like the Fascade pattern relates directly to what I am talking about.</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17682.aspx</link><pubDate>Tue, 06 Sep 2005 13:09:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17682</guid><dc:creator>glebur</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17682.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17682</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I'm quite new to .NET so I don't really know how to deal with raw XML data in a C# Web Service. All I can do is code my WebService class and the methods, and .NET does the rest...&lt;br /&gt;&lt;br /&gt;Plus, what's the point of having such complex technologies as InfoPath and VS .NET if you can't take advantage of the integrated possibilities they provide ?&lt;br /&gt;I mean I would be bothered if I had to code all those low-level operations myself. Don't tell me Microsoft didn't know programmers would want to submit more than a simple integer or string to a Web Service...&lt;br /&gt;&lt;br /&gt;Call me lazy, but I would find it much easier (and normal after all) to do things the "conventional" way.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks anyway, if I have no other choice I'll consider your advice ;)</description></item><item><title>Re: web service method with complex type parameter</title><link>https://www.infopathdev.com:443/forums/thread/17681.aspx</link><pubDate>Mon, 05 Sep 2005 23:39:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:17681</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/17681.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=48&amp;PostID=17681</wfw:commentRss><description>Just my input, but I have not tried to build complex objects in a web service and then expect a client, like InfoPath, to use that complex object in a web method call.  From a design point of view, that may not be the best approach.  You would be coupling the web service and the InfoPath form.  Suggest using pure XML to pass data to and from the InfoPath form and the web service.  From a portability aspect that would be optimum because if the web service and the InfoPath form would not be dependant on .NET.  Have you tried consuming XML in your web service and then using XmlSerializer in .NET to populate a complex object from the XML set into the web service?  Just a thought…</description></item></channel></rss>