|
Home > Archive > Commerce Server General > April 2005 > Required help in developing Catalog Manager like application
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 |
Required help in developing Catalog Manager like application
|
|
| Satsang 2005-03-07, 5:50 pm |
| Hi,
Our work involves customizing Catalog Manager for our client. We also
need to develop an application for migrating catalog in XML format
from staging to production environment. For this we are planning to
write a windows application similar to the Catalog Manager itself.
I've gone thru the CS2002 partner SDK help file. however the sample
code under its "Using the classes in catalg system" doesnt run as is
as results in a security error while accessing the ServiceAgent API.
itself.
Could anyone point me to any other source of sample code for
developing such an application.
Thanks,
Satsang
| |
| Vinayak Tadas[MSFT] 2005-03-07, 8:46 pm |
| Can you describe the security error?
--------------------
From: satsang_r@infosys.com (Satsang)
Newsgroups: microsoft.public.commerceserver.general
Subject: Required help in developing Catalog Manager like application
Date: 7 Mar 2005 07:01:07 -0800
Organization: http://groups.google.com
Lines: 16
Message-ID: <43bc3c52.0503070650.502d36c7@posting.google.com>
NNTP-Posting-Host: 220.227.179.5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1110207667 30513 127.0.0.1 (7 Mar 2005 15:01:07
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 7 Mar 2005 15:01:07 +0000 (UTC)
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fa
stwebnet.it!tiscali!newsfeed1.ip.tiscali.net!news.maxwell.syr.edu!postnews.g
oogle.com!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.commerceserver.general:15714
X-Tomcat-NG: microsoft.public.commerceserver.general
Hi,
Our work involves customizing Catalog Manager for our client. We also
need to develop an application for migrating catalog in XML format
from staging to production environment. For this we are planning to
write a windows application similar to the Catalog Manager itself.
I've gone thru the CS2002 partner SDK help file. however the sample
code under its "Using the classes in catalg system" doesnt run as is
as results in a security error while accessing the ServiceAgent API.
itself.
Could anyone point me to any other source of sample code for
developing such an application.
Thanks,
Satsang
Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Get Secure! For more info visit http://www.microsoft.com/security. Please
reply to the newsgroups only. Thanks
| |
| Ravi Shankar 2005-03-08, 2:47 am |
| I would like to understand your requirement for writing a application for
migration of catalogs from staging to production environment. IMHO you can
use the Catalog Manager (same client connecting to the CatalogWebService on
your staging & production environment), export from staging and import to
production... or am I missing something here ?
"Satsang" wrote:
> Hi,
> Our work involves customizing Catalog Manager for our client. We also
> need to develop an application for migrating catalog in XML format
> from staging to production environment. For this we are planning to
> write a windows application similar to the Catalog Manager itself.
>
> I've gone thru the CS2002 partner SDK help file. however the sample
> code under its "Using the classes in catalg system" doesnt run as is
> as results in a security error while accessing the ServiceAgent API.
> itself.
>
> Could anyone point me to any other source of sample code for
> developing such an application.
>
> Thanks,
> Satsang
>
| |
| satsang_r@infosys.com 2005-03-09, 7:46 am |
| Hi Vinayak/Ravi,
Thanks a lot for your responses.
Our export/import catalog requirement is a little specific and is not
supported by the existing export/import Catalog Manager feature.
In order to incorporate a workflow in catalog authoring, we've added
a product property called IsPublished. While exporting catalog for
deployment to production environment we need only those products to be
exported whose IsPublished property is set to true. CS2002 partner SDK
API's catalogContext.ExportXml(xmlExportOptions) function provides a
way to specify a sqlClause in the export options to selectively fetch
product data. Thus we need to develop a separate application which
could do the selective export for us.
I'm trying to use the following sample code available under "Using
the Classes in the Catalog system" section of the CS2002 Partner SDK
help file. This code results in a security error as soon as execution
enters the button1_Click function. The error reads as follows
An unhandled exception of type 'System.Security.SecurityException'
occurred in system.windows.forms.dll
Additional information: Security error.
private void button1_Click(object sender, System.EventArgs e)
{
try
{
string webserviceUrl =
"http://localhost/CatalogWebService/CatalogWebService.asmx";
// Create the Catalog service agent with the catalog web service
url and the default authentication methods (Negotiate, ntlm, kerberos)
CatalogServiceAgent catalogServiceAgent = new
CatalogServiceAgent(webserviceUrl, ServiceAgent.DefaultAuthMethods);
// Create the catalog context
CatalogContext catalogContext =
CatalogContext.Create(catalogServiceAgent , new
ConsoleDebugContext(DebugMode.Checked));
string sqlClause = @"[IsActive] = N'Yes'";
//Set the Export Options
XmlExportOptions xmlExportOptions = new XmlExportOptions();
xmlExportOptions.FileName = @"C:\Sat.xml";
xmlExportOptions.CatalogsToExport.Add("Eastman Chemicals Product
Catalog");
xmlExportOptions.SqlClause = sqlClause;
//Export Catalog XML
int operationId = catalogContext.ExportXml(xmlExportOptions);
while( catalogContext.GetExportProgress(operationId).Status ==
CatalogOperationsStatus.InProgress)
{
// The export is in progress so add some sleep here before
checking the status again
System.Threading.Thread.Sleep(5000);
}
}
catch (ValidationException valExp)
{
MessageBox.Show(valExp.Message);
}
}
I have a couple of questions regarding all this.
1. Is this the right approach to meet our requirement or is there any
other way?
2. If this is the way then what all things do we need to take care
while accessing the web service and writing such an application.
3. Could we get some sample code for the same?
Any help would be greatly appreciated.
Thanks,
Satsang
| |
| Satsang 2005-03-09, 5:50 pm |
| Hi Vinayak/Ravi,
Thanks a lot for your responses.
Our export/import catalog requirement is a little specific and is not
supported by the existing export/import Catalog Manager feature.
In order to incorporate a workflow in catalog authoring, we've added
a product property called IsPublished. While exporting catalog for
deployment to production environment we need only those products to be
exported whose IsPublished property is set to true. CS2002 partner SDK
API's catalogContext.ExportXml(xmlExportOptions) function provides a
way to specify a sqlClause in the export options to selectively fetch
product data. Thus we need to develop a separate application which
could do the selective export for us.
I'm trying to use the following sample code available under "Using the
Classes in the Catalog system" section of the CS2002 Partner SDK help
file. This code results in a security error as soon as execution
enters the button1_Click function. The error reads as follows
An unhandled exception of type 'System.Security.SecurityException'
occurred in system.windows.forms.dll
Additional information: Security error.
private void button1_Click(object sender, System.EventArgs e)
{
try
{
string webserviceUrl =
"http://localhost/CatalogWebService/CatalogWebService.asmx";
// Create the Catalog service agent with the catalog web service
url and the default authentication methods (Negotiate, ntlm, kerberos)
CatalogServiceAgent catalogServiceAgent = new
CatalogServiceAgent(webserviceUrl, ServiceAgent.DefaultAuthMethods);
// Create the catalog context
CatalogContext catalogContext =
CatalogContext.Create(catalogServiceAgent , new
ConsoleDebugContext(DebugMode.Checked));
string sqlClause = @"[IsActive] = N'Yes'";
//Set the Export Options
XmlExportOptions xmlExportOptions = new XmlExportOptions();
xmlExportOptions.FileName = @"C:\Sat.xml";
xmlExportOptions.CatalogsToExport.Add("Eastman Chemicals Product
Catalog");
xmlExportOptions.SqlClause = sqlClause;
//Export Catalog XML
int operationId = catalogContext.ExportXml(xmlExportOptions);
while( catalogContext.GetExportProgress(operationId).Status ==
CatalogOperationsStatus.InProgress)
{
// The export is in progress so add some sleep here before
checking the status again
System.Threading.Thread.Sleep(5000);
}
}
catch (ValidationException valExp)
{
MessageBox.Show(valExp.Message);
}
}
I have a couple of questions regarding all this.
1. Is this the right approach to meet our requirement or is there any
other way?
2. If this is the way then what all things do we need to take care
while accessing the web service and writing such an application.
3. Could we get some sample code for the same?
Any help would be greatly appreciated.
Thanks,
Satsang
| |
| Vinayak Tadas[MSFT] 2005-04-07, 8:47 pm |
| Have you looked at the catalogstaging guide for FP1. This allows you to
stage products in the manner you described below.
For the security error can you send the error description or the
innerexception
What you have done is correct.
Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/_cpyright.htm
Get Secure! For more info visit http://www.microsoft.com/secur_ity.
Please
reply to the newsgroups only. Thanks
--------------------
From: satsang_r@infosys.com (Satsang)
Newsgroups: microsoft.public.commerceserver.general
Subject: Re: Required help in developing Catalog Manager like application
Date: 9 Mar 2005 06:05:59 -0800
Organization: http://groups.google.com
Lines: 83
Message-ID: <43bc3c52.0503090605.61742699@posting.google.com>
References: <43bc3c52.0503070650.502d36c7@posting.google.com>
NNTP-Posting-Host: 220.227.179.5
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1110377159 18895 127.0.0.1 (9 Mar 2005 14:05:59
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 9 Mar 2005 14:05:59 +0000 (UTC)
Path:
TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fas
twebnet.it!tiscali!newsfeed1.ip.tiscali.net!proxad.net!216.239.36.134.MISMAT
CH!postnews.google.com!not-for-mail
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.commerceserver.general:15734
X-Tomcat-NG: microsoft.public.commerceserver.general
Hi Vinayak/Ravi,
Thanks a lot for your responses.
Our export/import catalog requirement is a little specific and is not
supported by the existing export/import Catalog Manager feature.
In order to incorporate a workflow in catalog authoring, we've added
a product property called IsPublished. While exporting catalog for
deployment to production environment we need only those products to be
exported whose IsPublished property is set to true. CS2002 partner SDK
API's catalogContext.ExportXml(xmlExportOptions) function provides a
way to specify a sqlClause in the export options to selectively fetch
product data. Thus we need to develop a separate application which
could do the selective export for us.
I'm trying to use the following sample code available under "Using the
Classes in the Catalog system" section of the CS2002 Partner SDK help
file. This code results in a security error as soon as execution
enters the button1_Click function. The error reads as follows
An unhandled exception of type 'System.Security.SecurityException'
occurred in system.windows.forms.dll
Additional information: Security error.
private void button1_Click(object sender, System.EventArgs e)
{
try
{
string webserviceUrl =
"http://localhost/CatalogWebService/CatalogWebService.asmx";
// Create the Catalog service agent with the catalog web service
url and the default authentication methods (Negotiate, ntlm, kerberos)
CatalogServiceAgent catalogServiceAgent = new
CatalogServiceAgent(webserviceUrl, ServiceAgent.DefaultAuthMethods);
// Create the catalog context
CatalogContext catalogContext =
CatalogContext.Create(catalogServiceAgent , new
ConsoleDebugContext(DebugMode.Checked));
string sqlClause = @"[IsActive] = N'Yes'";
//Set the Export Options
XmlExportOptions xmlExportOptions = new XmlExportOptions();
xmlExportOptions.FileName = @"C:\Sat.xml";
xmlExportOptions.CatalogsToExport.Add("Eastman Chemicals Product
Catalog");
xmlExportOptions.SqlClause = sqlClause;
//Export Catalog XML
int operationId = catalogContext.ExportXml(xmlExportOptions);
while( catalogContext.GetExportProgress(operationId).Status ==
CatalogOperationsStatus.InProgress)
{
// The export is in progress so add some sleep here before
checking the status again
System.Threading.Thread.Sleep(5000);
}
}
catch (ValidationException valExp)
{
MessageBox.Show(valExp.Message);
}
}
I have a couple of questions regarding all this.
1. Is this the right approach to meet our requirement or is there any
other way?
2. If this is the way then what all things do we need to take care
while accessing the web service and writing such an application.
3. Could we get some sample code for the same?
Any help would be greatly appreciated.
Thanks,
Satsang
|
|
|
|
|