.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

can anyone tell me how to pass external parameters to web service

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :ASP.Net

I am constructing an asp web service. The webservice will get parameter from sharepoint timer job. 

The webservice returns value("World")  to sharepoint, but the webservice can't get parameters from sharepoint( string hello). 

Can anyone tell me how to pass an external parameter to webservice



public string helloWorld(string hello )


 string a = hello+ "world"; 

 return  a;



Sharepoint timerjob Execute method

public override void Execute(Guid contentDBID)


localhost.Service ws = new localhost.Service();

string hi = ws.HelloWorld(aWorld);

 SPList Listjob = contentDb.Sites[0].RootWeb.Lists["aTestList"];

// create a new list Item, set the Title to the current day/time, and update the item

SPListItem newList = Listjob.Items.Add();

newList["Title"] = hi;


View Complete Post

More Related Resource Links

How to pass parameters to MDX through URL?


I have an SSRS report. I created it using BIDS and it uses a Sql Server Analysis Service data source.  The data source query is an MDX query with one parameter: @region, a default value has been set for this parameter.  The value which @region takes looks like [USA].[Northeast].[New Hampshire].[Coos County].

The MDX query goes like this:

Select ....


WHERE StrToMember(@region)

This report runs properly inside BIDS or through web browser after deployment.  In my report manager at http://localhost/Reports, I am able to view this report by selecting the value for the @region parameter from a dropdownlist, which contains such values as

Coos County
Cheshire County
Sullivan County
Strafford County
... ...

I know that we can pass query parameters to SSRS through the URL. I have successfully done so with relational database which uses regular SQL. But, I have not succeeded in passing this @region parameter of my MDX query through the URL.

I tried the following:


It didn'

Need to pass parameters from URL to fields in Custom List


I have a complex customized list and I need to pass parameters of two fields so that when the 'Questionnaire' is completed and subsequentially opened after initial submission, it will retrieve the Number and GUID automatically in respective fields. I send an email out with a link to the 'Form' that carries the parameters. I am trying to use the following javaScript but am unsure as to where to place this on the SharePoint page for it to work.



<script type="text/javascript">

function loadFormVars()
getQuerystring('CustodianGUID', 'ctl00_m_g_d08916d8_7224_4665_be72_2de381f45985_ff46_1'); ///replace
customerGUID and form field name
'ctl00_m_g_d08916d8_7224_4665_be72_2de381f45985_FormField11_ctl00_ctl00_TextField'); ///replace customerGUID
and form field name

alert("it works");

function getQuerystring(key, field)
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
document.getElementById(field).value = qs[1];


WPAsign application service unable to succesfuly pass the BVT tool

Hello, I'm getting a bunch these messages every two hours in my Windows 2003 application log. The server in question does not have outbound internet access where by the server is configured as a web server for the WPAsign application. Message: Failed auto update retrieval of third-party root list sequence number from: <http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootseq.txt> with error: The specified server cannot perform the requested operation. and when I run the BVT tool form the comand window I am getting unknown error and the output has some partial files but not the whole list expected at succesful sign. What does this mean? How can I manually update this? Any help or insight would be appreciated.

Trying to get basic Http URL with querystring parameters processed in WCF service

I'm trying to process a post by a third party server (Paypal) processed by my server through a WCF service. All I need is to get and process the values with the query string. This sounds incredibly easy, but after a weekend, I'm still stumped.  Any help would be greatly appreciated. Passing the following URL from my browser to the service causes a AddressFilter mismatch fault (below). http://localhost:9409/PPInfo.svc/ReadResponse?RESULT=0&AUTHCODE=10001&RESPMSG=APROVED&PNREF=12345 produces <Fault xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/none"> - <Code>   <Value>Sender</Value> - <Subcode>   <Value xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:DestinationUnreachable</Value>   </Subcode>   </Code> - <Reason>   <Text xml:lang="en-US">The message with To 'http://localhost:9409/PPInfo.svc/ReadResponse?RESULT=0&AUTHCODE=10001&RESPMSG=APROVED&PNREF=12345' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.</Text>   </Reason>   </Fault> // web.config  <system.serviceModel>     <behaviors>       <servic

