|
Home > Archive > Commerce Server General > September 2006 > .NET Winforms App for Commerce Server
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
.NET Winforms App for Commerce Server
|
|
| Stuart Dickerson 2006-02-19, 10:32 am |
| I have to build a .NET Winforms (C#) application that will interface
with Commerce Server. I have been surprised that I can't seem to find
any documentation or sample code on how this can be done.
Does anyone know of any doc, forum, article or book that describes
and/or demonstrates how to do this?
Does anyone know where there might be sample code?
I understand how Commerce Server works from the ASP.NET perspective.
My challenge has been how to use the web services from a Winforms
application.
I can invoke them, but I think I'm missing some basic steps (at least
I'm hoping I am). For example, if I wish to create a User Object, I
can pass the XML to the ProfilesWebService. But I what I'm not sure
about is if I have to create my own client objects to build the User
Object or is there a way that I can access them from Commerce Server
(since I don't think that I have CommerceContext.Current).
My application will have to manage users and orders. Obviously this
could be done within ASP.NET, but there are other business reasons why
this is being developed as a Winforms application.
I'm doing this in CS 2006 but after reviewing the .NET classes and
webservices for CS 2002, it appears that doing it for either version
would be almost the same.
Thanks,
Stuart
| |
| Ravi Shankar 2006-02-20, 5:52 pm |
| Hi Stuart,
Firstly this can only be done on a system where Commerce Server is installed.
Secondly what you can do is create a WebService Application which exposes
the functionality you'd like and access this from a WinForms application.
This way you don't run foul of licensing & meet your requirements. (Feature
Pack 1 is an excellent exapmle of this approach for managing Catalogs &
Discounts)
The sequence you want is something like this
Dim oSiteResourceCollection as new CommerceResourceCollection("<your
sitenme>"
'
' For profiles what you needs is
Dim oProfilesResource as CommerceResource =
oSiteResourceCollection.item("<name of the profile resource>")
Dim profileConnStr as string = oProfilesResource.item("<one of the profile
resource conneciton strings>")
Dim oDebugContext as new System.ConsoleContext '--- something like that
Dim oProfileContext as new ProfileContext(profileConnStr, oDebugContext)
....
....
Similarly for OrderContext.. you need the connection string as specified in
the "Transactions" Resource and has a field name like
"connstr_db_Transactions"
--
Ravi Shankar
"Stuart Dickerson" wrote:
> I have to build a .NET Winforms (C#) application that will interface
> with Commerce Server. I have been surprised that I can't seem to find
> any documentation or sample code on how this can be done.
>
> Does anyone know of any doc, forum, article or book that describes
> and/or demonstrates how to do this?
>
> Does anyone know where there might be sample code?
>
> I understand how Commerce Server works from the ASP.NET perspective.
> My challenge has been how to use the web services from a Winforms
> application.
>
> I can invoke them, but I think I'm missing some basic steps (at least
> I'm hoping I am). For example, if I wish to create a User Object, I
> can pass the XML to the ProfilesWebService. But I what I'm not sure
> about is if I have to create my own client objects to build the User
> Object or is there a way that I can access them from Commerce Server
> (since I don't think that I have CommerceContext.Current).
>
> My application will have to manage users and orders. Obviously this
> could be done within ASP.NET, but there are other business reasons why
> this is being developed as a Winforms application.
>
> I'm doing this in CS 2006 but after reviewing the .NET classes and
> webservices for CS 2002, it appears that doing it for either version
> would be almost the same.
>
> Thanks,
>
> Stuart
>
| |
|
|
|
|
|
|
|