如何使用自定义标头身份验证在C#中使用SOAP服务

时间:2018-12-11 18:36:04

标签: asp.net-mvc web-services wcf soap webservice-client

如何使用自定义标头身份验证在C#中使用SOAP服务。请帮忙吗?

服务网址类似:https://servername/web/umr/uat/member/updateCPSCallTrackV01

服务标题

  <soap:Header>
   <wsse:Security soap:mustUnderstand="true"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" >
<wsse:UsernameToken wsu:Id="UsernameToken-556E0ED5627B7F955E144138289424314"> <wsse:Username>username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">S9Xbze8iUdXmeROt1Akvdg==</wsse:Nonce>
<wsu:Created>2015-09-04T16:08:14.243Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>

请求格式

  <bml:invokeService chan:channel="true">
   <bml:CltrReqDetail chan:structuredContainer="true">
   <bml:pingSvcI>Ping</bml:pingSvcI>
   </bml:CltrReqDetail>
   </bml:invokeService>

响应格式

<SOAP-ENV:Envelope xmlns:bml="http://www.BML048.Request.com" xmlns:chan="http://www.ibm.com/xmlns/prod/CICS/channel-instance" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope">
   <SOAP-ENV:Body>
      <invokeServiceResponse cics:channel="true" xmlns="http://www.BML048.Response.com" xmlns:cics="http://www.ibm.com/xmlns/prod/CICS/channel-instance">
         <CltrRspStatus cics:structuredContainer="true">
            <statusReturnCode>S</statusReturnCode>
            <statusInfo>PING SERVICE / TEST CALL WAS SUCCESSFUL!</statusInfo>
            <statusInfo01T/>
            <statusInfo02T/>
            <statusInfo04T/>
         </CltrRspStatus>
      </invokeServiceResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

注意:此服务在SOPUI 5.0工具中正常运行。

0 个答案:

没有答案