- Server Manager
- Features
- Add Features
- SMTP Server (in list)
Click on Add Required Role Services - Next
- Next
- Next
- Install
- Click on Close when finished
- Exit the Server Manager
- (Optional) Control Panel
- System and Security
- Administrative Tools
- Internet Information Services (IIS) 6.0 Manager
- XXXX (local computer)
- SMTP Virtual Server #1
Right-click, properties. - Access Tab
- Authentication
May have to adjust for Active Directory (AD).
Blogging about software programming, SharePoint, hunting, video games, system administration, customer service, brewing, project management and other flavored topics.
Showing posts with label sharepoint 2010. Show all posts
Showing posts with label sharepoint 2010. Show all posts
Friday, June 21, 2013
How to add SMTP to your SharePoint farm?
Just wanted to post a really quick, and hopefully helpful, guide on setting up the SMTP Server feature for your SharePoint 2010 farm.
How do I update the favicon.ico for my SharePoint 2010 site?
Tired and sick of the stock orange people SharePoint icon that haunts you at every turn in SharePoint? It is quite simple to update the favicon.ico to something a little more appropriate for your site's
branding. Just follow the steps outlined below and you will be all set.
That's it, you may need to clear your browser cache and in some rare cases you may need to have the administrator restart IIS. But, you should now see a nice, new favicon.
- Upload your new favicon.ico file to a location you can easily manage it. Such as your Site Collection Images library or your SharePoint Hive.
- From the top level of your site or site collection click on All Site Content.
- Under Document Libraries click on Site Collection Images.
- On your ribbon menu at the top, click on Documents and click on Upload Document under the New tab.
- Upload your favicon.ico. Once finished you will need to copy the URL. Unless you made some special changes this will likely be the URL of /SiteCollectionImages/favicon.ico (this is a relative URL as opposed to an absolute URL, it's better... trust me...).
- From the top level of your site or site collection click on Site Actions and select Edit in SharePoint Designer.
- Under your Site Objects on the left you will see the Master Pages object. Click on it.
- On this list you will see a master page called v4.master. Right-click on this and select Edit File in Advanced Mode.
- If prompted to check out, select Yes.
- In the advanced editor, switch the view from Design (or Split if that is what you have it on) to Code.
- Look for the tabs Design - Split - Code located at the bottom of the screen.
- You are then going to replace...
<SharePoint:SPShortcutIcon runat="server" IconUrl="/_layouts/images/favicon.ico"/>
...with...
<SharePoint:SPShortcutIcon runat="server" IconUrl="/SiteCollectionImages/favicon.ico"/>
- Save the file.
- Back on the master pages list, right-click on the v4.master again. This time select Check In. You must check in a major version so this is published. Feel free to add an appropriate note, such as "Updated the favicon for the master page".
- Click on Ok.
- Back in your web browser, click on Site Actions and select Site Settings.
- Under the Galleries heading click on Master pages.
- In the drop-down menu (indicated by a small triangle) for the v4.master you should get an option to Approve/Decline the publish.
- Approve and place notes if you feel it is appropriate.
That's it, you may need to clear your browser cache and in some rare cases you may need to have the administrator restart IIS. But, you should now see a nice, new favicon.
Tuesday, February 19, 2013
Building custom SharePoint 2010 Site Pages using Visual Studio (Part II)
Hello again. In my previous post I showed you how to create customized Site Pages using Visual Studio (VS) instead of being limited by SharePoint Designer (SPD). Now I am going to explain how to instruct SharePoint that it is alright to allow code-behind for these Site Pages. Which by default, is not allowed.
NOTE: You will absolutely want to configure your event handler to undo these changes when appropriate and to make these changes when appropriate. This way you can be sure that when the feature is activated / deactivated.... you get the drift. My recommendation would be to create a separate feature just for this security change. My previous feature was called CustomPages so I will name this one CustomPages Security.
NOTE: You will absolutely want to configure your event handler to undo these changes when appropriate and to make these changes when appropriate. This way you can be sure that when the feature is activated / deactivated.... you get the drift. My recommendation would be to create a separate feature just for this security change. My previous feature was called CustomPages so I will name this one CustomPages Security.
- Add SafeControls
- Click on your module (SitePages from my last post) and open your properties window.
- Under the SafeControls section add a new SafeControl.
- Assembly = $SharePoint.Project.AssemblyFullName$
- Namespace = CustomPages
- TypeName = MyCustomPageTemplate
- Safe = true
- SafeAgainstScript = false
- What happens to my web.config?
- What is getting added to the web.config is the following:
<SafeMode MaxControls="200"
CallStack="false"
DirectFileDependencies="10"
TotalFileDependencies="50"
AllowPageLevelTrace="false">
<PageParserPaths>
<PageParserPath VirtualPath="/SitePages/MyCustomPage.aspx*"
CompilationMode="Always"
AllowServerSideScript="true"
IncludeSubFolders="true" />
</PageParserPaths>
</SafeMode> - Create a new feature and add an event receiver to it. This feature's scope also needs to be WebApplication (you can check by double-clicking the feature to bring up designer view).
- Add the following code and change as is appropriate for your needs. This is the sample and shouldn't be used as a straight copy / paste.
using System;
using System.Collections.ObjectModel;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Administration;
namespace CustomPages.Features.CustomPages_Security
{
/// <summary>
/// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade.
/// </summary>
/// <remarks>
/// The GUID attached to this class may be used during packaging and should not be modified.
/// </remarks>
[Guid("674c2a19-9913-4465-af57-198bd0416b49")]
public class CustomPages_SecurityEventReceiver : SPFeatureReceiver
{
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPWebConfigModification wcMod = new SPWebConfigModification();
wcMod.Path = "configuration/SharePoint/SafeMode/PageParserPaths";
wcMod.Name = "PageParserPath[@VirtualPath='/SitePages/MyCustomPage.aspx']";
wcMod.Owner = "CustomPages";
wcMod.Sequence = 0;
wcMod.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
wcMod.Value = "<PageParserPath VirtualPath='/SitePages/MyCustomPage.aspx' CompilationMode='Always' AllowServerSideScript='true' />";
webApp.WebConfigModifications.Add(wcMod);
webApp.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications();
webApp.Update();
});
}
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
Collection<SPWebConfigModification> wcMods = webApp.WebConfigModifications;
int initialModificationsCount = wcMods .Count;
for (int i = initialModificationsCount - 1; i >= 0; i--)
{
if (wcMods [i].Owner == "CustomPages")
{
SPWebConfigModification modToRemove = wcMods[i];
wcMods.Remove(modToRemove);
}
}
if (initialModificationsCount > wcMods.Count)
{
webApp.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications();
webApp.Update();
}
});
}
}
}
Building custom SharePoint 2010 Site Pages using Visual Studio (Part I)
Hi everyone. I decided today to write some instructions on how to create Site Pages that you can customize via Visual Studio (VS). Including the ability to execute server-side scripting. As I couldn't find a good resource on the internet for this I decided to do it myself.
First you need to create the custom site page. You could go through and build the page completely within SharePoint Designer (SPD) but, this will at least give us a good starting point for VS.
In my next blog post I'll describe how to mark your page as safe and show how to enable code-behind for these Site Pages.
First you need to create the custom site page. You could go through and build the page completely within SharePoint Designer (SPD) but, this will at least give us a good starting point for VS.
- Launch Internet Explorer (IE) and navigate to the Site where you wish to create your custom site page. In my case this will be http://localhost/mycustomsite.
- Select Site Actions | Edit in SharePoint Designer.
- Select File | Add Item | New Page from Master | v4.master (Default) | Create. When it asks you, change the name to MyCustomPageTemplate and in my case I am using the Site Pages library. But, you can use any Wiki Page Library you have setup as well.
- Click OK.
- Give it a second or two and when the alert comes up just click Yes.
NOTE: At this point I am assuming C-Sharp (C#) but if you are a Visual Basic (VB) programmer you can just change the language setting in the page tag as is appropriate. - Switch the page to Design view.
- Locate the PlaceHolderMain(Master) content place holder. It is the open area in the middle of the page for those not familiar. In the menu for it, click Create Custom Content. That menu can be accessed by clicking the little drop-down arrow right on the component itself.
- You can now click into the PlaceHolderMain(Custom) area, notice it says custom now, and it can be editted. Type some placeholder information like "My Content Goes Here".
- Switch the page to Code view.
- Hit [CTRL+A] to highlight all the contents of the page and [CTRL+C] to copy it into your clipboard.
- Save the page and close SPD.
- Launch VS and create a new Empty SharePoint Project. Let's call it the CustomPages project for now.
- Right-click the CustomPages project and select Add | New Item | Module.
- Name the module SitePages or whatever your library is and click Add.
- In the CustomPages project, select File | New File... | Web | Visual Basic or C# | Web Form and click Open.
- Right-click inside the contents of the file (anywhere on the screen should be fine) and select Move Default1.aspx into | CustomPages. Navigate to your SitePages module and save the file there with a name of MyCustomPage.aspx or whatever you want to call it.
NOTE: Make sure that the new page shows up in your Solution Explorer window under the SitePages folder. If it doesn't you may need to drag-and-drop it there. - Highlight all of the contents of the MyCustomPage.aspx and replace with the contents on your clipboard.
- Expand the Features folder and double-click Feature1 to open its settings.
- Set the feature title to CustomPages (or whatever makes sense) and set an appropriate description.
- Switch back to your solution explorer. Go ahead and delete the Sample.txt document found in your SitePages module folder.
- Open the Elements.xml document for editting. Remove the SitePages/ from the Url. The Path attribute should be left alone.
- Add the attribute Type with the value GhostableInLibrary to the File element you just modified. Also, add a Url of SitePages to the Module element. Should look like something this:<?xml version="1.0" encoding="utf-8"?><Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="SitePages" Url="SitePages">
<File Path="SitePages\MyCustomPage.aspx"
Url="MyCustomPage.aspx"
Type="GhostableInLibrary" />
</Module>
</Elements> - Save all of your changes.
In my next blog post I'll describe how to mark your page as safe and show how to enable code-behind for these Site Pages.
Thursday, February 7, 2013
How to setup a SharePoint 2010 list to accept email submissions
This question has actually cropped up often here recently. Both for work and from members of the SharePoint community. Essentially people want to be able to hit an email address and have their contents transform into SharePoint 2010 list objects.
This is actually very easy to configure and setup. The following instructions assume that Exchange is being used. So please feel free to modify "here and there" as necessary.
First, you need to make sure your SharePoint Farm has SMTP enabled. Next, after following the instructions on MSDN do the following (or have your Farm Administrator do the following):
So there you have it. A very simple way of setting up your SharePoint lists to be updated via email.
This is actually very easy to configure and setup. The following instructions assume that Exchange is being used. So please feel free to modify "here and there" as necessary.
First, you need to make sure your SharePoint Farm has SMTP enabled. Next, after following the instructions on MSDN do the following (or have your Farm Administrator do the following):
- Open Central Administrator
- Click on the System Settings heading.
- Under the E-Mail and Text Messages (SMS) heading, click on Configure incoming e-mail settings.
- You may see a few messages if this has never been setup before. The SMTP service must be running on the farm. Refer to the MSDN link above if you need help configuring this.
- Under the Enable Incoming E-Mail category:
- Enable sites on this server to receive e-mail? (Yes)
- Use the SharePoint Directory Management Service to create distribution groups and contacts? (Yes)
- Click OK.
- Click on the Monitoring link under your Quick Launch navigation (on the left).
- Click on Review job definitions under the Timer Jobs heading.
- This may take a little bit to render the page as jobs are cleared.
- Click on the job Microsoft SharePoint Foundation Incoming E-Mail.
- You can reconfigure the job timer for emails, if necessary. Please note that if the job doesn't run properly you should check security on your "Drop Folder".
- Exit Central Administrator
- Document library
- Form library
- Picture library
- Announcements list
- Calendar list
- Discussion board
- Blog
- In the List use the ribbon to access the List Tools | List | List Settings.
- Under the Communications heading you should now see an Incoming e-mail settings option. Click on it. If it isn't there, you need to recheck your settings within Central Administrator.
- Allow this list to receive e-mail? (Yes)
- E-mail address:
- Enter an appropriate address. The @domain.com should automatically be appended with whatever your Farm Administrator has setup on the server.
- Click OK.
So there you have it. A very simple way of setting up your SharePoint lists to be updated via email.
Wednesday, October 26, 2011
Add custom controls to SharePoint Designer 2010
Haven't posted in a week or so. So decided it was time to add something. Lots of idea bouncing while I have been attending a training course on SharePoint Designer.
A question came up during class which was, "How do I add custom controls into SharePoint Designer that I can drag-and-drop like the controls already there? For example, the ASP.NET controls.".
Here is the answer...
You will need to first copy your DLL and namespace to the SafeControls section of the 'web.config' file. This will make your control available to SharePoint Designer. However, an extra step is needed to make the control visible inside the GUI.
You will need to add an attribute to your class file. Just above your class definition. The attribute is:
[ToolboxData("<{0}:SomeNewControl runat=\"server\" />"), ToolboxItemFilter("Foo")]
Again, this goes above your class definition. That is it. You should now see your custom control inside SharePoint Designer under 'Server Controls'. And it should work just like the others (drag-and-drop).
A question came up during class which was, "How do I add custom controls into SharePoint Designer that I can drag-and-drop like the controls already there? For example, the ASP.NET controls.".
Here is the answer...
You will need to first copy your DLL and namespace to the SafeControls section of the 'web.config' file. This will make your control available to SharePoint Designer. However, an extra step is needed to make the control visible inside the GUI.
You will need to add an attribute to your class file. Just above your class definition. The attribute is:
[ToolboxData("<{0}:SomeNewControl runat=\"server\" />"), ToolboxItemFilter("Foo")]
Again, this goes above your class definition. That is it. You should now see your custom control inside SharePoint Designer under 'Server Controls'. And it should work just like the others (drag-and-drop).
Tuesday, October 4, 2011
Migration to SharePoint 2010: Part 3 - Integrating the ASP.NET Web Service into a SharePoint page
In my final posting for this 3-part blog, I will detail the simple steps needed to integrate the ASP.NET Web Service we have worked on into your SharePoint site.
To add this Web Service directly to a page in SharePoint do the following:
- Open Microsoft SharePoint Designer 2010.
- Click on Open Site.
- Under Site name enter the location to the SharePoint site you wish to connect too. Click Open.
- Under the quick launch area (located to the left of the screen) expand the Site Objects tab.
- Click on Data Sources. The summary area should now show you a list of data sources that are inside SharePoint. Such as lists, document libraries, etc.
- Click on SOAP Service Connection in the ribbon, located at the top of the screen. You will see the following:

- The Service description location is where you will want to put the path to your ASP.NET WSDL. Should be something like https://localhost/ws-server/MyWebService.asmx?WSDL or whatever you setup.
- Click on Connect Now or Reconnect. You should see your other fields light up.
To add this Web Service directly to a page in SharePoint do the following:
- Still remaining in SharePoint Designer, click on the Site Pages option under Site Objects.
- Add a new ASPX page. You can add this page by:
- Click on the drop-down menu for Page from your ribbon at the top of the screen.
- Select ASPX and rename the file.
- Right-click on the newly created file from your summary screen.
- Select Edit File in Advanced Mode from the context menu.
- You will see some code but, what you are interested in is the code between the <form> tags. Click and place your cursor between those tags. Or whatever you have setup on the page to meet your needs.
- From your ribbon you will want to select the Insert tab.
- Under the Data Views & Forms category you will want to select Data View. This will present you with a list of options.
- Scroll down until you find the SOAP service you created under Data Sources earlier. If everything is successful, you should see a new DataFormWebPart that contains data fed back from the Web Service you just called. If you get an error you may need to check your logs to determine why.
Friday, September 30, 2011
Self-Signed Certificate (SSL), SharePoint Designer 2010, and a SOAP Service Connection... Making it work
If you are here you have probably at some point seen the dreaded message...
"The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator."
Maybe even specifically whilst attempting to implement a SOAP Service Connection's data view into your ASPX page. The SOAP service living on a server with SSL enabled and using a self-signed certificate.
Have no fear. I am going to explain what leads you to this problem and how to correct it.
While setting up my ASP.NET Web Service I had a need to configure localhost to use SSL. Once this was done I needed to add the service to SharePoint. In my case, through the SOAP Service Connection GUI located in SharePoint Designer 2010.
The funny thing with Designer is that it attempts to hit the web service through your local machine, but it validates your SSL on the actual SharePoint site (even if you are pointed to a non-local instance of SharePoint). It does this because of the DataFormWebPart that is being placed in the page. This paradox hoses up your ability to test the Web Service if you haven't told SharePoint to trust your certificate.
It is really simple to correct this problem.
I hope this helps.
"The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator."
Maybe even specifically whilst attempting to implement a SOAP Service Connection's data view into your ASPX page. The SOAP service living on a server with SSL enabled and using a self-signed certificate.
Have no fear. I am going to explain what leads you to this problem and how to correct it.
While setting up my ASP.NET Web Service I had a need to configure localhost to use SSL. Once this was done I needed to add the service to SharePoint. In my case, through the SOAP Service Connection GUI located in SharePoint Designer 2010.
The funny thing with Designer is that it attempts to hit the web service through your local machine, but it validates your SSL on the actual SharePoint site (even if you are pointed to a non-local instance of SharePoint). It does this because of the DataFormWebPart that is being placed in the page. This paradox hoses up your ability to test the Web Service if you haven't told SharePoint to trust your certificate.
It is really simple to correct this problem.
- Export your certificate using the Microsoft Management Console.
- Make sure you choose DER Encoded Library X.509 (.CER).
- Open your Central Administration site in SharePoint.
- Click on the Security heading.
- Under General Security you will want to select Manage trust.
- Enter the name of your trust relationship and point to the .CER location.
- Click OK.
- You may or may not need to perform an iisreset.
I hope this helps.
Thursday, September 29, 2011
Migration to SharePoint 2010: Part 2 - ASP.NET Web Service
In continuation of Part 1, the decision was made to create a bridge between our third-party web services and SharePoint due to the native SOAP service connector not being compatible with the WSDL format.
To do this I created an ASP.NET Web Service solution in Visual Studio 2010.
So here are the steps I followed to create the new web service:
In my next post, I will go on to describe how I took my Web Service and integrated it into a page on SharePoint 2010.
To do this I created an ASP.NET Web Service solution in Visual Studio 2010.
- Open Microsoft Visual Studio 2010 (in this case I used VS Professional).
- Click on File in the toolbar.
- Select New Web Site.
- Pick your poison (Visual Basic or C#). For purposes of what I was working on, I choose C#.
- This is where things got interesting. .NET Framework 4 did not appear to have a ASP.NET Web Service template. Likely because they expect you to use WCF Service. I don't know.
- Switch to .NET Framework 3.5, if necessary, at the top of the window.
- Click on ASP.NET Web Service from the list of templates.
- Click on Browse next to your Web location field at the bottom.
- Select Local IIS located on the left side of the screen.
- A warning here. When I did this I received the following message:

I resolved this error message by enabling the Windows feature. This is how you can enable in Windows 7:
- Click on your Start icon.
- Select the Control Panel.
- Click on the Programs category heading.
- Click on Turn Windows Features on or off under the Programs and Features category.
- Branch down in the following order: Internet Information Systems => Web Management Tools => IIS 6 Management Compatibility.
- Put a check in the box next to IIS Metabase and IIS 6 configuration compatibility.
- Click OK. You may or may not have to restart your machine.
- Click on Default Web Site under your list of local web servers.
- In my case I needed SSL enabled. So I selected the option for Use Secure Sockets Layer. Before you do this though, make sure you have SSL enabled in IIS for localhost.
- Click on Create New Web Application. This is a small icon in the top right of the window.
- Enter the name of your web service. For example, ConversionWebService. Then click Open.
- Click OK.
- Another warning. At this point I got the following message: "ASP.NET 2.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 2.0 in order for your site to run correctly, Press F1 for more details." To correct this problem I had to revisit the control panel to access Windows features.
- Click on your Start icon.
- Select the Control Panel.
- Click on the Programs category heading.
- Click on Turn Windows Features on or off under the Programs and Features category.
- Branch down in the following order: Internet Information Systems => World Wide Web Services => Application Development Features.
- Put a check in the box next to ASP.NET. This will also automatically place a check next to other options. Which is fine.
- Click OK. You may or may not have to restart your machine.
- At this point Visual Studio opened up a generic class file called "Service". Which contains the C# code for managing the Web Service.
So here are the steps I followed to create the new web service:
- In the Solution Explorer pane to the right, right-click your solution name (should look like a URL) and select Add New Item.
- Select the Web Service template under your Installed Templates language of choice (again, in my case this is C#).
- In the name field, go ahead and name your Web Service. If you are building the temperature conversion call (from W3C Schools) you could call the Web Service 'Convert.asmx' minus the single quotes.
- Place a check in the Place code in separate file box.
- Click on Add.
- At this point I deleted the original Service.asmx and Service.cs files since I had no plans on using them.
- This is where your C# or Visual Basic skills come into play. The default code includes a Web Service method called HelloWorld(). Include the following code after the HelloWorld() method. Again, I am doing C#.
[System.Web.Services.WebMethod()] public double FahrenheitToCelsius(double Fahrenheit) { return ((Fahrenheit - 32) * 5) / 9; } [System.Web.Services.WebMethod()] public double CelsiusToFahrenheit(double Celsius) { return ((Celsius * 9) / 5) + 32; }
- Save the file.
- In the Solution Explorer pane located to the right, click on your service ASMX file and hit CTRL + F5. You should see the three operations (CelsiusToFahrenheit, FahrenheitToCelsius, and HelloWorld) at the top of the page that just loaded.
- Click on CelsiusToFahrenheit.
- In the Celsius field, enter a value (in this case I entered 37). Then click on Invoke.
- If all has gone according to plan, you should see your Fahrenheit value (in my case it was 98.6).
In my next post, I will go on to describe how I took my Web Service and integrated it into a page on SharePoint 2010.
Wednesday, September 28, 2011
Migration to SharePoint 2010: Part 1 - SOAP Service Connection
At work we began the path of changing from a PHP and Java shop into a .NET shop. Specifically migrating over to use SharePoint 2010 for both internal and external facing websites. A large undertaking for a company that has traditionally avoided .NET. In other words, an IT staff that doesn't know the framework at all (including myself!).
Before going any further I should warn you, the reader of this blog post, that at the time of writing this I was the only developer that my company had. Therefore, I really had no other team member that I could bounce questions off of in my pursuit to conquer .NET and SharePoint.
I took the initiative to learn as much as I could as quickly as I could. Training and books on topics such as ASP.NET, C#, SharePoint 2010, Visual Studio 2010, and so on. All of that training preparing me for the moment where I would be handed that first official .NET related development project. That time had come...
I was assigned a task to connect SharePoint 2010 to a set of WSDL files using SOAP on another server where our billing software resides. Essentially with two goals from management with a primary objective of confirming this would even work:
The first step I took was to try connecting to these services by using SharePoint's native "SOAP Service Connection" tool under SharePoint Designer's "Data Sources" object.
To test the Web Service and make sure all is well I had to get creative. Keeping in mind I am new to SharePoint Designer and the such.
This attempt to connect to the third-party WSDL files was a huge flop though despite my best efforts.
The first issue lie in the WSDL files themselves. The vendor for our billing software was using a RPC style rather than a Document style on their generated WSDL files. Which isn't supported by the type of service connection we were trying to create.
We worked with the vendor and they upgraded their format to a document format which could be consumed by SharePoint. Now we are getting somewhere!
Alas, the victory was short lived. It appeared that the operation names within the WSDL did not match the input names.
The vendor gave up trying to resolve this and informed us that their Web Services just won't work with SharePoint the way we were attempting too. If we wanted it to work we would have to customize each WSDL their tool was generating. And we would have to do it ourselves after they delivered the WSDL files to us. They wouldn't do it for us. In short, we were on our own.
Okay, so back to the drawing board it is. We wouldn't be able to add a simple "SOAP Service Connection" inside SharePoint Designer.
I decided that I would now attempt to create a "ASP.NET Web Service" project inside Visual Studio 2010 and use that as a bridge between SharePoint 2010 and the incompatible WSDL files. I would hit my own web services that would in turn send the correctly formatted packet to our vendor's web services.
The details of that project will be included in Part 2 of this Migration to SharePoint 2010 series. More to come, wish me luck...
Before going any further I should warn you, the reader of this blog post, that at the time of writing this I was the only developer that my company had. Therefore, I really had no other team member that I could bounce questions off of in my pursuit to conquer .NET and SharePoint.
I took the initiative to learn as much as I could as quickly as I could. Training and books on topics such as ASP.NET, C#, SharePoint 2010, Visual Studio 2010, and so on. All of that training preparing me for the moment where I would be handed that first official .NET related development project. That time had come...
I was assigned a task to connect SharePoint 2010 to a set of WSDL files using SOAP on another server where our billing software resides. Essentially with two goals from management with a primary objective of confirming this would even work:
- Allow a customer to authenticate their account via form submission on a page within SharePoint's publishing portal (public website). The Web Service should take the username and password, returning a valid or invalid authentication attempt.
- Expose data through Web Services into SharePoint lists on our internal (intranet) facing SharePoint site.
The first step I took was to try connecting to these services by using SharePoint's native "SOAP Service Connection" tool under SharePoint Designer's "Data Sources" object.
- Open Microsoft SharePoint Designer 2010.
- Click on Open Site.
- Under Site name enter the location to the SharePoint site you wish to connect too. Click Open.
- Under the quick launch area (located to the left of the screen) expand the Site Objects tab.
- Click on Data Sources. The summary area should now show you a list of data sources that are inside SharePoint. Such as lists, document libraries, etc.
- Click on SOAP Service Connection in the ribbon, located at the top of the screen. You will see the following:

- The Service description location is where you will want to put the path to your WSDL.
- A good sample Web Service is http://www.w3schools.com/webservices/tempconvert.asmx?WSDL.
- Click on Connect Now or Reconnect. You should see your other fields light up.
To test the Web Service and make sure all is well I had to get creative. Keeping in mind I am new to SharePoint Designer and the such.
- Still remaining in SharePoint Designer, click on the Site Pages option under Site Objects.
- Add a new ASPX page. Call it something like WSTest.aspx or whatever is easy to distinguish it from the rest of your SharePoint site. You can add this page by:
- Click on the drop-down menu for Page from your ribbon at the top of the screen.
- Select ASPX and rename the file.
- Right-click on the newly created file from your summary screen.
- Select Edit File in Advanced Mode from the context menu.
- You will see some code but, what you are interested in is the code between the <form> tags. Click and place your cursor between those tags.
- From your ribbon you will want to select the Insert tab.
- Under the Data Views & Forms category you will want to select Data View. This will present you with a list of options.
- Scroll down until you find the SOAP service you created under Data Sources earlier. If everything is successful, you should see a new DataFormWebPart that contains data fed back from the Web Service you just called. If you get an error you may need to check your logs to determine why.
This attempt to connect to the third-party WSDL files was a huge flop though despite my best efforts.
The first issue lie in the WSDL files themselves. The vendor for our billing software was using a RPC style rather than a Document style on their generated WSDL files. Which isn't supported by the type of service connection we were trying to create.
We worked with the vendor and they upgraded their format to a document format which could be consumed by SharePoint. Now we are getting somewhere!
Alas, the victory was short lived. It appeared that the operation names within the WSDL did not match the input names.
<wsdl:message name="sampleMessageName">When SharePoint was looking for "sampleMessageName" to be "sampleOperationName". The above is a very crude example. This caused the request packets to be incompatible with what the vendor was looking for.
<wsdl:part element="impl:sampleMessageName" name="parameters">
</wsdl:part>
</wsdl:message>
...
<wsdl:operation name="sampleOperationName">
The vendor gave up trying to resolve this and informed us that their Web Services just won't work with SharePoint the way we were attempting too. If we wanted it to work we would have to customize each WSDL their tool was generating. And we would have to do it ourselves after they delivered the WSDL files to us. They wouldn't do it for us. In short, we were on our own.
Okay, so back to the drawing board it is. We wouldn't be able to add a simple "SOAP Service Connection" inside SharePoint Designer.
I decided that I would now attempt to create a "ASP.NET Web Service" project inside Visual Studio 2010 and use that as a bridge between SharePoint 2010 and the incompatible WSDL files. I would hit my own web services that would in turn send the correctly formatted packet to our vendor's web services.
The details of that project will be included in Part 2 of this Migration to SharePoint 2010 series. More to come, wish me luck...
Subscribe to:
Posts (Atom)