Simple IBO Net Signup Process Error

I am trying to create a simple new contact in IMIS via IBO
Imis version 15.1.2.5454

I get this error.
It does create the IMIS entry but seem to fail in creating the security. This is a simple signup process test.
Any Help is appreciated.

This the error.

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
  at Asi.Web.Services.Membership.MembershipWebService.CreateImisUser(Boolean staffUser, Boolean webUser, String contactID, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved)
  at Asi.Web.Services.Membership.MembershipWebService.RegisterWebUser(String contactID, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved)
  --- End of inner exception stack trace ---
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
  at Asi.Web.Services.Membership.MembershipWebService.CreateImisUser(Boolean staffUser, Boolean webUser, String contactID, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved)
  at Asi.Web.Services.Membership.MembershipWebService.RegisterWebUser(String contactID, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved)
  --- End of inner exception stack trace ---

 

This is the code

CContact contact = new CContact(user);
contact.FirstName = FirstName.Text.Trim();
contact.LastName = LastName.Text.Trim();
contact.EmailAddress = EmailAddress.Text.Trim();
contact.CustomerTypeCode = "NM";
contact.Validate();
contact.Save();

//Works to here

string password = Password.Value.Trim();
if (password.Length > 0 && password == ConfirmPassword.Value.Trim())
{
contact.CreateUserSecurity(WebLogin.Text.Trim(), password);
}
contact.Validate();
contact.Save(); // Fails here

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Looks like your App not able

Looks like your App not able to obtain ASI membership web services using IBO.Net DLL.

Please check the following “ImisWebServerUrl” application settings is configured correctly from your web.config / app.config files.
Make sure you can able to browse the following URLS from your computer

iMIS Server URL: http://IMIS_SERVER/imis15
iMIS Webservices URL : http://IMIS_SERVER/imis15/AsiCommon/Services/Membership/MembershipWebSer...

Hope this helps.

Thanks
Balaji

Same issue different error

 

Running this code

 CContact contact = new CContact(user);

contact.FirstName = FirstName.Text.Trim();

contact.LastName = LastName.Text.Trim();

contact.EmailAddress = EmailAddress.Text.Trim();

contact.CustomerTypeCode = "NM";

 contact.CreateUserSecurity(LogInId.Text.Trim(), Password1.Text.Trim());

contact.Validate();

contact.Save();

Results in this error

System.NullReferenceException: Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an object.]
   Asi.iBO.ContactManagement.CContact.Save(DataServer server, Boolean validate, Boolean flowDown, Boolean useTransaction) +2517
   Asi.iBO.ContactManagement.CContact.Save(DataServer server, Boolean useNewTransaction) +46
   Asi.iBO.ContactManagement.CContact.Save(DataServer server) +39
   Asi.iBO.ContactManagement.CContact.Save()

Please advise.

 

I think this problem also

