Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - SOAP webclient

Reply
 
Old 10-10-2007   #1 (permalink)
Neil Chambers


 
 

SOAP webclient

Greetings all,

I am new to the world of SOAP but have a little understanding of psh and, to
a lesser extent, dotnet.

I'm a little lost as to which dotnet class(es) actually need to be used. I
have seen a couple of references to System.Net.HttpWebRequest and
s.n.HttpWebResponse (not that I understood them a great deal within the
VB.NET context). I am also intreagued by system.net.webclient - the name
sort of gives it away.

Does anyone have an example of how I might use psh to interact with a SOAP
service? Any clues on how to use a client certificate within the process
would also be greatly welcomed.

Cheers!
n


My System SpecsSystem Spec
Old 10-10-2007   #2 (permalink)
Brandon Shell [MVP]


 
 

Re: SOAP webclient

Try this
http://keithhill.spaces.live.com/blo...3A97!512.entry

Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject

NC> Greetings all,
NC>
NC> I am new to the world of SOAP but have a little understanding of psh
NC> and, to a lesser extent, dotnet.
NC>
NC> I'm a little lost as to which dotnet class(es) actually need to be
NC> used. I have seen a couple of references to
NC> System.Net.HttpWebRequest and s.n.HttpWebResponse (not that I
NC> understood them a great deal within the VB.NET context). I am also
NC> intreagued by system.net.webclient - the name sort of gives it away.
NC>
NC> Does anyone have an example of how I might use psh to interact with
NC> a SOAP service? Any clues on how to use a client certificate within
NC> the process would also be greatly welcomed.
NC>
NC> Cheers!
NC> n


My System SpecsSystem Spec
Old 10-10-2007   #3 (permalink)
Oisin Grehan


 
 

Re: SOAP webclient

On Oct 10, 4:17 pm, "Neil Chambers" <n3lly...@xxxxxx> wrote:
Quote:

> Greetings all,
>
> I am new to the world of SOAP but have a little understanding of psh and, to
> a lesser extent, dotnet.
>
> I'm a little lost as to which dotnet class(es) actually need to be used. I
> have seen a couple of references to System.Net.HttpWebRequest and
> s.n.HttpWebResponse (not that I understood them a great deal within the
> VB.NET context). I am also intreagued by system.net.webclient - the name
> sort of gives it away.
>
> Does anyone have an example of how I might use psh to interact with a SOAP
> service? Any clues on how to use a client certificate within the process
> would also be greatly welcomed.
>
> Cheers!
> n
You could do a lot worse than start here:

http://www.nivot.org/2007/08/07/NewI...owerShell.aspx

usage:

PS> $service = .\get-webservice.ps1 -anonymous -url http://www.example.com/service.asmx
PS> $service | get-member

It can handle more complex services (multi-document basic profile 1.1)
than many other posh scripts floating around, as it was built around
reverse-engineering how visual studio builds proxies using wsdl.exe

- Oisin / x0n

My System SpecsSystem Spec
Old 10-10-2007   #4 (permalink)
Oisin Grehan


 
 

Re: SOAP webclient

On Oct 10, 5:15 pm, Oisin Grehan <ois...@xxxxxx> wrote:
Quote:

> On Oct 10, 4:17 pm, "Neil Chambers" <n3lly...@xxxxxx> wrote:
>
>
>
>
>
Quote:

> > Greetings all,
>
Quote:

> > I am new to the world of SOAP but have a little understanding of psh and, to
> > a lesser extent, dotnet.
>
Quote:

> > I'm a little lost as to which dotnet class(es) actually need to be used. I
> > have seen a couple of references to System.Net.HttpWebRequest and
> > s.n.HttpWebResponse (not that I understood them a great deal within the
> > VB.NET context). I am also intreagued by system.net.webclient - the name
> > sort of gives it away.
>
Quote:

> > Does anyone have an example of how I might use psh to interact with a SOAP
> > service? Any clues on how to use a client certificate within the process
> > would also be greatly welcomed.
>
Quote:

> > Cheers!
> > n
>
> You could do a lot worse than start here:
>
> http://www.nivot.org/2007/08/07/NewI...eProxyGenerato...
>
> usage:
>
> PS> $service = .\get-webservice.ps1 -anonymous -urlhttp://www.example.com/service.asmx
> PS> $service | get-member
>
> It can handle more complex services (multi-document basic profile 1.1)
> than many other posh scripts floating around, as it was built around
> reverse-engineering how visual studio builds proxies using wsdl.exe
>
> - Oisin / x0n- Hide quoted text -
>
> - Show quoted text -
Oops, forgot about client certificates - you can attach a client
certificate to the request via:

PS> $cert = get-item cert:\store\certname
PS> $service.ClientCertificates.Add($cert)
PS> $result = $service.WebMethod(...)

(where WebMethod is a remote soap method)

"Cert:" is a special drive in powershell that maps to the local
certificate store.

Hope this helps,

- Oisin / x0n

My System SpecsSystem Spec
Old 10-11-2007   #5 (permalink)
Neil Chambers


 
 

Re: SOAP webclient

Superb!

