[SOLVED] New-WebServiceProxy : Initialization failure. Please review input options and documents for validity.

| No Comments | No TrackBacks



I ran into a dubious error this morning, which I prematurely filed in the but-I-did-exactly-the-same-thing-yesterday-and-it-worked category.

The problem occurred with the following two lines of code, trying to access the Web Services of a Sharepoint 2007 ERP site:

$uri = "https://sitename/_vti_bin/lists.asmx?WSDL"
$service = New-WebServiceProxy -Uri $uri  -Namespace SpWs  -UseDefaultCredential

The resulting error message was


New-WebServiceProxy : Initialization failure. Please review input options and documents for validity.
At Untitled1.ps1:2 char:31
+ $service = New-WebServiceProxy <<<< -Uri $uri  -Namespace SpWs  -UseDefaultCredential
+ CategoryInfo : NotSpecified: (:) [New-WebServiceProxy], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.NewWebServiceProxy

finding nothing on Google, it took me a while to figure out that copying these lines to a mindmapping tool and back added some control characters which the PowerShell parser was not able to ignore.

Thus, retyping the second line and saving the file as .ps1 solved this issue.

dlvrt

No TrackBacks

TrackBack URL: http://blog.janus.cx/cgi-bin/mt/mt-tb.cgi/16

Leave a comment

November 2011

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

About this Entry

This page contains a single entry by Nils o. Janus published on November 23, 2011 11:35 AM.

Eindruecke der ersten Woche in Duisburg was the previous entry in this blog.

Grand City Hotel Duisburg - kleinere Zimmer als im letzten Hotel in London is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Categories

OpenID accepted here Learn more about OpenID