Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I try to invoke method from my proxy class generated from a web reference added to the project , this is my code below
C#
public void call()
        {
            com.monster.schemas.MonsterBusinessGatewayService gateway = new MonsterBusinessGatewayService();
            
            Job job = new Job();
            gateway.Url = "https://208.71.198.74:8443/bgwBroker";
            gateway.Credentials = new NetworkCredential("xtestxftp", "ftp12345");
            gateway.UpdateJob(job);

        }

But , I encountered this error
System.Web.Services.Protocols.SoapHeaderException: Client not authenticated after processing available headers

Source Error:

Line 347: [return: System.Xml.Serialization.XmlElementAttribute("JobsResponse", Namespace="http://schemas.monster.com/Monster")]
Line 348: public JobsResponse UpdateJob([System.Xml.Serialization.XmlElementAttribute(Namespace="http://schemas.monster.com/Monster")] Job Job) {
Line 349: object[] results = this.Invoke("UpdateJob", new object[] {
Line 350: Job});
Line 351: return ((JobsResponse)(results[0]));

on Line: 349
Posted
Updated 24-Mar-14 6:16am
v3
Comments
CHill60 23-Mar-14 11:23am    
Are you sure the credentials you entered are correct - be careful with upper/lower case
amiach 23-Mar-14 11:26am    
yes I'm sure , this credentials are provided by Monster and these are a username and password of test account
CHill60 23-Mar-14 11:31am    
The only other thing I can think of is that the username is not allowed to update. Question is still in the queue though, so someone else may be able to help

1 solution

The problem is solved thanks to this code

com.monster.schemas.MonsterBusinessGatewayService gateway = new MonsterBusinessGatewayService();



//Business Gataway paramaters
gateway.Url = "https://208.71.198.74:8443/bgwBroker";
gateway.Proxy = proxy;
proxy.Credentials = cre;
gateway.UseDefaultCredentials = true;
gateway.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

gateway.Security = security;
security.UsernameToken = user;
user.Password = pass;

gateway.Security.UsernameToken.Username = "xtestxftp";
gateway.Security.UsernameToken.Password.Value = "ftp12345";

JobsResponse jobresp = gateway.UpdateJob(job);
 
Share this answer
 

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