This content is now out of date.

Visit Our Community

C# integration problem

Hi support,

Did some search on the forum but doesn't a lot of example on C# integration with Yellowfin.

The version i got is 7.1. Try a basic example on creating a user via webservice.

Port number on my machine is 8100 and the definition i found from
Below is the code i use but the response always be null. I try to take out the binding and epa but the response would be FAILURE. May i know anything missing from the code?

Thank you.

[code]using System;
using System.ServiceModel;
using YellowfinWebService.yfAdminSvc;

namespace YellowfinWebService
class Program
static void Main(string[] args)
administrationServiceRequest rsr = new administrationServiceRequest();
administrationServiceResponse rs = null;
administrationPerson newUser = new administrationPerson();

newUser.userId = "";
newUser.password = "0000";
newUser.firstName = "Tom";
newUser.lastName = "Jones";
newUser.initial = "S";
newUser.salutationCode = "MR";
newUser.roleCode = "YFADMIN";
newUser.emailAddress = "";

rsr.loginId = "";
rsr.password = "test";
rsr.orgId = 1;
rsr.function = "ADDUSER";
rsr.person = newUser;

System.ServiceModel.BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
EndpointAddress epa = new EndpointAddress("http://localhost:8100/services/AdministrationService");

LegacyAdministrationServiceClient client = new LegacyAdministrationServiceClient(binding, epa);

rs = client.remoteAdministrationCall(rsr);
Anyone can give me some help?
Hi Thomas,

Sorry for the delay in responding. We are a Java shop here so most of the folks channel their expertise into java vs other programming languages. Taking a look at your code, what I do notice is that in your code snippet you have the following line:

[code]rsr.orgId = 1;[/code]

I do believe that this should be:

[code]rsr.setOrgId(new Integer(1));[/code]

Could you let me know if that change helps?

Also, I know this isn't c#, but here is an example of how to create a user successfully via Java for comparison.

<%! private static final String cvsId = "$Id: ws_admin_createuser.jsp,v 1.1 2012-02-17 02:26:51 Exp $"; %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %>
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>


Create User
Using Java generated stubs rather that using the Yellowfin webservices API..


String host = "localhost";
Integer port = 7171;
String path = "/services/AdministrationService";

AdministrationServiceResponse rs = null;
AdministrationServiceRequest rsr = null;
AdministrationServiceService ts = new AdministrationServiceServiceLocator(host, port, path, false);
AdministrationServiceSoapBindingStub rssbs = (AdministrationServiceSoapBindingStub) ts.getAdministrationService();
AdministrationPerson ap = new AdministrationPerson();
AdministrationClientOrg client = new AdministrationClientOrg();

// Service authentication attributes

rsr = new AdministrationServiceRequest();
rsr.setOrgId(new Integer(1));

// Create User Details

ap = new AdministrationPerson();

// Call webservice

rs = rssbs.remoteAdministrationCall(rsr);

if ("SUCCESS".equals(rs.getStatusCode()) ) {

out.write("Successfully Created User:
Ms John Doe -

} else {

out.write("Unsuccessfully Created New User
out.write("Code: " + rs.getErrorCode());


Hopefully this information is helpful. Please let us know if you have any other questions etc.

Have a great day!

Kind Regards,

Hi Dustin,

Thanks for your reply. Have checked the yellowfin log and found got the error message when i try to connect.

YF:2015-10-02 14:07:21:ERROR (LogonProcess:authenticateYellowfinUser) - Primary org not found
YF:2015-10-02 14:07:21: INFO (AdministrationService:remoteAdministrationCall) - WebserviceException caught: 25(COULD_NOT_AUTHENTICATE_USER)

In the Administrator service via wsdl, only allow to use the code below to set the orgId. The orgId is int (primitive type) which does not allow for Integer(object).
[code]rsr.orgId = 1;[/code]

rsr.setOrgId is not available in the web service.

Another question want to ask. How to find out the primary org id from the instance?

Thomas Lo
Hi Thomas,

The primary org id is always = 1. For future reference, this information can be found in the Organisation table of the Yellowfin Configuration Database.

I was taking a look at a Visual Basic example that we have lying around the office and I noticed that you are missing the following line of code in your example:

[code]rsr.orgIdSpecified = True;[/code]

Do you think you could add this line to your code to see if you are then able to authenticate? For example:

rsr.loginId = "";
rsr.password = "test";
rsr.orgId = 1;
rsr.orgIdSpecified = True;
rsr.function = "ADDUSER";
rsr.person = newUser;

I look forward to hearing how it goes.

Kind Regards,

I did try your VS Solution but keep getting the following error when using the LOGINUSER function.

System.InvalidOperationException: There was an error reflecting 'in0'. ---> System.InvalidOperationException: 'date' is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types.

Code snippet

AdministrationServiceRequest rsr = new AdministrationServiceRequest();
AdministrationServiceResponse rs = null;
AdministrationPerson ap = new AdministrationPerson();

rsr.loginId = "";
rsr.password = "....";
rsr.orgId = 1;
rsr.function = "LOGINUSER";

ap.userId = "";
ap.password = "...";

Any thoughts ??
Hi Christopher,

This is how I was able to get the LOGINUSER working from Vb.Net, You may want to make the necessary changes for C#

In the reference.vb or reference.cs, Replace all System.Nullable to DateTime and replace all System.Nullable with integer

Comment out or delete the below code if it exists

'CODEGEN: Generating message contract since the wrapper name (addColumnToViews) of message addColumnToViewsRequest1 does not match the default value (addColumnToViews1)
' ' System.ServiceModel.XmlSerializerFormatAttribute(Style:=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults:=True, Use:=System.ServiceModel.OperationFormatUse.Encoded), _
' System.ServiceModel.ServiceKnownTypeAttribute(GetType(ImportIssueElement)), _
' System.ServiceModel.ServiceKnownTypeAttribute(GetType(ImportIssue)), _
' System.ServiceModel.ServiceKnownTypeAttribute(GetType(ReportBinaryObject)), _
' System.ServiceModel.ServiceKnownTypeAttribute(GetType(AdministrationFunction)), _
' System.ServiceModel.ServiceKnownTypeAttribute(GetType(ImportOption)), _
' System.ServiceModel.ServiceKnownTypeAttribute(GetType(AdministrationGroupMember))> _

Best of luck !

Thanks for trying Yellowfin

Please complete the form below to request your copy of Yellowfin today.