Latest post Thu, Apr 14 2016 7:34 PM by robg. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • Thu, Feb 20 2014 4:44 PM

    • QPH
    • Not Ranked
    • Joined on Fri, Jan 31 2014
    • Posts 6
    • Points 80

    WS Connection sub-sequence problem (iNews WS v1.3.0)

    Hello,

    I have a problem to use the iNEWS WS (v 1.3.0) because I can't stay logged on my sub sequence of calls...

     

    1] I'm connecting with systemClient.Connect()

    2] I'm connected if I look the systemClient.IsConnected() result

     

    But I don't find the way to link the others operations (for example SetCurrentQueue) with the primary session...

     

    Any help in v1.3 or code example (C or C#)?

     

    Thanks,

    Adrien

  • Thu, Feb 20 2014 4:52 PM In reply to

    • fiatala
    • Not Ranked
    • Joined on Fri, Jun 7 2013
    • Posts 16
    • Points 165

    Re: WS Connection sub-sequence problem (iNews WS v1.3.0)

    The three endpoints require three clients sharing the same connection. Here's a C# sample using a CookieContainer.

                INEWSSystem systemClient = new INEWSSystem();

                INEWSQueue queueClient = new INEWSQueue();

                INEWSStory storyClient = new INEWSStory();

                System.Net.CookieContainer sessionCookie = new System.Net.CookieContainer();

                systemClient.CookieContainer = sessionCookie;

                queueClient.CookieContainer = sessionCookie;

                storyClient.CookieContainer = sessionCookie;

                systemClient.Url = "http://news-web01:8080/inewswebservice/services/inewssystem";

                queueClient.Url = "http://news-web01:8080/inewswebservice/services/inewsqueue";

                storyClient.Url = "http://news-web01:8080/inewswebservice/services/inewsstory";

     

    Use systemClient.IsConnected() and queueClient.SetCurrenQueue().

  • Thu, Feb 20 2014 5:01 PM In reply to

    • QPH
    • Not Ranked
    • Joined on Fri, Jan 31 2014
    • Posts 6
    • Points 80

    Re: WS Connection sub-sequence problem (iNews WS v1.3.0)

    In fact I have the same documentation, but when I load the WSDL of my 2 services :

    - SYSTEM

    - QUEUE

     

    I create instances like that :

                NEWSSystemPortTypeClient systemClient = new NEWSSystemPortTypeClient();
                NEWSQueuePortTypeClient queueClient = new NEWSQueuePortTypeClient();

     

    I don't have the property called "CookieContainer" to link the Cookie Session...

     

    Do you have an idea?

     

    thanks!

  • Thu, Feb 20 2014 5:12 PM In reply to

    • fiatala
    • Not Ranked
    • Joined on Fri, Jun 7 2013
    • Posts 16
    • Points 165

    Re: WS Connection sub-sequence problem (iNews WS v1.3.0)

    The CookieContainer is a C# helper to share the single Tomcat session across three clients. It is required. You need to create it after client initialization.

                System.Net.CookieContainer sessionCookie = new System.Net.CookieContainer();

     

    How did you generate the proxies (NEWSSystemPortTypeClient)? Each IDE does it slightly differently. I believe I generated mine with VS2010. Make sure you're using the soap1.1 workflows. Soap 1.2 / WCF IDE workflows will not work.

  • Thu, Feb 20 2014 5:19 PM In reply to

    • QPH
    • Not Ranked
    • Joined on Fri, Jan 31 2014
    • Posts 6
    • Points 80

    Re: WS Connection sub-sequence problem (iNews WS v1.3.0)

    Thanks a lot fiatala!!

    I used the IDE (VS2013) with the SOAP1.2 (Services References) instead of Web References...

    Now, I have the "cookieContainer" property on my Class :)

     

    Thanks,

    Have a good day =P

     

    Adrien

  • Thu, Feb 20 2014 5:25 PM In reply to

    • fiatala
    • Not Ranked
    • Joined on Fri, Jun 7 2013
    • Posts 16
    • Points 165

    Re: WS Connection sub-sequence problem (iNews WS v1.3.0)

    Excellent. I'll see if I can clarify the instructions in the SDK/change notes. 

    v1.3 is fairly old. v1.6 is out and available from the latest iNEWS installation media. v1.6 is still soap1.1, but it has several bug fixes over 1.3 and a few additional APIs.

  • Thu, Apr 14 2016 7:34 PM In reply to

    • robg
    • Top 500 Contributor
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: WS Connection sub-sequence problem (iNews WS v1.3.0)

    FYI: Here is what a complete C# program looks like calling into iNEWS System services:

     

    using System;

    using iNEWS_WS_Test.INEWS_System;

     

    namespace iNEWS_WS_Test

    {

        class Program

        {

            static void Main(string[] args)

            {

                INEWSSystem systemClient = new INEWSSystem();

     

                System.Net.CookieContainer sessionCookie = new System.Net.CookieContainer();

                systemClient.CookieContainer = sessionCookie;

     

                ConnectType connection = new ConnectType();

                connection.Username = "user01";

                connection.Password = "B4mzG2bS";

                connection.Servername = "iNEWS";

                ConnectResponseType connectResponse = systemClient.Connect(connection);

     

                GetFolderChildrenType getFolderChildren = new GetFolderChildrenType();

                getFolderChildren.FolderFullName = ".";

                GetFolderChildrenResponseType getFolderChildrenResponse = systemClient.GetFolderChildren(getFolderChildren);

     

                for (int i=0; i<getFolderChildrenResponse.Children.Length; i++)

                {

                    Console.WriteLine(getFolderChildrenResponse.Children.Name + " " + getFolderChildrenResponse.Children.Type);

                }

            }

        }

     

    }

     

Page 1 of 1 (7 items)

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller