c# - Cannot implicitly convert type to System.Net.Authorization? -


I'm one. I am adding a CC file and using a web reference in it:

using ServiceMemberIDSS;

When I type in the following code, I get the return value of _authHeader:

  private authority IDSSCredentials () {ServiceMemberIDSS. AuthorizeHeader _authHeader = New Authorize (); _authHeader.UserName = "theUserName"; _authHeader.Password = "thePassword"; Return _authHeader; }  

Finally the _authHeader tag is underlined in red and when I press it, it says:

can not change type 'ServiceMemberIDSS.AuthorizeHeader' with 'System.Net.Authorization'

How can this be fixed?

AuthorizeHeader is defined in the Members.wsdl file in App_WebReferences , before that I need to send the username and password to the service. > XML as folder, is as follows:

  & lt; S: element name = "Authorized title" type = "tns: AuthorizeHeader" /> & Lt; S: complex type name = "author header" & gt; & Lt; S: Sequence & gt; & Lt; S: element minOccurs = "0" maxOccurs = "1" name = "user name" type = "s: string" /> & Lt; S: element minOccurs = "0" maxOccurs = "1" name = "password" type = "s: string" /> & Lt; / S: Sequence & gt; & Lt; S: any specialty / & gt; & Lt; / S: complexType & gt;  

Just return type and new () As soon as with

Personal ServicesMediaIssss AuthorizeIDIDSS credentials () serviceMailFile Authorize header _authHeader = new service minisim.Iss. Authorized Header (); _authHeader.UserName = "theUserName"; _authHeader.Password = "thePassword"; Return _authHeader; }

Comments