Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am creating a project in which the client needs to call some remote method.
Both the client and server is uses Win32 APIs.

The server have sucessfully registered it's iterface sucessfully.
The client it getting a valid have value to the remote system using
C++
RpcBindingFromStringBinding
API.

But when the actual RPC method is called it's throwing an exception and
C++
RpcExceptionCode()
API returning 5 (Access denied error).

What should I do to resolve this problem.

I am using
C++
ncacn_ip_tcp
protocol sequence and I tested my code in Windows 7.
Posted

1 solution

The client thread needs to have valid credentials on the server. It is common use to create an account for an RPC-Server and give that credentials to the client threads.
 
Share this answer
 
Comments
Debojyoti Majumder 9-Aug-11 6:09am    
@KarstenK
Thanks.

I tried to give some credentials to the client thread.
I used this code...

RPC_SECURITY_QOS SecQos;

// Set the quality of service on the binding handle
SecQos.Version = RPC_C_SECURITY_QOS_VERSION_1;
SecQos.Capabilities = RPC_C_QOS_CAPABILITIES_MUTUAL_AUTH;
SecQos.IdentityTracking = RPC_C_QOS_IDENTITY_DYNAMIC;
SecQos.ImpersonationType = RPC_C_IMP_LEVEL_IDENTIFY;

status = RpcBindingSetAuthInfoEx(hello_v1_0_c_ifspec,
NULL,RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_AUTHN_WINNT, NULL,RPC_C_AUTHZ_NONE,&SecQos);

But the call it's not working.
status returned 1702... invalid binding.

What am I doing worng??
KarstenK 9-Aug-11 6:16am    
To clarify: the client credentials (username & password) have to be valid on the remote machine for the neeeded actions.

Can you start and run the client on the server machine?

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