.net assembly + SecurityHeader with username token issue

  • 14 July 2017
  • 1 reply
  • 0 views

I am facing an issue with calling a .net assembly hosted as an endpoint.

 

The assembly has a method that accepts the parameters, calls an oracle web sevice, gets the response, populates a custom object and sends it back to the client.

 

The method is static and returns a list.

 

It works fine when I test it with a console application. I am able to get the response back.

 

However, when I host it as an Endpoints Assembly, register a service instance and create a smart object, it fails.

 

I feel that the username token that is required in the security header is not being passed in the outgoing request. I have added the endpoint in the machine.config file.

 

Below is the code that is being used in the assembly

 

refabcService.abcerviceClient client = new refabcService.abcServiceClient();

using (new OperationContextScope(client.InnerChannel))
{
OperationContext.Current.OutgoingMessageHeaders.Add(new SecurityHeader("##UserNameToken##", "username", "password"));

refabcService.abcRespType abcResponseType = client.process(abcResponseType);

}

 

I have checked the host server and smart object logs, but they dont yield any information. Any pointers or leads to debugging this will be appreciated.


1 reply

Badge +9

Hi Upendra,


 


Can you perhaps add an image of what the error looks like?


In the ServiceInstance is there a debug property? If so can you set the value to TRUE and try again, is there any other useful information?


 


-Jean

Reply