tailieunhanh - Building XML Web Services for the Microsoft .NET Platform phần 5
Ngoài ra để hạn chế chiều dài, giả sử rằng một thể hiện của một không có thể chứa các ký tự sau đây:Nếu tôi được là để sử dụng các loại ProductID theo quy định trước đây, tôi sẽ phải viết mã để đảm bảo rằng không có ký tự bất hợp pháp đã được bao gồm trong các yếu tố tiết. | used to describe the service so that it references the port type defined within another namespace. You would also need to disable the WSDL document that is automatically generated by . See the Web Service Documentation section earlier in the chapter. does provide a mechanism for facilitating transport-specific interface inheritance. You use the WebServiceBinding attribute to reference a binding defined within another namespace. You use the Binding property of the SoapDocumentMethod or SoapRpcMethod attribute to reference the binding definition referenced by the WebServiceBinding attribute. Next I modify the definition of the Securities Web service to inherit the interface defined within the MSN namespace. I do so by referencing the SecuritiesSoap binding definition. Suppose the preceding WSDL document is located at http . The following code defines the Securities Web service provided by using System using using namespace BrokerageFirm SoapRpcService WebServiceBinding SecuritiesSoap http Securities http public class Securities WebService I reference the SecuritiesSoap binding definition using the WebServiceBinding attribute. The three parameters I pass to the attribute s constructor are the name of the referenced binding definition the namespace containing the definition and the location of the WSDL document containing the definition. If the binding definition is referenced within the Web method the runtime will add a reference to the WSDL namespace that contains the binding. The runtime will also add an import element to the autogenerated WSDL document. Finally the runtime will add a port within the service definition that is associated with the referenced binding definition as shown here WebMethod SoapRpcMethod Binding SecuritiesSoap public double InstantQuote string symbol double price 0 .
đang nạp các trang xem trước