in
Creating Smarter Networks

Troubles while adding Service References

Last post 09-04-2008 11:50 PM by lumatec. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-15-2008 5:20 AM

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Troubles while adding Service References

    Hi,

    when I try to build a new project with VB.NET, adding a Service Reference, I get the following two warnings: 

    Warning 1 Custom tool warning: Cannot import wsdl:binding
    Detail: The WSDL binding named iLON100soap11Binding is not valid because no match for operation List was found in the corresponding portType definition.
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/wsdl/']/wsdl:binding[@name='iLON100soap11Binding'] C:\Documents and Settings\...\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Service References\smartServer\Reference.svcmap 1 1 WindowsApplication1

    Warning 2 Custom tool warning: Cannot import wsdl:port
    Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
    XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/wsdl/']/wsdl:binding[@name='iLON100soap11Binding']
    XPath to Error Source: //wsdl:definitions[@targetNamespace='http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/wsdl/']/wsdl:service[@name='iLON100']/wsdl:port[@name='iLON100httpPort'] C:\Documents and Settings\...\Local Settings\Application Data\Temporary Projects\WindowsApplication1\Service References\smartServer\Reference.svcmap 1 1 WindowsApplication1

    It worked fine in past .NET projects, therefore I thought it may be a corrupt WSDL file. But using the original doesn't work either. Anybody an idea what may have changed?

    Thanks and best regards,

    Daniel

    • Post Points: 20
  • 08-15-2008 1:01 PM In reply to

    • gdahl
    • Top 25 Contributor
    • Joined on 08-07-2008
    • Posts 2
    • Points 25

    Re: Troubles while adding Service References

    Have you followed the instructions in the back of the smart server programmers guide? They are slightly different than e3.

    Glenn Dahl
    Director
    WW FAE Operations
    • Post Points: 20
  • 08-18-2008 12:06 AM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: Troubles while adding Service References

    Hello Glenn,

    Unfortunately some of my threads disappeared from the forum. You may, however, find them by searching for 'VB.NET examples'. There you will find that I already asked the same question on 06-09-2008.

    But to answer your question: YES, on my first approach I did follow these instructions. Later, I asked for VB.NET examples on the forum, which I got (see download section: 'SampleClient_VS2008_VB'). But in that example, it's not a 'Web Reference' which is used, but a 'Service Reference'. (If you use a 'Web Reference' you won't get the 'iLONportTypeClient' - class.) So I changed my project accordingly. Already at that moment, the warnings mentioned in this post appeared for the first time. After restarting VB.NET (Express Edition) these warnings disappeared. And the project works fine ever since.

    But now I tried to setup a new project. And I'm unable to get rid of these warnings.

    If I open the sample project (SampleClient_VS2008_VB) it works fine. But if I rightClick the iLON_SmartServer - 'Configure Service Reference' and update the Service reference, I get the same warnings mentioned above.

    So I guess that probably something in my VS environment has changed, that makes it impossible to read the WSDL. But what?

    Shall we use the method used in the Programmer's Reference (using a Web Reference) or the one used in the SOAP-Samples (using a Service Reference)?

    Best regards,

    Daniel

    • Post Points: 5
  • 09-02-2008 3:58 AM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: Troubles while adding Service References

    We bought Visual Studio 2008 Standard Edition now, still the same problem.

    Daniel

    • Post Points: 20
  • 09-03-2008 5:53 AM In reply to

    • Adi
    • Top 50 Contributor
    • Joined on 09-03-2008
    • Posts 1
    • Points 20

    Re: Troubles while adding Service References

    As the current MS C#/VB Express Edition 2008 works defautly with .NET 3.0 or 3.5 I strictly recommend to use it instead of 2.0.

    Probably you tried to initiate the WebService using the .NET 2.0 mechanism. This is the way it works with .NET 3.x:

     

    1. Create new project (e.g. a console application) and be aware to choose the .NET 3.0 or 3.5 (not .NET 2.0) in the Dialog.

     

    2. Input a name in the Name field (I used "ForumTest").

     

    3. Right click on the Project in the Visual Studio SolutionExplorer and choose "Add Service Reference.."

     

    4. Input you WSDL sink like ("zzz.zzz.zzz.zzz" is your iLON's ip address)

    "http://zzz.zzz.zzz.zzz/WSDL/v4.0/iLON100.wsdl"

     

    5. Click the Go button, and then enter a name for the Web Service Reference in the Namespace field (e.g. "iLON_WS")

     

    6. Input this code in your "Program.cs" or "Program.vb" (I used C#):

     

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

     

    namespace ForumTest2

    {

        class iLON_SoapCalls

        {

            // CHANGE IT HERE: your i.LON's IpAddress, e.g. "172.25.137.101"

            public const string _iLonEndpointIpAddress = "zzz.zzz.zzz.zzz";

            static private iLON_WS.iLON100portTypeClient _iLON = null;

     

            /// <summary>

            ///   ATTENTION: Instantiates the i.LON web service for .NET 3.0 and 3.5 (NOT 2.0)

            /// </summary>

            static void Main(string[ args) {

                if(_iLonEndpointIpAddress.Contains("z")) {

                    System.Diagnostics.Debug.Write("\nFAULT: please set the correct i.LON SmartServer ip-address !!!\n\n");

                    return;

                }

     

                // Specify the binding to be used for the client.

                System.ServiceModel.Channels.Binding binding

                  = new System.ServiceModel.BasicHttpBinding();

     

                // Initialize the namespace

                binding.Namespace = "http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/";

                // The size of the messages that can be received on the wire by services using the BasicHttpBinding

                // is bounded by the amount of memory allocated for each message.

                // This bound on message size is intended to limit exposure to DoS-style attacks.

                // We have to increase it for the i.LON to be able to receive all messages           

                ((System.ServiceModel.BasicHttpBinding)binding).MaxReceivedMessageSize = 1000*1000;

     

                // Obtain the URL of the Web service on the i.LON SmartServerver.

                System.ServiceModel.EndpointAddress endpointAddress

                    = new System.ServiceModel.EndpointAddress("http://"

                        + _iLonEndpointIpAddress + "/WSDL/iLON100.wsdl");

     

                // Instantiate the i.LON web service object with this address and binding.

                _iLON = new iLON_WS.iLON100portTypeClient(binding, endpointAddress);

     

                // Do some stuff on the iLON

                try {

                    DoSomething();

                }

                catch (Exception ex) {

                    System.Diagnostics.Debug.WriteLine(ex.ToString());

                }

     

                // close the i.LON web service gracefully

                // closes the connection and cleans up resources

                try {

                    _iLON.Close();

                }

                finally {

                    _iLON = null;

                }

            }

           

            static private void DoSomething() {

                iLON_WS.E_xSelect xSel = new iLON_WS.E_xSelect();

                xSel.xSelect = "//Item[@xsi:type=\"Fb_Cfg\"]";

                iLON_WS.Item_Coll items =  _iLON.List(xSel);

                System.Diagnostics.Debug.WriteLine(items.Item.GetLength(0).ToString() + " Items responded." );

            }

        }

    }

     

     

    7. That's all

    • Post Points: 20
  • 09-04-2008 2:43 AM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: Troubles while adding Service References

    Hello,

    thanks for your help, but I still get the same error messages, just after point 5 in your answer.

    I have Visual Studio 2008, Standard Edition, SP1 with .Net Framework 3.5 SP1.

    As there are other things not working on my SmartServer (RealTimeClock, DataLogger, Scheduler... all issues known by Echelon), I stopped working on it until I receive the new service release. I also ordered a new SmartServer in case there is something wrong with the one I have. Up to that moment I give up... it's really hopeless.

    To the Moderator of that forum: Several of my posts disappeared from the forum. Just have a look at http://ilonsmartserver.com/forums/. There it says Small&Medium SizedBuildings = 18 Threads. If you go inside that Discussion group, you will only find 10 Threads. Please bring them all back to live. Thanks!

    Regards,

    Daniel

    • Post Points: 5
  • 09-04-2008 11:50 PM In reply to

    • lumatec
    • Top 10 Contributor
    • Joined on 04-29-2008
    • Posts 63
    • Points 870

    Re: Troubles while adding Service References

    Dear Moderator

    I appologize for my remark concerning the 'disappeared' posts.

    I just realized, that in the options I may change the date filter in order to show all posts.

    Sorry for that!

    Daniel

    • Post Points: 5
Page 1 of 1 (7 items)
©2008 Echelon Corporation