Search Results

Search found 26126 results on 1046 pages for 'generic service contract'.

Page 100/1046 | < Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >

  • Call asp.net web service from php

    - by SamB09
    Hi im calling an aps.net web service from a php service. The service searches both databases with a search parameter. Im not sure how to pass a search parameter to the asp.net service. Code is below. ( there is no search paramter currently but im just interested in how it would be passed to the asp.net service) $link = mysql_connect($host, $user, $passwd); mysql_select_db($dbName); $query = 'SELECT firstname, surname, phone, location FROM staff ORDER BY surname'; $result = mysql_query($query,$link); // if there is a result if ( mysql_num_rows($result) > 0 ) { // set up a DOM object $xmlDom1 = new DOMDocument(); $xmlDom1->appendChild($xmlDom1->createElement('directory')); $xmlRoot = $xmlDom1->documentElement; // loop over the rows in the result while ( $row = mysql_fetch_row($result) ) { $xmlPerson = $xmlDom1->createElement('staff'); $xmlFname = $xmlDom1->createElement('fname'); $xmlText = $xmlDom1->createTextNode($row[0]); $xmlFname->appendChild($xmlText); $xmlPerson->appendChild($xmlFname); $xmlSname = $xmlDom1->createElement('sname'); $xmlText = $xmlDom1->createTextNode($row[1]); $xmlSname->appendChild($xmlText); $xmlPerson->appendChild($xmlSname); $xmlTel = $xmlDom1->createElement('phone'); $xmlText = $xmlDom1->createTextNode($row[2]); $xmlTel->appendChild($xmlText); $xmlPerson->appendChild($xmlTel); $xmlLoc = $xmlDom1->createElement('loc'); $xmlText = $xmlDom1->createTextNode($row[3]); $xmlLoc->appendChild($xmlText); $xmlPerson->appendChild($xmlLoc); $xmlRoot->appendChild($xmlPerson); } } // // instance a SOAP client to the dotnet web service and read it into a DOM object // (this really should have an exception handler) // $client = new SoapClient('http://stuiis.cms.gre.ac.uk/mk05/dotnet/dataBind01/phoneBook.asmx?WSDL'); $xmlString = $client->getDirectoryDom()->getDirectoryDomResult->any; $xmlDom2 = new DOMDocument(); $xmlDom2->loadXML($xmlString); // merge the second DOM object into the first foreach ( $xmlDom2->documentElement->childNodes as $staffNode ) { $xmlPerson = $xmlDom1->createElement($staffNode->nodeName); foreach ( $staffNode->childNodes as $xmlNode ) { $xmlElement = $xmlDom1->createElement($xmlNode->nodeName); $xmlText = $xmlDom1->createTextNode($xmlNode->nodeValue); $xmlElement->appendChild($xmlText); $xmlPerson->appendChild($xmlElement); } $xmlRoot->appendChild($xmlPerson); } // return result echo $xmlDom

    Read the article

  • How to restrict access to my web service?

    - by Hank
    I have http://example.com/index.html, which from within the HTML uses JavaScript to call a web services at http://example.com/json/?a=...&b=... The web service returns to index.html a JSON array of information to then be displayed on index.html. Since anyone can view the source code for index.html and see how I'm calling the JSON web services (http://example.com/json/), how do I prevent people from calling my JSON web service directly? Since the web service is essentially an open read into my database, I don't want people to abuse the web service and start DoS my server, fetching more information than they should, etc..

    Read the article

  • Custom Classes Passed from Service to a UI threads via AIDL

    - by Honza Pokorny
    I have a service that regularly queries a web server for new messages. The service stores the new messages in an arrayList. These messages are implemented using a custom class, storing all kinds of metadata (strings and longs). An activity then connects to this service to retrieve those messages and display them to the user. I have an .aidl file that describes the interface that the service exposes. package com.example.package; interface MyInterface { List<Message> getMessages(); } The Message class extends the Parcelable class which should allow for the IPC transfer. The problem is this: Eclipse gives me an error saying that the type of List<Message> is unknown. Any imports are marked as invalid. Ideas? Thanks

    Read the article

  • Multi-site WCF Service

    - by vault
    I have implemented a WCF service that will be used at Site A with 5 computers in the LAN accessing the service. What I would like to do is have an elevated user/administrator be able to use one of the 5 machines and query an identical service at Site B (also with 5 computers) that they will need to connect to by bypassing the LAN firewall.Accessing data from Site A to Site B (and vica-versa) need only be read-only Is there a standardised way to acheive this using WCF?

    Read the article

  • How to deploy RESTful Web Service onto IIS

    - by Chris Lee
    Hi all, I'm new to .Net and IIS. I've created a simple RESTful Web Service in VS2008 and .net 3.5 framework using WCF. I've tested it well with F5 debugging in VS(seems it is auto deployed on Windows Service). Now I want to deploy it on my IIS server so that I can use it remotely. But I cannot find any guide for this. I manually deployed my service folder just as an ASP.net site. But seems it does not work(keep showing 401 error). Can anyone tell me how to deploy it to IIS? It contains a simple GET method and I hope it can be accessed by anomynous clients (because the host IP is 192.168..). I have a web.config file, a .dll and .pdb under /bin folder, a Global.asax and .svc file for my service. The IIS server is on the same machine. Thanks a million.

    Read the article

  • Access remote service in different application

    - by Sebi
    Hi I defined a remote service over a AIDL file. Now i want to access this service in a different application. But how can I do that? The AIDL file is not accessible in my second application, and if i just copy the AIDL file, then the service can^^t be found. Any hints for that problem?? Thanks Sebi

    Read the article

  • generated service mock: everything but RhinoMocks fails?

    - by hko
    I have the "quest" to search for the next Mocking Framework for my company, and basically it's down to NSubstitute (simplest syntax, but no strict mocks), FakeItEasy(best reviews, Roy Osherove bonus, and slightly better lib support than NSubstitute), Moq (best "other libs support", biggest featureset, downside: mock.Object). We definitely want to move on from RhinoMocks, e.g. because of the unusefull interactiontest error messages (it should tell me what the parameter was instead, when a verification fails). So I was pretty surprised the other day (that was yesterday) when I found out RhinoMocks could do a thing where every other mock framework fails at: Mocking an autogenerated SomethingService (a typical VS autogenerated service with a default construtor in a partial class). Please don't argue about the design.. I intend to write lightweight integration tests (and some unit tests), and I can't mess around with the service, the product is installed on too many customers system. See this code: // here the NSubstitute and FakeItEasy equivalents throw an exception.. see below TicketStoreService fakeTicketStoreService = MockRepository.GenerateMock<TicketStoreService>(); fakeTicketStoreService.Expect(service => service.DoSomething(Arg.Is(new Guid())).Return(new Guid()); fakeTicketStoreService.DoSomething(Arg.Is(new Guid())); fakeTicketStoreService.VerifyAllExpectations(); Note that DoSomething is a non-virtual methodcall in an autogenerated class. So it shouldn't work, according to common knowledge. But it does. Problem is that it's the only (non commercial) framework that can do this: Rhino.Mocks works, and verification works too FakeItEasy says it doesn't find a default constructor (probably just wrong exception message): No default constructor was found on the type SomeNamespace.TicketStoreService Moq gives something sane and understandable: Invalid setup on a non-virtual (overridable in VB) member: service=> service.DoSomething Nsubstitute gives a message System.NotSupportedException: Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface. I'm really wondering what's going on here with the frameworks, except Moq. The "fancy new" frameworks seem to have an initial perf hit too, probably preparing some Type cache and serializing stuff, whilst RhinoMocks somehow manages to create a very "slim" mock without recursion. I have to admit I didn't like RhinoMocks very well, but here it shines.. unfortunately. So, is there a way to get that to work with newer (non-commercial!) mocking frameworks, or somehow get a sane error message out of Rhino.Mocks? And why can Rhino.Mocks achieve this, when clearly every Mocking framework states it can only work with virtual methods when given a concrete class? Let's not derail the discussion by talking about alternative approaches like Extract&Override or runtime-proxy Mocking frameworks like JustMock/TypeMock/Moles or the new Fakes framework, I know these, but that would be less ideal solutions, for reasons beyond this topic. Any help appreciated..

    Read the article

  • applicaion and local service lifetime

    - by rayman
    As i understoond, if we have local service of some application, as soon as the application goes down, the service goes down as well - is that true? and if it is, how can we make an application to run all the time without go down? (without using Alarm manager). i though that the purpose of local service is to answer this situation: " to make the application everlasting" please, if some1 could explain me this better, thanks, ray.

    Read the article

  • Free (as in beer) Reverse Image Search API/Library/Service

    - by Bauer
    TinEye provides a great way to "reverse" search by image (i.e. upload/transload an image and have multiple possible sources of that image returned as results.) Since screen-scraping is messy and unreliable, I'm looking for a free API/library/web-service that could offer the same (or similar) reverse-image search function. At present, TinEye offers a commercial API, but since I'll only be using the service for small personal projects, it's hard to justify the cost of the service (the lowest being 1,000 searches for $70 USD). Is anyone aware of such a free service? Or is there a simpler way to approach this (programmatic solution; any language)? I understand that this is a tall order, and submitting the question is really only a last resort in the hope that there is some solution. Example image search is 99designs' StackOverflow logo competition entry by wolv

    Read the article

  • WCF service is not responding

    - by Costa
    Hi A Flash program is connecting to WCF web service hosted on a server without anti-virus and without firewall and windows server 2003 64 bit environment. The flash return Connection failed message When I sniffer it I found that the Flash program cannot find these requests, http://IP:2805/BLL.svc?xsd=xsd1 http://IP:2805/BLL.svc?xsd=xsd0 The strange thing is that the service work fine with asp.net. also the same service deployed on another server, just work fine!! Is there a work around. Thanks

    Read the article

  • iphone send send dataset to .net web service

    - by rocky
    I got a .net web service with dataset as one of the intake parameter. e.g. int HellowWorld(dataset ds) {} After this web service being invoked, it will start processing and return status (success or fail) after the process finished. My question is, how iphone application can build a dataset and attach it as a parameter for sending to the web service?

    Read the article

  • Accessing FacesContext from Web Service

    - by scriptmonster
    I'm developing a Web Service which will be called by clients which are written by me. In the web service I need to use application-wide objects which eases the load of application on the system. I have implemented my application-wide objects as shown in this question. I can use my object in a jsf page with no problem as follows. MyObject mo = (MyObject) FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get("MyObjectsName"); But when it comes to use it in a Web Service Request FacesContext.getCurrentInstance() returns null. Is there any way to use the FacesContext in a web service.

    Read the article

  • .NET Web Service hydrate custom class

    - by row1
    I am consuming an external C# Web Service method which returns a simple calculation result object like this: [Serializable] public class CalculationResult { public string Name { get; set; } public string Unit { get; set; } public decimal? Value { get; set; } } When I add a Web Reference to this service in my ASP .NET project Visual Studio is kind enough to generate a matching class so I can easily consume and work with it. I am using Castle Windsor and I may want to plug in other method of getting a calculation result object, so I want a common class CalculationResult (or ICalculationResult) in my solution which all my objects can work with, this will always match the object returned from the external Web Service 1:1. Is there anyway I can tell my Web Service client to hydrate a particular class instead of its generated one? I would rather not do it manually: foreach(var fromService in calcuationResultsFromService) { ICalculationResult calculationResult = new CalculationResult() { Name = fromService.Name }; yield return calculationResult; } Edit: I am happy to use a Service Reference type instead of the older Web Reference.

    Read the article

  • How to cancel a web service call if it's not responding

    - by drizzle
    Hi, I have a web page (.aspx) that calls a third party web service to get some data. It usually takes couple of seconds to get the response back, and then the rest of the page will load. Occasionally the call gets stuck either due to the web service is down, or internet connection, etc., the page just hang there and will not load. My questions is: 1) Is there a way to abort/cancel the web service call after a set amount of time? 2) Is it even possible to verify the status of the web service before calling it? Thanks.

    Read the article

  • WCF Service doesnt run on IIS!

    - by Jayesh
    Hi, I have a WCF service hosted at local IIS. I created a ASP.NET website that consumes this service hosted at IIS. While running it from Visual Studio WebDev Server, everything works fine, but as soon as i run the same website [after hosting in IIS] from the browser, the website doesnt seem to be communicating with the Service! The same setup when runs from Visual Studio WebDev Server, doesnt function from IIS! Any know isues? Please help! Thanks

    Read the article

  • Timer in a Windows service - not really working?

    - by marc_s
    I have a Windows NT Service in C# which basically wakes up every x seconds, checks to see if any mail notifications need to be sent out, and then goes back to sleep. It looks something like this (the Timer class is from the System.Threading namespace): public partial class MyService : ServiceBase { private Timer _timer; private int _timeIntervalBetweenRuns = 10000; public MyService() { InitializeComponent(); } protected override void OnStart(string[] args) { // when NT Service starts - create timer to wake up every 10 seconds _timer = new Timer(OnTimer, null, _timeIntervalBetweenRuns, Timeout.Infinite); } protected override void OnStop() { // on stop - stop timer by freeing it _timer = null; } private void OnTimer(object state) { // when the timer fires, e.g. when 10 seconds are over // stop the timer from firing again by freeing it _timer = null; // check for mail and sent out notifications, if required - works just fine MailHandler handler = new MailHandler(); handler.CheckAndSendMail(); // once done, re-enable the timer by creating it from scratch _timer = new Timer(OnTimer, null, _timeIntervalBetweenRuns, _timeIntervalBetweenRuns); } } Sending the mail and all works just fine, and the service also wakes up every 10 seconds (in reality, this is a setting from a config file - simplified for this example). However, at times, the service seems to wake up too quickly.... 2010-04-09 22:50:16.390 2010-04-09 22:50:26.460 2010-04-09 22:50:36.483 2010-04-09 22:50:46.500 2010-04-09 22:50:46.537 ** why again after just 37 milliseconds...... ?? 2010-04-09 22:50:56.507 Works fine to 22:50:45.500 - why does it log another entry just 37 milliseconds later?? Here, it seems it's totally out of whack.... seems to wake up twice or even three times every time 10 seconds are over.... 2010-04-09 22:51:16.527 2010-04-09 22:51:26.537 2010-04-09 22:51:26.537 2010-04-09 22:51:36.543 2010-04-09 22:51:36.543 2010-04-09 22:51:46.553 2010-04-09 22:51:46.553 2010-04-09 22:51:56.577 2010-04-09 22:51:56.577 2010-04-09 22:52:06.590 2010-04-09 22:52:06.590 2010-04-09 22:52:06.600 2010-04-09 22:52:06.600 Any ideas why?? It's not a huge problem, but I'm concerned it might start to put too much load on the server, if the interval I configure (10 seconds, 30 seconds - whatever) seems to be ignored more and more, the longer the service runs. Have I missed something very fundamental in my service code?? Am I ending up with multiple timers, or something?? I can't seem to really figure it out..... have I picked the wrong timer (System.Threading.Timer) ? There's at least 3 Timer classes in .NET - why?? :-)

    Read the article

  • How to configure WCF Service with Https WindowsAuthentication?

    - by Melania
    I am trying to figure it out how to set configurations on my service and Silverlight client App to work on Secure Windows Authentication. I have my service configured like this: <binding name="currentCustomBinding"> <binaryMessageEncoding /> <httpsTransport authenticationScheme="Ntlm" bypassProxyOnLocal="true" /> </binding> </customBinding> <serviceMetadata httpGetEnabled="False" httpsGetEnabled="True" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> <service name=" OperationService" behaviorConfiguration=" OperationServiceBehavior"> <endpoint address="" behaviorConfiguration=" OperationServiceBehavior" binding="customBinding" bindingConfiguration="currentCustomBinding" contract="OperationService" /> </service> Any ideas? 10q

    Read the article

  • How can I verify if a Windows Service is running

    - by edosoft
    Hi, I have an application in C# (2.0 running in XP embedded) that is using a watchdog that is implemented as a Windows Service. When the device boots, this service typically takes some time to start. I'd like to check, from my code, if the service is running. How can I accomplish this?

    Read the article

  • AppData\Roaming folder in windows service project

    - by vikash
    I need a help on getting Special folder in windows service program. I used this code in my Windows Form application: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); and got the path, ""C:\Users\\AppData\Roaming"* But if I run the same code in my Winows Service project I got the path: "C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\" But I need the earlier path (got in Windows Form). How do I get the same path in Service projet also. I have user setting file, log, config file in the "C:\Users\\AppData\Roaming" folder. So I have to refer the same path both in my Windows Form application and Windows Service project. Can somebody tell me, what is the difference here and how do i get the same path in both type of project? Thanks, sharath

    Read the article

  • WCF service reference namespace differs from original

    - by Thorarin
    I'm having a problem regarding namespaces used by my service references. I have a number of WCF services, say with the namespace MyCompany.Services.MyProduct (the actual namespaces are longer). As part of the product, I'm also providing a sample C# .NET website. This web application uses the namespace MyCompany.MyProduct. During initial development, the service was added as a project reference to the website and uses directly. I used a factory pattern that returns an object instance that implements MyCompany.Services.MyProduct.IMyService. So far, so good. Now I want to change this to use an actual service reference. After adding the reference and typing MyCompany.Services.MyProduct in the namespace textbox, it generates classes in the namespace MyCompany.MyProduct.MyCompany.Services.MyProduct. BAD! I don't want to have to change using directives in several places just because I'm using a proxy class. So I tried prepending the namespace with global::, but that is not accepted. Note that I hadn't even deleted the original assembly references yet, and "reuse types" is enabled, but no reusing was done, apparently. However, I don't want to keep the assembly references around in my sample website for it to work anyway. The only solution I've come up with so far is setting the default namespace for my web application to MyCompany (because it cannot be empty), and adding the service reference as Services.MyProduct. Suppose that a customer wants to use my sample website as a starting point, and they change the default namespace to OtherCompany.Whatever, this will obviously break my workaround. Is there a good solution to this problem? To summarize: I want to generate a service reference proxy in the original namespace, without referencing the assembly. Note: I have seen this question, but there was no solution provided that is acceptable for my use case. Edit: As John Saunders suggested, I've submitted some feedback to Microsoft about this: Feedback item @ Microsoft Connect

    Read the article

< Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >