Moss: განახლება საბაჟო სია

არსებობს ბევრი კარგი მაგალითი განახლების საბაჟო სიები მეშვეობით SDK. აქ არის კიდევ ერთი.

ბიზნესის პრობლემა: InfoPath ფორმა შემუშავებულია, რომელიც საშუალებას სტუმრების შემოსვლა ონლაინ შესყიდვა requisitions. PO ჩამორთმევისას ნომრები უნდა იყოს ტრადიციული თანმიმდევრობით დაფუძნებული მთელი ღირებულებები და გათვლილი ავტომატურად.

ბიზნეს გადაწყვეტილება: შექმნა საბაჟო MOSS სია, რომელიც შეიცავს ორ ბურჯს: "ControlField" and "ControlValue". The value column contains the next purchase requisition number. Note that the generic "control" naming convention provides for future control fields that may be used as needed.

ტექნიკური გადაწყვეტა: Create a web service accessed by the InfoPath client. The web service returns back the next purchase requisition number and updates the value of the list.

Lessons Learned:

  • When adding this web service as a data source to the InfoPath form, I found it necessary to convert it to a udc and store it into a data connection library.
  • I also found it necessary to enable cross domain scripting via central services administration // application management // form server configuration.
  • The first time the form tried to access the web service, it takes a while and on occasion, it would time out. I fiddled with settings in form server configuration to expand the timeout settings and that seemed to help.

The code:

გამოყენებით სისტემები;
გამოყენებით System.Web;
გამოყენებით System.Web.Services;
გამოყენებით System.Web.Services.Protocols;
გამოყენებით Microsoft.SharePoint;
გამოყენებით System.Configuration;

[WebService(Namespace = "http://www.conchango.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
საჯარო კლასი PoService : System.Web.Services.WebService
{
საჯარო PoService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

/// <შემაჯამებელი>
/// Obtain the next PO number from the sharepoint po number control list.
/// Increment the PO number in that list.
/// </შემაჯამებელი>
/// <returns></returns>
[WebMethod]
საჯარო სიმებიანი GetNextPoNumber()
{
სიმებიანი SpPoControlSiteName; // Name of the actual MOSS site that hosts the PO Control list.
სიმებიანი SpPoControlListName; // Name of the actual MOSS list containing the Po control.

SpPoControlSiteName = ConfigurationSettings.AppSettings["PoControlListHostingSite"].ToString();
SpPoControlListName = ConfigurationSettings.AppSettings["PoControlList"].ToString();

სიმებიანი nextPoReqNumber = "xyzzy";

გამოყენებით (SPSite site = ახალი SPSite(SpPoControlSiteName))
{
გამოყენებით (SPWeb web = site.OpenWeb())
{

SPList currentList = web.Lists[SpPoControlListName];

foreach (Spit controlItem in currentList.Items)
{

თუ (((სიმებიანი)controlItem["ControlField"]).შეადგენს("NextPoNumber"))
{
nextPoReqNumber = (სიმებიანი)controlItem["ControlValue"];

int int_nextPoReqNumber;
int_nextPoReqNumber = Convert.ToInt32(nextPoReqNumber);

int_nextPoReqNumber ;

controlItem["ControlValue"] = int_nextPoReqNumber;
controlItem.Update();
}

} // Locating, reading and updating the PO number in the list.


} // using spweb web = site.openweb()
} // using spsite site = new spsite("http://localhost/mizuho")

დაბრუნდნენ nextPoReqNumber;

}
}

ერთი ფიქრობდა შესახებ "Moss: განახლება საბაჟო სია

  1. KSP wrote:
    Hi პოლ,
    We have a similar situation what you are mentioning but the problem is i want to use this web servie on a load balance server.Hence,როგორ უნდა გაუმკლავდეს concurrency მოითხოვს ამ შემთხვევაში ან თუ როგორ, რათა ახალი მოთხოვნა დაველოდოთ და მხოლოდ ერთი მოთხოვნა უნდა განაახლოს ნუსხა წლის შემდეგ ყველა სხვა მოთხოვნები უნდა იყოს que.Please მიადევნე თვალი როგორ უნდა მივაღწიოთ ამ.
    მადლობა წინასწარ.

დატოვე პასუხი უნდა KSP wrote: პასუხის გაუქმება

თქვენი ელ-ფოსტა არ გამოქვეყნდება. აუცილებელი ველები მონიშნულია *