Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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
Actor=""
Lang=""
Message=Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerExcepti on' was thrown.
Node=""
Role=""
Source=System.Web.Services
StackTrace:
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
InnerException:

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?

<code>
Try


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
MessageBox.Show(ex.ToString)

End Try
</code>


Thanks in advance.
C.
 
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:
http://blogs.msdn.com/b/steve_fox/ar...exception.aspx.

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).

Cheers,

Steve





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





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