Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SharePoint > SharePoint 2010 > BOOK: Beginning SharePoint 2010 Development
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning SharePoint 2010 Development
This is the forum to discuss the Wrox book Beginning SharePoint 2010 Development by Steve Fox; ISBN: 978-0-470-58463-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning SharePoint 2010 Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 22nd, 2010, 12:23 AM
Registered User
Join Date: Jun 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Soap Error on Lists WebService

I'm attempting to create the Lists WebService example in Chapter 2 using the "Customers" list. I receive this error:

System.Web.Services.Protocols.SoapException was caught
Message=Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerExcepti on' was thrown.
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName, Object[] parameters)
at WPFListApp.MYSPWebReference.Lists.GetListAndView(S tring listName, String viewName) in C:\Users\Administrator\documents\visual studio 2010\projects\WPFListApp\WPFListApp\Web References\MYSPWebReference\Reference.vb:line 262
at WPFListApp.MainWindow.btnUpdate_Click(Object sender, RoutedEventArgs e) in C:\Users\Administrator\documents\visual studio 2010\projects\WPFListApp\WPFListApp\MainWindow.xam l.vb:line 68

I thought this may be a null error because the line throwing the error is:

Dim myListView As XmlNode = myListService.GetListAndView("Customers", "")

the "myListService" is null. I changed the security line to:

myListService.Credentials = New NetworkCredential("username", "password")

maybe the default credentials that the example provided was incorrect. Unfortunately, that change generated a "401" error. Does anyone have any ideas how to resolve the issue?


strCompanyName = txtCompanyName.Text

strRegion = txtRegion.Text

strSize = txtSize.Text

strSales = "$" + txtSales.Text

Dim myListService As MYSPWebReference.Lists = New MYSPWebReference.Lists()

myListService.Credentials = System.Net.CredentialCache.DefaultCredentials

myListService.Url = "http://localhost/_vti_bin/Lists.asmx"

Dim myListView As XmlNode = myListService.GetListAndView("Customers", "")

strListID = myListView.ChildNodes(0).Attributes("Name").Value

strViewID = myListView.ChildNodes(1).Attributes("Name").Value

Dim myListDoc As New XmlDocument()

Dim batchXML As XmlElement = myListDoc.CreateElement("Batch")

batchXML.InnerXml = "<Method ID = '1' Cmd='New'><Field Name='Title'>" & strCompanyName & "</Field><Field Name='Region'>" & strRegion & "</Field><Field Name='Size'>" & strSize & "</Field><Field Name='Sales'>" & strSales & "</Field>" & "</Method>"

Dim myListReturn As XmlNode = myListService.UpdateListItems(strListID, batchXML)

MessageBox.Show("SharePoint List was updated!")
Catch ex As Exception

End Try

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old June 26th, 2010, 07:34 PM
Wrox Author
Join Date: Jun 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default SoapException in Chapter 2

You can change a couple of properties on the authentication of the service to correct this error. I have posted a fix and a link to the updated code here:

I will follow up here and on my blog with fixes or any additional supplements. You can also contact me direct from my blog as well (http://blogs.msdn.com/steve_fox).


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exposing 8 Send Ports with SOAP as WebService. benvictor Biztalk 0 July 29th, 2008 05:53 PM
SOAP Content-Type error babchai .NET Web Services 0 May 11th, 2008 11:24 PM
need way to pass the soap message to webservice i raju_kmarhotmail.com .NET Web Services 0 November 3rd, 2007 03:19 AM
Calling WebService from VB6 without use SOAP toolk sanjaykabra82 .NET Web Services 1 February 25th, 2004 08:30 AM
WebService - SOAP Protocol ksams .NET Web Services 1 January 29th, 2004 04:37 PM

All times are GMT -4. The time now is 10:05 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.