Need example for WCF QuoteService update

Hi Dale,

You can skip the whole web service layer by creating a session object and not do all of the marshaling and unmarshaling and make your app a little quicker. (unless you're going through a firewall, etc)

There are examples in the the Files section of this group here and at the EUG site.

Mark W.


On Monday, March 19, 2012 at 4:34 PM, Dale Mumper wrote:

>
> Thanks, I actually dug into the BO method reference pdf and found that the UpdateData method was what I was looking for. The trace that I had run previously used GetByID and then Update, so I'm not sure what it was doing internally to navigate the dataset type translation. The UpdateData was able to just consume the GetByID return dataset.
>
> Here's the bare bones code for what I found to work.
>
> Quote.QuoteServiceClient proxy = new Quote.QuoteServiceClient();
>
> proxy.ClientCredentials.UserName.UserName = "myuser";
> proxy.ClientCredentials.UserName.Password = "mypassword";
>
> Quote.CallContextDataSetType callContext = new Quote.CallContextDataSetType();
>
> // Get the quote dataset
> Quote.QuoteDataSetType quotes = proxy.GetByID(out callContext, "", txtQuoteNum.Text, callContext);
>
> // Update the quote
> bool bErrorsOccurred = false;
> Quote.BOUpdErrorDataSetType updErrorDataSet = new Quote.BOUpdErrorDataSetType();
>
> quotes.QuoteHed[0].Quoted = true;
> quotes.QuoteHed[0].DateQuoted = System.DateTime.Today;
> quotes.QuoteHed[0].ExpirationDate = System.DateTime.Today.AddMonths(1).AddDays(-1);
> quotes.QuoteHed[0].FollowUpDate = System.DateTime.Today.AddDays(5);
> quotes.QuoteHed[0].CurrencySwitch = false;
> quotes.QuoteHed[0].RowMod = "U";
>
> updErrorDataSet = proxy.UpdateData(out quotes, out bErrorsOccurred, out callContext, "", quotes, false, true, callContext);
>
> Dale.
>
> --- In vantage@yahoogroups.com (mailto:vantage%40yahoogroups.com), Mark Wonsil <mark_wonsil@...> wrote:
> >
> > Dale wrote:
> > > We're in the process of allowing our quote entry people to mark a quote as
> > > quoted from a custom app that we built for other purposes. I've got the tool
> > > able to pull the quote up via the QuoteService.GetByID method, and it gets
> > > me a QuoteDataSetType just fine. The problem is that I can't find any info
> > > on how to do the next step. Somehow I need to turn that dataset into a
> > > UpdExtQuoteDataSetType dataset, update the values that need to be updated,
> > > and then feed it into the Update method.
> > >
> > > Are there any examples out there of doing such a thing? Is there any
> > > documentation out there for finding my way through these and other WCF
> > > calls?
> > >
> > > Any guidance would be appreciated. We're using VS 2010 and C#, but I can
> > > translate other materials if necessary.
> >
> > I start with doing a trace though the rich client with full dataset
> > checked (and then again unchecked) and you'll get the idea of what
> > gets called using which parameters. Then you just repeat the same in
> > C#.
> >
> > Mark W.
> >
>
>



[Non-text portions of this message have been removed]
Greetings.

We're in the process of allowing our quote entry people to mark a quote as quoted from a custom app that we built for other purposes. I've got the tool able to pull the quote up via the QuoteService.GetByID method, and it gets me a QuoteDataSetType just fine. The problem is that I can't find any info on how to do the next step. Somehow I need to turn that dataset into a UpdExtQuoteDataSetType dataset, update the values that need to be updated, and then feed it into the Update method.

Are there any examples out there of doing such a thing? Is there any documentation out there for finding my way through these and other WCF calls?

Any guidance would be appreciated. We're using VS 2010 and C#, but I can translate other materials if necessary.

Dale.
Dale wrote:
> We're in the process of allowing our quote entry people to mark a quote as
> quoted from a custom app that we built for other purposes. I've got the tool
> able to pull the quote up via the QuoteService.GetByID method, and it gets
> me a QuoteDataSetType just fine. The problem is that I can't find any info
> on how to do the next step. Somehow I need to turn that dataset into a
> UpdExtQuoteDataSetType dataset, update the values that need to be updated,
> and then feed it into the Update method.
>
> Are there any examples out there of doing such a thing? Is there any
> documentation out there for finding my way through these and other WCF
> calls?
>
> Any guidance would be appreciated. We're using VS 2010 and C#, but I can
> translate other materials if necessary.

I start with doing a trace though the rich client with full dataset
checked (and then again unchecked) and you'll get the idea of what
gets called using which parameters. Then you just repeat the same in
C#.

Mark W.
Thanks, I actually dug into the BO method reference pdf and found that the UpdateData method was what I was looking for. The trace that I had run previously used GetByID and then Update, so I'm not sure what it was doing internally to navigate the dataset type translation. The UpdateData was able to just consume the GetByID return dataset.

Here's the bare bones code for what I found to work.

Quote.QuoteServiceClient proxy = new Quote.QuoteServiceClient();

proxy.ClientCredentials.UserName.UserName = "myuser";
proxy.ClientCredentials.UserName.Password = "mypassword";

Quote.CallContextDataSetType callContext = new Quote.CallContextDataSetType();

// Get the quote dataset
Quote.QuoteDataSetType quotes = proxy.GetByID(out callContext, "", txtQuoteNum.Text, callContext);

// Update the quote
bool bErrorsOccurred = false;
Quote.BOUpdErrorDataSetType updErrorDataSet = new Quote.BOUpdErrorDataSetType();

quotes.QuoteHed[0].Quoted = true;
quotes.QuoteHed[0].DateQuoted = System.DateTime.Today;
quotes.QuoteHed[0].ExpirationDate = System.DateTime.Today.AddMonths(1).AddDays(-1);
quotes.QuoteHed[0].FollowUpDate = System.DateTime.Today.AddDays(5);
quotes.QuoteHed[0].CurrencySwitch = false;
quotes.QuoteHed[0].RowMod = "U";

updErrorDataSet = proxy.UpdateData(out quotes, out bErrorsOccurred, out callContext, "", quotes, false, true, callContext);


Dale.

--- In vantage@yahoogroups.com, Mark Wonsil <mark_wonsil@...> wrote:
>
> Dale wrote:
> > We're in the process of allowing our quote entry people to mark a quote as
> > quoted from a custom app that we built for other purposes. I've got the tool
> > able to pull the quote up via the QuoteService.GetByID method, and it gets
> > me a QuoteDataSetType just fine. The problem is that I can't find any info
> > on how to do the next step. Somehow I need to turn that dataset into a
> > UpdExtQuoteDataSetType dataset, update the values that need to be updated,
> > and then feed it into the Update method.
> >
> > Are there any examples out there of doing such a thing? Is there any
> > documentation out there for finding my way through these and other WCF
> > calls?
> >
> > Any guidance would be appreciated. We're using VS 2010 and C#, but I can
> > translate other materials if necessary.
>
> I start with doing a trace though the rich client with full dataset
> checked (and then again unchecked) and you'll get the idea of what
> gets called using which parameters. Then you just repeat the same in
> C#.
>
> Mark W.
>