My thanks to Brendon and Oisin :-)

n

"Oisin Grehan" <oising@xxxxxx> wrote in message
news:1192052349.784554.317000@xxxxxx
Quote:

> On Oct 10, 5:15 pm, Oisin Grehan <ois...@xxxxxx> wrote:
Quote:

>> On Oct 10, 4:17 pm, "Neil Chambers" <n3lly...@xxxxxx> wrote:
>>
>>
>>
>>
>>
Quote:

>> > Greetings all,
>>
Quote:

>> > I am new to the world of SOAP but have a little understanding of psh
>> > and, to
>> > a lesser extent, dotnet.
>>
Quote:

>> > I'm a little lost as to which dotnet class(es) actually need to be
>> > used. I
>> > have seen a couple of references to System.Net.HttpWebRequest and
>> > s.n.HttpWebResponse (not that I understood them a great deal within the
>> > VB.NET context). I am also intreagued by system.net.webclient - the
>> > name
>> > sort of gives it away.
>>
Quote:

>> > Does anyone have an example of how I might use psh to interact with a
>> > SOAP
>> > service? Any clues on how to use a client certificate within the
>> > process
>> > would also be greatly welcomed.
>>
Quote:

>> > Cheers!
>> > n
>>
>> You could do a lot worse than start here:
>>
>> http://www.nivot.org/2007/08/07/NewI...eProxyGenerato...
>>
>> usage:
>>
>> PS> $service =
>> .\get-webservice.ps1 -anonymous -urlhttp://www.example.com/service.asmx
>> PS> $service | get-member
>>
>> It can handle more complex services (multi-document basic profile 1.1)
>> than many other posh scripts floating around, as it was built around
>> reverse-engineering how visual studio builds proxies using wsdl.exe
>>
>> - Oisin / x0n- Hide quoted text -
>>
>> - Show quoted text -
>
> Oops, forgot about client certificates - you can attach a client
> certificate to the request via:
>
> PS> $cert = get-item cert:\store\certname
> PS> $service.ClientCertificates.Add($cert)
> PS> $result = $service.WebMethod(...)
>
> (where WebMethod is a remote soap method)
>
> "Cert:" is a special drive in powershell that maps to the local
> certificate store.
>
> Hope this helps,
>
> - Oisin / x0n
>
My System SpecsSystem Spec
Old 10-11-2007   #6 (permalink)
Shay Levi


 
 

Re: SOAP webclient

I guess you meant Brandon

Shay
http://scriptolog.blogspot.com


Quote:

> Superb!
>
> My thanks to Brendon and Oisin :-)
>
> n
>
> "Oisin Grehan" <oising@xxxxxx> wrote in message
> news:1192052349.784554.317000@xxxxxx
>
Quote:

>> On Oct 10, 5:15 pm, Oisin Grehan <ois...@xxxxxx> wrote:
>>
Quote:

>>> On Oct 10, 4:17 pm, "Neil Chambers" <n3lly...@xxxxxx> wrote:
>>>
>>>> Greetings all,
>>>>
>>>> I am new to the world of SOAP but have a little understanding of
>>>> psh
>>>> and, to
>>>> a lesser extent, dotnet.
>>>> I'm a little lost as to which dotnet class(es) actually need to be
>>>> used. I
>>>> have seen a couple of references to System.Net.HttpWebRequest and
>>>> s.n.HttpWebResponse (not that I understood them a great deal within
>>>> the
>>>> VB.NET context). I am also intreagued by system.net.webclient - the
>>>> name
>>>> sort of gives it away.
>>>> Does anyone have an example of how I might use psh to interact with
>>>> a
>>>> SOAP
>>>> service? Any clues on how to use a client certificate within the
>>>> process
>>>> would also be greatly welcomed.
>>>> Cheers!
>>>> n
>>> You could do a lot worse than start here:
>>>
>>> http://www.nivot.org/2007/08/07/NewI...ceProxyGenerat
>>> o...
>>>
>>> usage:
>>>
>>> PS> $service =
>>> .\get-webservice.ps1 -anonymous
>>> -urlhttp://www.example.com/service.asmx
>>> PS> $service | get-member
>>> It can handle more complex services (multi-document basic profile
>>> 1.1) than many other posh scripts floating around, as it was built
>>> around reverse-engineering how visual studio builds proxies using
>>> wsdl.exe
>>>
>>> - Oisin / x0n- Hide quoted text -
>>>
>>> - Show quoted text -
>>>
>> Oops, forgot about client certificates - you can attach a client
>> certificate to the request via:
>>
>> PS> $cert = get-item cert:\store\certname
>> PS> $service.ClientCertificates.Add($cert)
>> PS> $result = $service.WebMethod(...)
>> (where WebMethod is a remote soap method)
>>
>> "Cert:" is a special drive in powershell that maps to the local
>> certificate store.
>>
>> Hope this helps,
>>
>> - Oisin / x0n
>>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Using System.Net.WebClient and no cache PowerShell
Problems using webclient and Powershell PowerShell
Q: System.Net.WebClient PowerShell
WebClient, don't want Escape PowerShell
System.Net.WebClient and XML PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46