I think this problem also related to consuming asi webservices from ibo dll. Please upload your sample project here (http://www.imiscommunity.com/node/add/blog) let me investigate.

Note: Please include all your referenced dll to this project.

I don't think my problem

I don't think my problem relates to the asi dlls, as I'm able to use them to save information of an existing contact, as well as, create orders and other functionality.

Yes I have a defined membertype of NM = Non-Member

I checked and the asi_Name_Insert_Update trigger is enabled.

Error Code

When I looked at your stack trace for the error it references the Flow Down, If you are using the flowdown, are you sure that it is functioning properly

Broc

I'm not sure what the

I'm not sure what the boolean flowdown is.  I'm not even using that overload, just the simple .Save() method.

Any solution

Has this issue been solved? I am facing the same problem when attempting to create a new iMIS contact, upon the .Save() method I'm receiving a System.Net.WebException "The operation has timed out". From the stack trace it looks like it's timing out on the RegisterWebUser method in the MembershipWebService, but I can browse to the web service successfully.

Any ideas would be greatly appreciated.

Thanks in advance!

Hi, First try

Hi,

First try saving without creating user account for the contact then call createusersecurity function then save the contact again

something like this

                contact.Validate();
                contact.Save();  // First Save

                contact.CreateUserSecurity(username,password);
                contact.UserSecurity.ExpiresOn = System.DateTime.Today.AddYears(20);
                contact.UserSecurity.IsLoginDisabled = true;

                contact.Save(); // Second Save

Thanks

Not quite

Thank you for your quick response, I reordered how the code was executing to attempt to save the contact before creating any of the user security for that individual but I still ran into the same System.Net.WebException "The operation has timed out".

Please let me know if you have any other suggestions.

Thanks

Well. Q1.Whether first save

Well.

Q1.Whether first save was successful?

Q2. Confirm you got this error from second save, If the anwer is yes then check your web/app. config file make sure you enterd your iMIS15 webservice url correctly

<add key="ImisWebServerUrl" value="http://yourserver/imis15"/>

Thanks

Q1- No the first save was

Q1- No the first save was not successful, upon the first save is when I receive the System.Net.WebException "The operation has timed out"

Q2 - I have checked the web.config to ensure that the "ImisWebServerUrl" key is correctly set. The setting's value is equal to the server that the iMIS application lives on followed by "/imis15"

Just to note, this error started the day that the client upgraded their iMIS from 15.0.x.x (can't remember the last few numbers) up to the newest version. The code for our application had not changed at all, but upon the new installation end-users were no longer able to signup and join the iMIS system through our application.

Let me know if there is any other information I can give you to help us come to a solution.

Thanks again for your help

Hi Please post your code

Hi

Please post your code where you call first save, I will investigate, What I know is that, until unless you call createusersecurityfunction "webexception" error should't occur.

Thanks

Code

Here is the initial save:


IiMISUser user;
CContact contact;

// If someone is logged in, get them set up for profile edit
if (Session["LoginUser"] != null)
{
user = (CContactUser)Session["LoginUser"];
contact = new CContact(user, ((CContactUser)user).ContactId);
_isUpdating = true;
}
else // Otherwise log in as a staff member to create the new contact
{
user = CStaffUser.Login(ConfigurationManager.AppSettings["LoginKey"], ConfigurationManager.AppSettings["LoginPW"]);
user.ThrowExceptionOnError = true;
contact = new CContact(user);
contact.CustomerTypeCode = "NM";
}

// Set the contact's properties to the data in the form
contact.FirstName = TxtFirstName.Text.Trim();
contact.LastName = TxtLastName.Text.Trim();
contact.Designation = TxtDesignation.Text.Trim();
contact.EmailAddress = TxtEmail.Text.Trim();
contact.WebsiteAddress = TxtWebSite.Text.Trim();
contact.HomePhone = TxtHomePhone.Text.Trim();
contact.InstituteName = TxtCompanyName.Text.Trim();
contact.Title = TxtTitle.Text.Trim();
contact.WorkPhone = TxtWorkPhone.Text.Trim();
if (contact.Validate())
{
contact.Save();
}
else
{
throw new Exception(contact.Errors.PrimaryErrorMessage);
}

Then after going through some more code that collects data for addresses I try a second save after calling CreateUserSecurity, although it doesn't ever get hit because I'm hitting the WebException before then. Just thought it may be helpful. This second save is posted below:


contact.CreateUserSecurity(TxtUserName.Text.Trim(), TxtPassword.Text.Trim());
string password = TxtPassword.Text.Trim();
if (password.Length > 0 && password == TxtPasswordConfirm.Text.Trim())
contact.UserSecurity.ChangePassword(password, ConfigurationManager.AppSettings["LoginKey"], ConfigurationManager.AppSettings["LoginPW"]);
contact.UserSecurity.ExpiresOn = DateTime.Now.AddYears(20);
contact.UserSecurity.ChangeWebLogin(TxtUserName.Text.Trim(), password);

// Save the contact
contact.Save();

Thanks

Hi, Can you please post your

Hi,

Can you please post your error stack trace.

Stack Trace

Per your request, here is the stack trace. Looks to me as though it is dying on the RegisterWebuser method, which is odd because I can successfully invoke that method when browsing to it and using test parameters (but with a real iMIS contact id).


Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[WebException: The operation has timed out]
System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) +263
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) +4
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +172
Asi.Membership.MembershipService.MembershipWebService.RegisterWebUser(String contactID, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved) +232
Asi.Membership.MembershipProvider.RegisterWebUser(String contactId, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved) +73
Asi.iBO.ContactManagement.CContactUser.WebServiceSaveChanges(DataServer server) +171
Asi.iBO.ContactManagement.CContactUser.Save(DataServer server) +1588
Asi.iBO.ContactManagement.CContact.Save(DataServer server, Boolean validate, Boolean flowDown, Boolean useTransaction) +4975
Asi.iBO.ContactManagement.CContact.Save(DataServer server, Boolean useNewTransaction) +54
Asi.iBO.ContactManagement.CContact.Save(DataServer server) +47
Asi.iBO.ContactManagement.CContact.Save() +119
umbracoMemberControls.usercontrols.SignUp.BtnSubmit_Click(Object sender, EventArgs eventArgs) +5041
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955

