Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2007

Tip: Looking for answers? Try searching our database.

WebPartPages of share point web service giving me error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SachinG - 19 Apr 2007 07:32 GMT
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.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters) at
LicenseLink.WebParts.WebPartService.WebPartPagesWebService.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.
John Saunders [MVP] - 19 Apr 2007 22:37 GMT
...

> But when I try to execute webReference.AddWebPart, it gives me web service
> soap exception like this
[quoted text clipped - 9 lines]
> 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.
Signature


John Saunders [MVP]

SachinG - 20 Apr 2007 09:42 GMT
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.

> ....
>
[quoted text clipped - 14 lines]
> Please post the entire exception. You have only supplied us with the stack
> trace.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.