Re: Big-Picture Question (Web Services, RegNow)



Laurent,

Show the code. Accepting custom types as parameters should also be
supported.

However, note that there are all kind of clients able to send a request to
a web service. The given client is responsible for serializing (i.e.
transforming into XML) the given parameters, and for deserialiazing (i.e.
transforming from XML) the returned value.

If your client is a .NET application, you don't have to worry too much
about it, because the serialization/deserialization mechanism is
automatically provided (by the web reference, also called web service
proxy).

My code is like what is shown below but while it may be supported by some
clients, Visual Studio won't run it for me. If I change the arguments to be
the members of RegArgs, then VS has no trouble with it. Note that while I
may want to access this service from a .NET application, I certainly want it
available to clients using different platforms as well.

[WebService(Namespace = "https://www.mydomain.com/";)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class ProductRegistration : System.Web.Services.WebService
{
public class RegArgs
{
public string name = "";
public string password = "";
public int productId = 0;
public int cpus = 1;
public string custName = "";
public string custCompany = "";
public string custAddress1 = "";
public string custAddress2 = "";
public string custCountry = "";
public string custPhone = "";
public string custEmail = "";
}

[WebMethod(Description = "Returns registration information for a
product.")]
public string RegisterProduct(RegArgs args)
{
return "BlahBlahBlah";
}
}

In the case 3, you make sure that the attributes are always initialized.
There is no default constructor. (The examples 1 and 2 also don't have an
explicit default constructor, but the compiler provides one when no
constructor is defined.)

I understood the part about making variables private and exposing them
through properties, and also why that might be beneficial.

I just wasn't used to initializing member variables in place rather than in
the constructor. As you probably know, you cannot initialize a member
variable like that in a C++ class. I wasn't aware you could do it that way
in a C# class. I'm assuming the effect of this is the same as initializing
the variable in a constructor: i.e. the variable is initialized to the
specified value when an instance is created.

Thanks!

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


.



Relevant Pages

  • Re: How do Large Scale Web Service Applications Maintain Session State?
    ... cache these profiles on the server in order to increase performance. ... which is something different than stateful Web Service classes. ... We do pass a session token as ... Having systems deployed through web services allows clients to access via ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Underlying Connection Was Closed Error
    ... I'm working with remote clients that ... Yeah, Microsoft Network Monitor 3.1, works fine even on Vista) ... a web service on IIS 6.0 via SSL and using X509 Client Certificates. ... ....If Not userProxy Is Nothing Then ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: DataTable returned from a Web Service
    ... Most of my clients are .NET, in fact one is a VB6 client and I was able to convert a DataTable within a DataSet to a classic ADO Recordset and works perfectly. ... Funny thing is that with my VB6 client I can use the web service function that returns a DataTable but not my 'new' .Net clients. ... when using VS 2005 or VB.Net 2005 Express and creating a web references is ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Web service Performance
    ... clients are using it to synchronize some datas from clients database to ... server database, so they are calling web service methods very often. ... everything is restarting and queries response are going ...
    (microsoft.public.dotnet.framework.webservices)
  • Need advice on security setup
    ... Business Services layer will be implemented as XML Web Services. ... There will be several "clients" to the service layer. ... I need to authenticate each request to my services layer, ... credentials in the web service request, ...
    (microsoft.public.dotnet.framework.aspnet.security)

Loading