Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Visual-Studio , +
I have web Service :
 
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using Microsoft.Web.Services3;
 
[WebService(Namespace = "http://tempuri.org/")]
public class Service : System.Web.Services.WebService
{
    [WebMethod]
    public string GetValue()
    {
       SoapContext soapContext1 = RequestSoapContext.Current;
 
       Security returnValue = default(Security);
       returnValue = soapContext1.Security;
 
       SecurityToken objSecurityToken = default(SecurityToken);
       objSecurityToken = soapContext1.IdentityToken;
 
        //Say hello to the guy that you know
        var name=RequestSoapContext.Current.IdentityToken.Identity.Name;
        return "Hello " + name;
    }
}
 
and
I have post this XML :
 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="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">
    <soap:Header>
        <Header >
            <ResponseSentDateTime/>
            <!-- If calling system is storing the response, then they could populate  this field before saving -->
            <ResponseReceivedDateTime/>
            <!--Optional field to pass. This may contain any tracking Id of the calling system -->
            <SessionId>7556fetf68fa50-66d3-4fdb-93c1-3b56f66340bd</SessionId>
            <!-- This will not be sent in Reponse  -->
            <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2003/06/secext">
                <wsse:UsernameToken wsu:Id="sample" xmlns:wsu="http://schemas.xmlsoap.org/ws/2003/06/utility">
                    <!-- User Name was issued by Hub team. Please check with Hub team if you do not have it -->
                    <wsse:Username>test</wsse:Username>
                    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">EVpXS/7yc/vDo+ZyIg+cc0fWderwrwer=</wsse:Password>
                    <wsse:Nonce>rwerwewrr=</wsse:Nonce>
                                        <wsu:Created>2003-07-16T01:24:32</wsu:Created>
                </wsse:UsernameToken>
            </wsse:Security>
 
            <Extensions xsi:nil="true"/>
        </Header>
    </soap:Header>
 
</soap:Envelope>
 
in web method
The value of
objSecurityToken is null and returnValue is null.
 
How i can find the value of Security(Username,Password,Nonce) in my web method(GetValue()).
Please suggest me how to get these value in web method
Posted 28-May-13 19:08pm
Edited 28-May-13 19:10pm
v2
Comments
Mukeshlky4u at 31-May-13 5:13am
   
Please help me...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 515
1 Maciej Los 349
2 Richard MacCutchan 220
3 BillWoodruff 209
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 29 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100