Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
hi,
I am New to window Store app,
I have web service like below
public AuthHeader AuthHeaderValue;
[SoapHeader("AuthHeaderValue", Required = true)]
[WebMethod]
public bool Authentiction()
{
if (AuthHeaderValue.Username == "anji" && AuthHeaderValue.Password == "anji")
{
return true;
}
return false;
}
public class AuthHeader: SoapHeader
{
public string Username;
public string Password;

}
 ---------------------------------------------------------------------
 and My web service method soap requset like below ,
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header> <AuthHeader xmlns="http://tempuri.org/"> <Username>string</Username> <Password>string</Password>
</AuthHeader> </soap:Header>
<soap:Body> <Authentiction xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>

And I wanna pass values to Authheader
when add reference to my app,
It is not allowing me to pass values through webservice reference object.......................
ServiceReference1.AuthenticationSoapClient service = new ServiceReference1.AuthenticationSoapClient();
ServiceReference1.AuthHeader authentication = new ServiceReference1.AuthHeader();
authentication.Username = "anji";
authentication.Password = "anji";
service.AuthHeaderValue= authentication;

Is there any other way to pass Authheader value to my method.....
please provide the solution struggling with 3 days...Please Help.........................
Thanks,
Anji
Posted

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900