Link to .xls but need to pass parameters

 Hi All, I have a page containing a link to to MS Excel spreadsheet (I am able to assume that Excel is available as this is an intranet page). All works fine until I want to pass a parameter into the spreadsheet. Normally I would do this with /e but this will not work I am starting Excel through a link. Any ideas how I would pass the parameters into Excel? (also - there may be multiple requests for the spreadsheet at any time with differing parameters!!)   Thanks

Form Action Button to pass parameters through URL and how to fill a NewForm with them

Hi I'm trying to solve a bigger problem we have in babysteps, and I guess after days of searching and trying I simply need to ask for help. The big picture is, that we're trying to put a Form Action Button (via Sharepoint Designer 2007) above a custom DataForm DispForm.aspx which is supposed to navigate to a NewForm.aspx where the Title Field is supposed to be prefilled with a parameter from the DispForm and the user should be able to add information to the item before it is saved. I found several explanations from people on the internet, but nothing really worked. The first babystep would be to get the parameter through the button into the url of the new item.   < input type = "button" value = "Zugriff Beantragen" name = "btnFormAction0" onclick = "javascript: {ddwrt:GenFireServerEvent('__redirect={../Zugriff Beantragen 2/NewForm2.aspx?test={ItemID}')}" />   That's the code for my button. Somebody wrote that should definitely work because SharePoint is able to replace {ItemID} with the actual ID of the item. Well.... it kind of doesn't. What I get as the end of the new URL is exactly "...?test={ItemID}"   I tried with different names for the ID, I added an @ before those ... no change. I read somewhere about javascript.functionName() which should work with all parameters of the item, but

can a Workflow access a stored procedure and pass the parameters from the list data to the stored pr

The reason that I would like to consider this functionailty is because my table architecture is complicated and I do not want to modify my master table to accept all of this data where some of the data should be normalized into sub tables.  Has anyone see evidence of the stored-procedure parm approach?  Is this best accomplished through VS 2010 or can I do it through SPD? Thanks

How to pass parameters from Application Main method to modules.

Hi , We created Prism WPF application.we have to pass some parameters(some information) to modules(they are instantiated by Bootstrapper) from Main method of App.xaml  Thanks in Advance.

How to pass page column value to data view parameters

Hi All, I have a page library with custom column, lets call it "FormCourseId". On that page I have data view which retrieves data from custom list filtered by page column "FormCourseId". In parameter wizard creates the following tag <ParameterBinding Name="ListCourseId" Location="Form(FormCourseId)" DefaultValue=""/> Then I try to use that parameter in XSLT of data view as a filter creteria.  <xsl:param name="CourseId"></xsl:param> It does not work for me. If I change data view parameter source from Form to Query String and pass parameter as url one it works fine. What is wrong with page column parameter binding? May be if FormCourseId column is not presented in form layout as a field(I do not need to show that field in user form of the page) it could not be treated as form parameter?

Passing Parameters to Web Service Method using XML DataSource

I would like to know how to pass parameter values to a web service that I am using as a data source.  I am using the Data Source Type XML.  I have been able to retrieve data back from the web service method that does not require parameters.  But I need to be able to use a web service that requires parameter values.  How do you use the XML data source type with parameters?  I have use information from the article  http://www.codeproject.com/KB/reporting-services/SSRS2005XML.aspx. thanks, Lloyd

Using Wizard To Pass Parameters From Page With No Buttons?