Could it be a problem of

Could it be a problem of creating proxy before  consuming  ASI Membership webservices? Are you using the same version of Asi.IBO.dll which is in iMIS15/Bin folder?

Referencing correct version of iBO assembly

I have double checked and our application has reference to the same version of the iBO assembly that the iMIS Public View site is using and I'm still getting the timeout error.

Thanks

Do you need a proxy settings

Do you need a proxy settings to access iMIS server?. How do I contact you by email?. You are not accepting private messages from this community.

Contact

Try the private message again...didn't realize I had it turned off.

If that still doesn't work you can contact me at tyler.joyner@atlanticbt.com

Same issue

Has anyone solved this issue?

My initial Contact.Save works and adds the user to the system, but the save after creating the user security record dies with a

Server was unable to process request. ---> Object reference not set to an instance of an object.

Here is the code:

iboAdmin.InitializeSystem(connection_string);
CStaffUser user = CStaffUser.Login(manager_login, manager_password);
CContactUser contactUser = null;

contactUser = CContactUser.LoginByWebLogin(manager_login);
CContact contact = new CContact(user, formData.contact_id);
contact.UserSecurity.ChangeWebLogin(formData.web_login, formData.password);
contact.UserSecurity.ExpiresOn = System.DateTime.Today.AddYears(20);
contact.UserSecurity.IsLoginDisabled = false;

bool cont_valid;
//cont_valid = contact.Validate();
//MembershipProvider memb = new MembershipProvider();
//smemb.RegisterWebUser(formData.contact_id, formData.web_login, formData.password, formData.email, "This is the question", "this is the answer", true);
cont_valid = contact.Validate();
if( cont_valid )
contact.Save();
else
output.Text = contact.Errors.PrimaryErrorMessage;

And here is the stack trace:

[SoapException: Server was unable to process request. ---> Object reference not set to an instance of an object.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431714
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
Asi.Membership.MembershipService.MembershipWebService.RegisterWebUser(String contactID, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Membership\Web References\MembershipService\Reference.cs:856
Asi.Membership.MembershipProvider.RegisterWebUser(String contactId, String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved) in c:\Builds\iMIS\15.1.3_Commit\Sources\imis.net\Packages\Platform\Asi.Membership\MembershipProvider.cs:179
Asi.iBO.ContactManagement.CContactUser.WebServiceSaveChanges(DataServer server) +200
Asi.iBO.ContactManagement.CContactUser.Save(DataServer server) +1676
Asi.iBO.ContactManagement.CContact.Save(DataServer server, Boolean validate, Boolean flowDown, Boolean useTransaction) +4742
Asi.iBO.ContactManagement.CContact.Save(DataServer server, Boolean useNewTransaction) +77
Asi.iBO.ContactManagement.CContact.Save(DataServer server) +70
Asi.iBO.ContactManagement.CContact.Save() +118
iMISTest2005._Default.updateSecurity(iMISData formData) in C:\Users\Jimmy\Documents\Visual Studio 2005\Projects\iMISTest2005\iMISTest2005\Default.aspx.cs:515
iMISTest2005._Default.Page_Load(Object sender, EventArgs e) in C:\Users\Jimmy\Documents\Visual Studio 2005\Projects\iMISTest2005\iMISTest2005\Default.aspx.cs:168
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

I am going crazy trying to figure out what isn't set. Any help would be appreciated.

same issue reported before

Membertype Code

Do you also have a membertype of NM?

Find my issue

The issue I was having is that someone had done an import on our clients database and left the Name.Insert_update trigger disabled. Once I enabled it, evrything was good to go. I discovered it when I found that my code was just fine against another db, but not this one. I ran the Analyze Database function in th repair. Sometimes others or wierd circumstances can make you feel so inferior. Thanks for the post, ALL.

Broc