bashell.blogg.se

Micro focus cobol tutorial
Micro focus cobol tutorial





micro focus cobol tutorial

micro focus cobol tutorial

This displays the operation details and enables you to test the operation with various parameters. Double-click the GetDataUsingDataContract() operation.The test client displays the endpoint for your service and the operations that are exposed. Visual Studio hosts your service in the WCF Service Host and loads it in the WCF Test Client application. In Solution Explorer, right-click the WCFBook project and select.WCF Options tab in the project properties. Visual Studio provides a built-in WCF Service Host application and a WCF Test Client application to help you test your service without your own client application.

#MICRO FOCUS COBOL TUTORIAL CODE#

Add the code below immediately after the opening.Raise new (bookException::Message)Īdditionally, you need to configure your WCF service to call the BookWrapper code as follows:Īpp.config file in your WCF service project and select Set theBook to new WCFBookWrapper.Book(book) Set book to type BookWrapper.Book::Read(stockNumber) Method-id GetDataUsingDataContract public.Ġ1 bookException type BookWrapper.BookException. Set return-value to string::Format("You entered " the-value) Paste the code below into the BookService.cbl file.Procedure division using by value stdbook as type BookWrapper.Book. Procedure division using by value stockNumber as string returning theBook as type WCFBookWrapper.Book.Ĭlass-id WCFBookWrapper.Book attribute DataContract().Ġ1 BookTitle string property as "Title" attribute DataMember().Ġ1 BookType string property as "Type" attribute DataMember().Ġ1 BookAuthor string property as "Author" attribute DataMember().Ġ1 BookStockno string property as "StockNumber" attribute DataMember().Ġ1 BookRetail decimal property as "RetailPrice" attribute DataMember().Ġ1 BookOnhand binary-long property as "NumberOnHand" attribute DataMember().Ġ1 BookSold binary-long property as "NumberSold" attribute DataMember().Ġ1 StockValue float-short property as "StockValue" attribute DataMember(). Returning return-value as type WCFBookWrapper.Book. Procedure division using by value stockNumber as string Method-id GetDataUsingDataContract public Procedure division using by value the-value as binary-long The WCFBookWrapper.Book class that is marked with the DataContract attribute exposes the data from the BookWrapper program.Īttribute ().Īttribute ().The methods that are marked with the () attribute define the operations from the BookWrapper program that are exposed through the service endpoints.This defines the service and data contracts. Paste the code below in the IBook.cbl file, overwriting the existing content.Rename the COBOL files in the WCFBook project as follows:.Define the WCF Service Contract and Create the Service







Micro focus cobol tutorial