Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are []..
This is probably the most painfull error that I have ever experienced. After trying many fixes and googling for hours.
Problem : I only got this error when the web service was deployed to a Sharepoint web application that did not use a DNS entry to access the site. (Web service deployed to the ISAPI folder)
Fix : The solution which helped me was to remove the Base Address tags from my web.config file and my service worked. See below:
When I removed the above tags I no longer had problems accessing my webservice from my SharePoint site.
I'm a dotnet guy who has dabbled in a few things. The Forex space seems quite interesting learning about MQL5 and different trading strategies. My ideas are my own and is intended to help others in any small way. If you like the content give me a like and follow...
Monday, July 18, 2011
How to associate a workflow to a list programatically
Associating workflows to lists are pretty simple.
You will need the following:
Task List - Out of the box list
WorkFlowHistory List - Out of the box list
Workflow List - Workflow associate to this list
SPSecurity.RunWithElevatedPrivileges(delegate()
{
web.AllowUnsafeUpdates = true;
SPList taskList;
SPList workflowHistoryList;
SPList indexItemList = web.Lists[Constants.IndexItemList];
try
{
taskList = web.Lists[Constants.WFTasks];
}
catch
{
taskList = web.Lists[web.Lists.Add(Constants.WFTasks, Constants.WFTasks, SPListTemplateType.Tasks)];
}
try
{
workflowHistoryList = web.Lists[Constants.WFHistory];
}
catch
{
workflowHistoryList = web.Lists[web.Lists.Add(Constants.WFHistory, Constants.WFHistory, SPListTemplateType.WorkflowHistory)];
}
SPWorkflowTemplate template = web.WorkflowTemplates.GetTemplateByBaseID(new Guid(Constants.workFlowTemplateId));
SPWorkflowAssociation association = SPWorkflowAssociation.CreateListAssociation(template, template.Name, taskList, workflowHistoryList);
association.AllowManual = true;
association.AutoStartChange = true;
association.AutoStartCreate = true;
indexItemList.WorkflowAssociations.Add(association);
indexItemList.Update();
web.AllowUnsafeUpdates = false;
web.Update();
});
Workflow start properties may vary, please change as you see fit.
You will need the following:
Task List - Out of the box list
WorkFlowHistory List - Out of the box list
Workflow List - Workflow associate to this list
SPSecurity.RunWithElevatedPrivileges(delegate()
{
web.AllowUnsafeUpdates = true;
SPList taskList;
SPList workflowHistoryList;
SPList indexItemList = web.Lists[Constants.IndexItemList];
try
{
taskList = web.Lists[Constants.WFTasks];
}
catch
{
taskList = web.Lists[web.Lists.Add(Constants.WFTasks, Constants.WFTasks, SPListTemplateType.Tasks)];
}
try
{
workflowHistoryList = web.Lists[Constants.WFHistory];
}
catch
{
workflowHistoryList = web.Lists[web.Lists.Add(Constants.WFHistory, Constants.WFHistory, SPListTemplateType.WorkflowHistory)];
}
SPWorkflowTemplate template = web.WorkflowTemplates.GetTemplateByBaseID(new Guid(Constants.workFlowTemplateId));
SPWorkflowAssociation association = SPWorkflowAssociation.CreateListAssociation(template, template.Name, taskList, workflowHistoryList);
association.AllowManual = true;
association.AutoStartChange = true;
association.AutoStartCreate = true;
indexItemList.WorkflowAssociations.Add(association);
indexItemList.Update();
web.AllowUnsafeUpdates = false;
web.Update();
});
Workflow start properties may vary, please change as you see fit.
Subscribe to:
Posts (Atom)