By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

WebPartPages of share point web service giving me error

P: n/a
I am working on share point web part development. As a client requirement we
have to generate our own web part gallery, so I prefer to write one user
control, and in that user control I display all web part definition(dwp)
file. Now user select dwp file, web part zone id and page name from drop down
and say "Add Web Part".

Ideally it should add web part to particular page to that web part zone. I
am using http://servername/_vti_bin/webpartpages.asmx web service to add web
part. I am using AddWebPart() method to add web part.

In this project when I take reference of this web reference and build
project and deploy on site then it works properly. But the problem is that
servername of this web site can be change on client side.

so I keep url of this web site configurable in web.config of share point
application. Now I read configuration and assign this value to web service
instance.

Like:

WebPartPagesWebService webReference = new WebPartPagesWebService();

webReference.Url = ConfigurationManager.AppSettings["WebPartService"];

webReference.Credentials = System.Net.CredentialCache.DefaultCredentials;

But when I try to execute webReference.AddWebPart, it gives me web service
soap exception like this

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
LicenseLink.WebParts.WebPartService.WebPartPagesWe bService.AddWebPart(String
pageUrl, String webPartXml, Storage storage) in
D:\WebPartProjects\LicenseLinkWebParts\Web
References\WebPartService\Reference.cs:line 669 at
WebPartGallery.btnAddWebPart_Click(Object sender, EventArgs e)

Please help me to resolve this issue.

Apr 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"SachinG" <Sa*****@discussions.microsoft.comwrote in message
news:64**********************************@microsof t.com...

....
But when I try to execute webReference.AddWebPart, it gives me web service
soap exception like this

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
LicenseLink.WebParts.WebPartService.WebPartPagesWe bService.AddWebPart(String
pageUrl, String webPartXml, Storage storage) in
D:\WebPartProjects\LicenseLinkWebParts\Web
References\WebPartService\Reference.cs:line 669 at
WebPartGallery.btnAddWebPart_Click(Object sender, EventArgs e)
Please post the entire exception. You have only supplied us with the stack
trace.
--

John Saunders [MVP]
Apr 19 '07 #2

P: n/a
Hi John,

Actually when I update web reference and change URL of web service, than it
working fine.

Thanks for your kind attention for my problem.

"John Saunders [MVP]" wrote:
"SachinG" <Sa*****@discussions.microsoft.comwrote in message
news:64**********************************@microsof t.com...

....
But when I try to execute webReference.AddWebPart, it gives me web service
soap exception like this

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
LicenseLink.WebParts.WebPartService.WebPartPagesWe bService.AddWebPart(String
pageUrl, String webPartXml, Storage storage) in
D:\WebPartProjects\LicenseLinkWebParts\Web
References\WebPartService\Reference.cs:line 669 at
WebPartGallery.btnAddWebPart_Click(Object sender, EventArgs e)

Please post the entire exception. You have only supplied us with the stack
trace.
--

John Saunders [MVP]
Apr 20 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.