dynamic web reference for use in SSRS - web-services

To use the web service that is part of an SSRS installation, it seems that you need to add a web reference to your project so that you can call it etc (see one of my previous questions).
But if I needed to call the web service for different SSRS installations then i need to keep adding extra web references. My asp.net application currently displays reports from several different SSRS installations, not just a single server...
Is there a way to either dynamically add the web reference or to dynamically change the server address of where the web service is located?

You don't need to add extra web references.
If you select the web reference in Solution Explorer, then look at the Properties grid, you'll see that you can set the URL to be Dynamic. That will take the URL from the app.config or web.config. Simply change the configuration when you change servers.
If you need to do this at runtime, the proxy class for your service has a Url property that you can set.

Related

Best way to deploy a web site alongside an axis2 web service via Tomcat?

I am using Axis2 (1.5.3 currently) and Tomcat (6.0.26 currently) and am running a web service. I would like to also host HTML pages for configuring the web service.
What is the best way to go about this? I assume keeping the same context is key, but perhaps it is not.
My current distribution is located under a folder structure similar to this:
Tomcat/webapps/mycompany
With the actual service code here:
Tomcat/webapps/mycompany/WEB-INF/services/myService
In a browser, I can hit my web service by going to here:
/mycompany/services/myService
I note that I can drop actual HTML files in this path and Tomcat will, indeed serve them up.
For instance, if I put "index.html" under Tomcat/webapps/mycompany, I can navigate to /mycompany/index.html and see my html.
What I want to do is have this HTML be attached to JAR/class files that can interact with the already-existing service class files in the same context as the service. Therefore, I can have the browser configure the web service directly.
Is this possible, and is there a tutorial or something out there that will help me with this? Note that I have been working with Tomcat and Axis2 for a while now for this particular web service, but I have never actually deployed a web application/html using Tomcat before.
Thanks.
First of all what do you mean by a configuring a service. Normally in SOA world services are analogous to interfaces. IMHO you can just change a service, since their are other users that rely on the services you are exposing.
If i want to change a service i would rather introduce a new version of the service after deprecating the existing one.
Are you talking about applying QoS to existing serviecs. Then that makes sense.
Anyway, If you want to have a web-app alongside with axis2 service engine, it is possible. If you look inside the axis2 war file you'll find the web.xml entry to Axis2Servlet. It is this servlet that serves the web services requests.
So, what you need is the Axis2Servlet mapping in your web-app along with your usual servlet-mappings. Number of possible ways to configure your services using web-app files. One options is to use web-services call itself to (with authentication) to configure it.
By "configure a service", take this example:
The service has a set of datasets.
Each dataset exists in a separate database.
The service can manage 0..n datasets.
The service must be configured to know about each dataset.
This is what I'm configuring. I'm not trying to configure Axis itself or redefine the service.
I would like to host the HTML using the same instance of Tomcat that I'm hosting the web service with. It needs to manage sessions, have login capability, an whatnot, and has to be able to configure the web service live.
From what I'm reading, it's probably best to make an interface to the web service that the web application module can call into from a different context.
Is there a better way?

Sharepoint: how to use web services method

I need to use the web services available by adding /_vti_bin/webs.asmx to your site URL. In particular GetAllSubWebCollection.
Sorry if this is a noobish question, I work in a split 2007-front 2010-back environment and do not have access to the server so I have little experience with advanced features.
What do I have to enter into the URL to get this method to work? Am I supposed to create a page to handle the info?
Thanks!
Add a Web Reference (not a Service Reference) in Visual Studio. This service is a SOAP service, so you won't be able to just type a url into your browser to call this method. You'll need to send a SOAP message to the service. .NET handles this for you when you add a web reference. If you're using SP 2010, use the Client Object Model instead.

How can I add a web reference without the web service URL?

Basically, I have a regenerated wrapper code for a web service that I need to use; when I run this, it works perfectly and receives the data from web service.
How can I add an already regenerated code from a .wsdl file to another Visual Studio solution as a web service?
First of all, you should be doing all new web service development (both client and server) using WCF. You should use "Add Service Reference" instead of "Add Web Reference".
In either case, simply give the file system path to the .WSDL file.

Using a Web Service to access data outside MOSS using AD for authentication

So here is the scenario:
I have a MOSS 2007 box and I want my clients to be able to access a SharePoint site via the internet. I am told that I will be using an IPA and AD for authentication. However I have a DB outside of SharePoint that holds various business data and I want to use Web Services to access the data, manipulate it, and send it back to SharePoint via web parts.
The issue is that, from what I understand, I am going to have to authenticate the AD user every time a request to the Web Service happens. Obviously I dont want to do this every time because they have already authenticated to get onto the site, however I do want each call to have some form of security so its not open calls to my db. I do plan on having other applications access this service outside of SharePoint, so I dont want to have to reinstall the service for each application or even again.
Has anyone had to perform this task or something similar or do you have any suggestions on how to do this?
Thank you in advance and happy coding!
Why not just deploy the webservice to Sharepoint using a Sharepoint solution and a Feature.
That way it will be running under the sharepoint app pool and all authentication is done by sp.
Edit:
Seeing that SharePoint should not be in "control" (as stated in the comment), you should create the webservice, and run the application it's under in as using Windows Authentication. IMHO you should create a WCF Service. The, using the information found in this article you make the Service authenticate users against the AD usergroups they are in. see the "Security: Authentication" section of the article.
Then in Visual Studio you create a webpart and add a service reference to the project, pointing to your newly created Service. Have the webpart perform the needed logic (i.e. display data etc.)
Deploy the webpart to SharePoint using a SharePoint solution (.wsp files, created with WSPBuilder). Google for SharePoint + wspbuilder + tutorials. The solution should contain 1 feature to deploy the webpart. WSPBuilder integrates with VS and allows for the creation of WSPBuilde project. add a webpart feature item to the project (it will create the xml (deployment related) and code file for the webpart.

Is there an equivalent to the SPWeb.Properties in the SharePoint web services?

Our project has a site template that manages custom properties using SPWeb.Properties. However I need to be able to change these values through the webservices and I am having trouble finding any methods to even return the custom properties.
Where can I find the equivalent to the SPWeb.Properties collection in the SharePoint web services?
I doubt there is a builtin service doing that. If you have access to the server, it should be trivial to create a service exposing this, though.