Posts

Showing posts with the label web services

Creating custom SharePoint web services

I found there are a lot of instructions on how to create web services but not many that give a best practices approach to doing this inside your solution in a way that is easy to repeat (like when you create new web methods in your custom web service and you don't want to manually re-edit all the wsdl and disco junk). First, you need to download two things to follow along: STSDEV WSS Web Service Helper Next, follow these steps: Create a new project in STSDEV, use the empty project C# assembly Add a new Web Service Application Project to your solution Add your web method to your web service. (If you just want to test this out, the default HelloWorld will work) Run the WSS Web Service Helper against your .asmx file (in your web service project). This will autogenerate your wsdl and disco .aspx files. Copy the .asmx file and the .cs codebehind (your webservice) and the two .aspx files generated by the WSS Web Service Helper and place them into your Rootfiles/ISAPI folder in your STSDe...

.NET Web Service Error: "Server did not recognize the value of HTTP Header SOAPAction"

Most of the time when we create a web service, we get to dictate what the final WSDL will look like and we use that in our application or provide it to other members on a team to consume. A current project I'm working on requires me to create a web service based on an established WSDL that would be consumed by another service. In order for there to be interoperability between the 2, my WSDL and the reference WSDL had to be identical. I went about creating the proxy class using WSDL.exe as I normally would and had my simple service up and running in about 5 minutes. When the external service tried to connect to mine, there was the " Server did not recognize the value of HTTP Header SOAPAction" error . Upon closer examination, my WSDL was identical to theirs with one exception: soap:operation soapAction =" FaultyAction " style =" document " /> Should have been: soap:operation soapAction ="" style =" document " /> After ...

Web Services on your dev machine

If you've ever tried to create a web service using a SharePoint development machine (using Visual Studio), you'll recognize this error: "Visual Web Developer does not support creating Web sites on a SharePoint Web server." Arrgh.. so annoying. Luckily there's an easy workaround: First, create a new web application in your webroot folder (probably c:\Inetpub\wwwroot) by creating a folder with explorer, and then application-izing it using the IIS Administration snap-in. Then, go back to Visual Studio and re-try to create the web service (File->New Web Site) using the name from the folder you just created. Tadaaaa...