« Previous Next »

Thread: power shell : System.ServiceModel.OperationContextScope : cannot creat constructor

Last post 11-03-2009 3:18 AM by kirank11. 0 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (1 items)

Sort Posts:

  • 11-03-2009, 3:18 AM

    • kirank11
    • Not Ranked
    • Joined on 11-03-2009, 3:17 AM
    • Posts 1

    power shell : System.ServiceModel.OperationContextScope : cannot creat constructor

     I am following the process of creating proxy from the following link

    http://cglessner.blogspot.com/2008/...hell.html/



    Power shell Code for Creating the $proxy:

    $wsdl = Get-WsdlImporter -wsdlUrl "http://myservice/mex"

    $proxyTypes = Get-WcfProxy -wsdlImporter $wsdl

    $address = New-Object System.ServiceModel.EndpointAddress("http://myservice")


    $binding = new-object System.ServiceModel.BasicHttpBinding
    #system.

    $proxy = New-Object $proxyTypes -ArgumentList $binding, $address

    $d = New-Object System.ServiceModel.OperationContextScope($proxy.InnerChannel)



    Error:

    Cannot convert argument "0", with value: "ISetService", for ".ctor" to type "System.ServiceModel.IContextChannel": "Cannot convert "ISetService" to "System.ServiceModel.IContextChannel"."
    At :line:45 char:17
    + $pdc = new-object <<<<  System.ServiceModel.OperationContextScope($proxyLRC.InnerChannel)


    The C# code works fine but when I try to implement it using the power Shell then it fails.

    this may help u.

    Kiran K

Page 1 of 1 (1 items)
Microsoft Communities