Jump to content

How to get the publishing point from Authorization plugin?


Recommended Posts

Guest Helen
Posted

Hello there,

 

I am trying to implement an authorization plugin in Windows Server 2008 by

implementing interface IWMSEventAuthorizationPlugin (of course

IWMSBasicPlugin too).

 

I need to get the information, say the name, of the corresponding publishing

point in function AuthorizeEvent. The snippet of my code (C#) is:

 

public void AuthorizeEvent(ref WMS_EVENT pEvent,

IWMSContext pUserCtx,

IWMSContext pPresentationCtx,

IWMSCommandContext pCommandCtx,

IWMSEventAuthorizationCallback pCallback,

object Context)

{

 

String pubpoint_name = "";

try

{

IWMSContext CmdRequest = null;

pCommandCtx.GetCommandRequest(out CmdRequest);

 

CmdRequest.GetStringValue(WMSDefines.WMS_COMMAND_CONTEXT_PUBPOINT_NAME,

WMSDefines.WMS_COMMAND_CONTEXT_PUBPOINT_NAME_ID, out pubpoint_name, 0);

File.AppendAllText("C:/log.txt", "pubpoint: " +

pubpoint_name + "\r\n");

}

catch (Exception e)

{

File.AppendAllText("C:/log.txt", "Exception: " + e.Message+

"\r\n");

}

 

try

{

IWMSContext CmdResponse = null;

pCommandCtx.GetCommandResponse(out CmdResponse);

 

 

CmdResponse.GetStringValue(WMSDefines.WMS_COMMAND_CONTEXT_PUBPOINT_NAME,

WMSDefines.WMS_COMMAND_CONTEXT_PUBPOINT_NAME_ID, out pubpoint_name, 0);

File.AppendAllText("C:/log.txt", "pubpoint: " +

pubpoint_name + "\r\n");

}

catch (Exception e)

{

File.AppendAllText("C:/log.txt", "Exception: " + e.Message +

"\r\n");

}

}

 

 

 

But I got "invalid index", error code 0x8007005 exception for all events. I

tried it on both the server and plugin level.

 

Did I do anything wrong or how to make it?

 

Thanks

 

Helen

  • Replies 1
  • Created
  • Last Reply
Guest Helen
Posted

RE: How to get the publishing point from Authorization plugin?

 

Still waiting.

 

Helen

 

"Helen" wrote:

> Hello there,

>

> I am trying to implement an authorization plugin in Windows Server 2008 by

> implementing interface IWMSEventAuthorizationPlugin (of course

> IWMSBasicPlugin too).

>

> I need to get the information, say the name, of the corresponding publishing

> point in function AuthorizeEvent. The snippet of my code (C#) is:

>

> public void AuthorizeEvent(ref WMS_EVENT pEvent,

> IWMSContext pUserCtx,

> IWMSContext pPresentationCtx,

> IWMSCommandContext pCommandCtx,

> IWMSEventAuthorizationCallback pCallback,

> object Context)

> {

>

> String pubpoint_name = "";

> try

> {

> IWMSContext CmdRequest = null;

> pCommandCtx.GetCommandRequest(out CmdRequest);

>

> CmdRequest.GetStringValue(WMSDefines.WMS_COMMAND_CONTEXT_PUBPOINT_NAME,

> WMSDefines.WMS_COMMAND_CONTEXT_PUBPOINT_NAME_ID, out pubpoint_name, 0);

> File.AppendAllText("C:/log.txt", "pubpoint: " +

> pubpoint_name + "\r\n");

> }

> catch (Exception e)

> {

> File.AppendAllText("C:/log.txt", "Exception: " + e.Message+

> "\r\n");

> }

>

> try

> {

> IWMSContext CmdResponse = null;

> pCommandCtx.GetCommandResponse(out CmdResponse);

>

>

> CmdResponse.GetStringValue(WMSDefines.WMS_COMMAND_CONTEXT_PUBPOINT_NAME,

> WMSDefines.WMS_COMMAND_CONTEXT_PUBPOINT_NAME_ID, out pubpoint_name, 0);

> File.AppendAllText("C:/log.txt", "pubpoint: " +

> pubpoint_name + "\r\n");

> }

> catch (Exception e)

> {

> File.AppendAllText("C:/log.txt", "Exception: " + e.Message +

> "\r\n");

> }

> }

>

>

>

> But I got "invalid index", error code 0x8007005 exception for all events. I

> tried it on both the server and plugin level.

>

> Did I do anything wrong or how to make it?

>

> Thanks

>

> Helen


×
×
  • Create New...