I'll start out by saying that I am kind of new to the Wizard control.  What drew me to it, was the fact I didn't need to pass variables between pages with the traditional methods.  Now I am faced with a situation where I may have to use those methods.On Step 2, I have a handful of LinkButtons that look similar to this... <asp:LinkButton ID="LinkButton113" CssClass="ListingItem" OnClick="boxChanger" runat="server" Text="Tree Services">Tree Services</asp:LinkButton> The sub boxChanger is this... Sub boxChanger(ByVal sender As Object, ByVal e As System.EventArgs) Dim s As LinkButton = CType(sender, LinkButton) Dim hd1 As HiddenField hd1 = CType(TemplatedWizardStep2.ContentTemplateContainer.FindControl("hdLinkItem"), HiddenField) hd1.Value = s.Text Wizard1.ActiveStepIndex = 2 End Sub I figured I could hide the item in a hidden field control before transfering over to the next page by changing the activestepindex.  That's not the case.  The first trip through the steps, I never retrieve the value in Step 3 from the hiddenfield.  However, if I called boxChanger to get to Step 3, use the previous button (buttons are visible on Step 3) to change index back to Step 2, then c

How to pass two parameters

This works great for 1 parameter SqlDataSource1.SelectParameters("City").DefaultValue = Me.Page.Title But I can't figure out how to pass in two parameters in a single statement (See the Select Parameters Below) Two paremeters (City, and Classification) If i set the page title to say "Bismark Charters" Bismark = City & Charters = Classification <SelectParameters> <asp:ControlParameter ControlID="CharterGridView" DefaultValue="" Name="Classification" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="CharterGridView" DefaultValue="" Name="City" PropertyName="SelectedValue" Type="String" /> </SelectParameters>The parent page title is used to populate the "City" Defaultvalue I tried using a new page element: Description="" to populate the "Classification" DefaultValue but Descriptipon is not a member of the page element eventhough it will not cause a runtime error.Anyone have any Ideas how to do this?               </SelectParameters >

How to pass param type List<> to WCF service?

 I have a WCF Method likes this:public bool SaveStudents(List<Student> students) { //save to the database; return true; }[DataContract]public class Student{[DataMember]public string Name{get;set;}public string Major {get;set;}} At html page, i have a form allows create one more than a student at a time and save all student to database.I using jquery ajax call.Now, I don't how to pass data (in json format) so that SaveStudents can parse and understand json object from client and parse it to List<Student>Please help me!!!

How to pass multi-value parameters to DDS (data driven subscription)?

Using RS2005, how should multivalue parameters be stored in a database field so that a data driven subscription can properly read and use them?  I have so far had no luck using syntax of: 1)  parm1, parm2 2)  parm1,parm2 Do single qutoes need to explicitly wrap the values?  Can you please provide an example and a SQL INSERT statement using parm1 and parm2 to demonstrate what to store in the database field?  Thanks!!

How to use external web service interface ?

Hi, I am new to web services. And am developing a web service wrapper to receive SOAP message over HTTP using 3rd party services. I have been provided 2 asmx files which I added as web reference. Now the 3rd party service contains ProcessRequest (XmlRequest As String) As String interface. I also have a test link from the 3rd party site, which is an aspx page which displays all the method names which can be used. How do I use the service interface and how do I access the service methods on the test link?Any help will be appreciated.ThanksSleek

How to pass parameters via a button control

Hi all, I would like to pass a number of parameters via a button, (it must be a button) but I don't know how to do this, could someone please help. I've be grateful for any suggestions    

how do I pass parameters to the linqdatasource selecting event handler? can I pass an IQueryable?



I'm having an issue coming up with an appropriate code design to implement a search page using linq to sql for my DDL. I think the best way for me to explain where I'm at is describing what I've done in the past, before linq. Lets say we have a basic search page with various user input controls for search options... for simplicity, let's say there are two main ways the user can search. 1. a dropdown filled with account numbers. When that drop down is changed and an account number is selected, a gridview needs to be populated with all the records for that account. 2. the second way is a dropdown for choosing what field you want to search, a textbox for entering what you want to search for, and a button to execute that search. In the past, just using straight ado.net I would handle each of these two search options separately within the events of the dropdown list and the button, respectively. In selectedIndexChanged for 1, and in the buttonClick event for 2, I would construct my sqlCommand etc, ultimately returning a dataset or datatable which I would then bind to the gridview. The logic was separated by the two different event handlers. Now, fast forward to linq to sql and I have a similar page layout, but I am using the linqdatasource selecting event to build my where conditions... now the difference is *everything*, all the logic, is now in this

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend