powershell2 new-webserviceproxy soap security header


hi,

i'm trying call web service require security header.

i try :

$appid = "username"
$apppassword = "password"
$apppassword = convertto-securestring $apppassword -asplaintext -force
$credentials = new-object -typename system.management.automation.pscredential -argumentlist $appid, $apppassword

$wsp = new-webserviceproxy -uri "file://c:\app\g.wsdl" -namespace "we" -credential $credentials

everything seems fine: "$wsp | gm" return web service methods.


when try send request, error occur:
" blahblah....'no ws-security header found' ...blahblah"

in g.wsdl, find this:

<wsp:policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
     xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
     wsu:id="username_token">
    <wsp:exactlyone>
      <wsp:all>
        <sp:supportingtokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
          <wsp:policy>
            <sp:usernametoken />
          </wsp:policy>
        </sp:supportingtokens>
      </wsp:all>
    </wsp:exactlyone>
</wsp:policy>


how can add security header (usernametoken) in soap request ?

thanks
jm

based on minimal amount of parameters when checking new-webserviceproxy, i'm going put forward isn't possibly powershell.  i'm curious whether there's flexibility if try using .net class.  may try it...
 
marco

hi,

i'm trying call web service require security header.

 



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client