C#/WCF client to access a provider (Enumerate)
"Pierre Pacchioni" <[email protected]> Wed, 28 Aug 2013 15:00:44 +0200
| Newsgroups | gmane.network.open-pegasus.general |
|---|---|
| Message-ID | <[email protected]> |
Hello, We are trying to implement a WCF client using the enumerate command to communicate with our (openPegasus) providers. For information, our providers run and we can communicate with them using the cimcli or other tools like: . SoapUI . WinRM : winrm enumerate http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PCIDevice -r:192.168.X.X:5988/wsman -auth:none -encoding:UTF-8 . http client . To do that we have created a simple command line client (VS 2010) and we have added a service reference using http://schemas.dmtf.org/wbem/wsman/1/dsp8037_1.0.wsdl. The service reference seems to be ok, at least something has been generated (including a EnumerateOpRequest and EnumerateOpResponse). WSHttpBinding binding = new WSHttpBinding(); binding.Security.Mode = SecurityMode.Message; binding.Security.Message.ClientCredentialType = MessageCredentialType.None; EndpointAddress endPointAddress = new EndpointAddress(new Uri(wsmanAddress)); DataSourceClient dataSource = new DataSourceClient( binding, endPointAddress); EnumerateOpRequest enumerateRequest = new EnumerateOpRequest(); EnumerateOpResponse response = dataSource.EnumerateOp(enumerateRequest); PullOpRequest pullRequest = new PullOpRequest(); pullRequest.Pull.EnumerationContext = response.EnumerateResponse.EnumerationContext; PullOpResponse pullResponce = dataSource.PullOp(pullRequest); Where wsmanAddress corresponds to server URL. But from the generated code we cannot see where to set/specify the ResourceURI. Of course without that information the server returns an error.indeed this ResourceURI is used to specify which information is requested from the client, like: <w:ResourceURI s:mustUnderstand="true"> <http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PCIDevice> http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_PCIDevice </w:ResourceURI> Do you have any idea what we did wrong generating our service reference? Has someone already done that and if so can he help us? As an alternative we tried svcutil (http://msdn.microsoft.com/en-us/library/aa347733.aspx) but seems really difficult to retrieve all the wsdl/xsd file necessary to make it works. Thanks for your help, Pierre.