Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using complex type namespace
Message
From
31/08/2010 17:00:41
 
 
To
31/08/2010 16:52:44
General information
Forum:
ASP.NET
Category:
Web Services
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01479214
Message ID:
01479502
Views:
21
>>Try using 'View in ObjectBrowser' on the service reference. That should show you what classes have been created, what their properties are and where they are passed/received.
>>
>>For a complete view set 'Show all files' on the project. That will allow you to expand the WCF reference. If you drill down you will find the reference file (it's reference.cs in C# so I'm guessing reference.vb in VB) where the class definitions are actually made.
>
>Thanks, what I see is what I see in the WSDL. From there, I can enter into Reference.vb which shows me a .vb file under the namespace of the Web Service I added. In there, I can see the Public Class declaration. I see the structure which causes all this trouble. I see how the WCF mechanism handles all this and sends the data to the Web Service. But, I cannot see where to initialize all those properties of the structure.
>
>>Is the web service you are accessing public (i.e. can I access it) ?
>
>The link is public but I would prefer to avoid making a reference to it.

Say that you have a web service that looks like this in .NET (c# I'm afraid):
public class WebService1 : System.Web.Services.WebService
    {
          [WebMethod]
        public Something GetSomething()
        {
            return new Something();
        }

        [WebMethod]
        public bool TakeSomething(Something s)
        {
            return true;
        }
    }
    public class Something
    {
        public string A { get; set; }
        public int B { get; set; }
        public SomethingElse C { get; set; }
    }
    public class SomethingElse
    {
        public string Name { get; set; }
    }
If you use WCF to reference this (the fact that it originates from .NET code is irrelevant) then you could use something like:
ServiceReference1.WebService1SoapClient sc = new ServiceReference1.WebService1SoapClient();
            ServiceReference1.Something s = new ServiceReference1.Something();
            ServiceReference1.SomethingElse se = new ServiceReference1.SomethingElse();
            se.Name = "Fred";
            s.C = se;
            sc.TakeSomething(new ServiceReference1.Something());
(Names could make more sense but it should demonstrate the basics....)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform