Search Results

Search found 27 results on 2 pages for 'webreference'.

Page 1/2 | 1 2  | Next Page >

  • Update webreference gives troubles with different versions of dll

    - by Natrium
    In my application, I use some dll, let's say library.dll, version 1.0 In my webservice, I also use library.dll, but version 2.0 When I do an update of the webreference, the classes inside of the dll are also generated in the webreference. And this gives troubles because in my application, the classes that are defined in the dll now are also available in the reference and there is a mismatch. How can I solve this? I need to be able to tell the webservice to ignore the dll-code when updating the webreference in the one or the other way. I use Visual Studio 2008.

    Read the article

  • Call Webservice without adding a WebReference - with Complex Types

    - by ck
    I'm using the code at This Site to call a webservice dynamically. [SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)] public static object CallWebService(string webServiceAsmxUrl, string serviceName, string methodName, object[] args) { System.Net.WebClient client = new System.Net.WebClient(); //-Connect To the web service using (System.IO.Stream stream = client.OpenRead(webServiceAsmxUrl + "?wsdl")) { //--Now read the WSDL file describing a service. ServiceDescription description = ServiceDescription.Read(stream); ///// LOAD THE DOM ///////// //--Initialize a service description importer. ServiceDescriptionImporter importer = new ServiceDescriptionImporter(); importer.ProtocolName = "Soap12"; // Use SOAP 1.2. importer.AddServiceDescription(description, null, null); //--Generate a proxy client. importer.Style = ServiceDescriptionImportStyle.Client; //--Generate properties to represent primitive values. importer.CodeGenerationOptions = System.Xml.Serialization.CodeGenerationOptions.GenerateProperties; //--Initialize a Code-DOM tree into which we will import the service. CodeNamespace nmspace = new CodeNamespace(); CodeCompileUnit unit1 = new CodeCompileUnit(); unit1.Namespaces.Add(nmspace); //--Import the service into the Code-DOM tree. This creates proxy code //--that uses the service. ServiceDescriptionImportWarnings warning = importer.Import(nmspace, unit1); if (warning == 0) //--If zero then we are good to go { //--Generate the proxy code CodeDomProvider provider1 = CodeDomProvider.CreateProvider("CSharp"); //--Compile the assembly proxy with the appropriate references string[] assemblyReferences = new string[5] { "System.dll", "System.Web.Services.dll", "System.Web.dll", "System.Xml.dll", "System.Data.dll" }; CompilerParameters parms = new CompilerParameters(assemblyReferences); CompilerResults results = provider1.CompileAssemblyFromDom(parms, unit1); //-Check For Errors if (results.Errors.Count > 0) { StringBuilder sb = new StringBuilder(); foreach (CompilerError oops in results.Errors) { sb.AppendLine("========Compiler error============"); sb.AppendLine(oops.ErrorText); } throw new System.ApplicationException("Compile Error Occured calling webservice. " + sb.ToString()); } //--Finally, Invoke the web service method Type foundType = null; Type[] types = results.CompiledAssembly.GetTypes(); foreach (Type type in types) { if (type.BaseType == typeof(System.Web.Services.Protocols.SoapHttpClientProtocol)) { Console.WriteLine(type.ToString()); foundType = type; } } object wsvcClass = results.CompiledAssembly.CreateInstance(foundType.ToString()); MethodInfo mi = wsvcClass.GetType().GetMethod(methodName); return mi.Invoke(wsvcClass, args); } else { return null; } } } This works fine when I use built in types, but for my own classes, I get this: Event Type: Error Event Source: TDX Queue Service Event Category: None Event ID: 0 Date: 12/04/2010 Time: 12:12:38 User: N/A Computer: TDXRMISDEV01 Description: System.ArgumentException: Object of type 'TDXDataTypes.AgencyOutput' cannot be converted to type 'AgencyOutput'. Server stack trace: at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr) at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at TDXQueueEngine.GenericWebserviceProxy.CallWebService(String webServiceAsmxUrl, String serviceName, String methodName, Object[] args) in C:\CkAdmDev\TDXQueueEngine\TDXQueueEngine\TDXQueueEngine\GenericWebserviceProxy.cs:line 76 at TDXQueueEngine.TDXQueueWebserviceItem.Run() in C:\CkAdmDev\TDXQueueEngine\TDXQueueEngine\TDXQueueEngine\TDXQueueWebserviceItem.cs:line 99 at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase) at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData) at TDXQueueEngine.TDXQueue.RunProcess.EndInvoke(IAsyncResult result) at TDXQueueEngine.TDXQueue.processComplete(IAsyncResult ar) in C:\CkAdmDev\TDXQueueEngine\TDXQueueEngine\TDXQueueEngine\TDXQueue.cs:line 130 For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. The classes reference the same assembly and the same version. Do I need to include my assembly as a reference when building the temporary assembly? If so, how? Thanks.

    Read the article

  • getting base url of web site's root (absolute/relative url)

    - by uzay95
    I want to completely understand how to use relative and absolute url address in static and dynamic files. ~ : / : .. : in a relative URL indicates the parent directory . : refers to the current directory / : always replaces the entire pathname of the base URL // : always replaces everything from the hostname onwards This example is easy when you are working without virtual directory. But i am working on virtual directory. Relative URI Absolute URI about.html http://WebReference.com/html/about.html tutorial1/ http://WebReference.com/html/tutorial1/ tutorial1/2.html http://WebReference.com/html/tutorial1/2.html / http://WebReference.com/ //www.internet.com/ http://www.internet.com/ /experts/ http://WebReference.com/experts/ ../ http://WebReference.com/ ../experts/ http://WebReference.com/experts/ ../../../ http://WebReference.com/ ./ http://WebReference.com/html/ ./about.html http://WebReference.com/html/about.html I want to simulate a site below, like my project which is working on virtual directory. These are my aspx and ascx folder http://hostAddress:port/virtualDirectory/MainSite/ASPX/default.aspx http://hostAddress:port/virtualDirectory/MainSite/ASCX/UserCtrl/login.ascx http://hostAddress:port/virtualDirectory/AdminSite/ASPX/ASCX/default.aspx These are my JS Files(which will be use both with the aspx and ascx files): http://hostAddress:port/virtualDirectory/MainSite/JavascriptFolder/jsFile.js http://hostAddress:port/virtualDirectory/AdminSite/JavascriptFolder/jsFile.js this is my static web page address(I want to show some pictures and run inside some js functions): http://hostAddress:port/virtualDirectory/HTMLFiles/page.html this is my image folder http://hostAddress:port/virtualDirectory/Images/PNG/arrow.png http://hostAddress:port/virtualDirectory/Images/GIF/arrow.png if i want to write and image file's link in my ASPX file i should write aspxImgCtrl.ImageUrl = Server.MapPath("~")+"/Images/GIF/arrow.png"; But if i want to write the path hard coded or from javascript file, what kind of url address it should be?

    Read the article

  • how to exclude a Web Reference from Code Coverage in VS 2008 Team System

    - by Sarah Vessels
    When I run my MSTest tests in Visual Studio 2008 Team System and get code coverage results, I always see a particular web service included. I don't care how well this web service is tested, I'm intentionally only using a small part of it. How can I exclude the Web Reference from showing up in my Code Coverage results? I see that someone asked this very question over on Microsoft Connect and it's marked as postponed, but I was hoping someone knew of a workaround.

    Read the article

  • Integrating FedEx Web Services into .Net, stuck at step 1

    - by Matt Dawdy
    I'm signed up, I've downloaded sample code, I've got a WSDL...and yet I have no idea how to get this stuff into my existing .Net application. The WSDL was in a zip file, not a URL so I can't just "Add Web Reference." I've run the wsdl tool from the .Net command prompt, and it made a nice class for me...yet dropping that into my web_reference folder doesn't give me any kind of instantiatable class. I know I'm missing something stupid. Can someone point me in the right direction please?

    Read the article

  • Webreference vs servicereference. Only one works ? Serialization ?

    - by phenevo
    Hi, I've got two applications. One uses webreference to my webservice, and second use servicereference to my webservice. There is metohod which I'm invoking: [WebMethod] public Car[] GetCars(string carCode) { Cars[] cars= ModelToContract.ToCars(MyFacade.GetCars(carCode); return cars; } Car has two pools: string Code {get;set;} CarType Type {get;set;} public enum CarType { Van=0, Pickup=1 } I'm debuging this webMethod, and... at the end webservice throw good collection of cars, which has one car: code="bmw",Type.Van But... Application with webrefence receives the same collection and application with servicereference gets collection, where field code is null... Invoking servicereference: MyService myService=new MyService() Cars[] cars= client.GetCars(carcode); Invoking webservice: MyService.MyServiceSoapClient client = new MyServiceS.MyServiceSoapClient(); Cars[] cars= client.GetCars(carcode);

    Read the article

  • Webreference vs servicereference. Why ony one works ?

    - by phenevo
    Hi, I've got two applications. One uses webreference to my webservice, and second use servicereference to my webservice. There is metohod which I'm invoking: [WebMethod] public Car[] GetCars(string carCode) { Cars[] cars= ModelToContract.ToCars(MyFacade.GetCars(carCode); return cars; } Car has two pools: string Code {get;set;} CarType Type {get;set;} public enum CarType { Van=0, Pickup=1 } I'm debuging this webMethod, and... at the end webservice throw good collection of cars, which has one car: code="bmw",Type.Van But... Application with webrefence receives the same collection and application with servicereference gets collection, where field code is null... Invoking servicereference: MyService myService=new MyService() Cars[] cars= client.GetCars(carcode); Invoking webservice: MyService.MyServiceSoapClient client = new MyServiceS.MyServiceSoapClient(); Cars[] cars= client.GetCars(carcode);

    Read the article

  • webservice CopyIntoItems is not working to upload file to sharepoint

    - by Joeri
    The following piece of C# is always failing with 1 Unknown Object reference not set to an instance of an object Anybody some idea what i am missing? try { //Copy WebService Settings String strUserName = "abc"; String strPassword = "abc"; String strDomain = "SVR03"; String FileName = "Filename.xls"; WebReference.Copy copyService = new WebReference.Copy(); copyService.Url = "http://192.168.11.253/_vti_bin/copy.asmx"; copyService.Credentials = new NetworkCredential (strUserName, strPassword, strDomain); // Filestream of attachment FileStream MyFile = new FileStream(@"C:\temp\28200.xls", FileMode.Open, FileAccess.Read); // Read the attachment in to a variable byte[] Contents = new byte[MyFile.Length]; MyFile.Read(Contents, 0, (int)MyFile.Length); MyFile.Close(); //Change file name if not exist then create new one String[] destinationUrl = { "http://192.168.11.253/Shared Documents/28200.xls" }; // Setup some SharePoint metadata fields WebReference.FieldInformation fieldInfo = new WebReference.FieldInformation(); WebReference.FieldInformation[] ListFields = { fieldInfo }; //Copy the document from Local to SharePoint WebReference.CopyResult[] result; uint NewListId = copyService.CopyIntoItems (FileName, destinationUrl, ListFields, Contents, out result); if (result.Length < 1) Console.WriteLine("Unable to create a document library item"); else { Console.WriteLine( result.Length ); Console.WriteLine( result[0].ErrorCode ); Console.WriteLine( result[0].ErrorMessage ); Console.WriteLine( result[0].DestinationUrl); } } catch (Exception ex) { Console.WriteLine("Exception: {0}", ex.Message); }

    Read the article

  • Ambiguous reference in Stream

    - by Sharpeye500
    This is the webservice method i have LoadImageFromDB(int ID, ref Stream streamReturnVal) I have this on the top of the section using Stream = System.IO.MemoryStream; Whenever i consume this method(update web reference) from a web application, i get this error 'Stream' is an ambiguous reference between 'System.IO.Stream' and 'WebReference.Stream' Any thoughts? In webservice class using Stream = System.IO.MemoryStream; LoadImageFromDB(int ID, ref Stream streamReturnVal); In web page where above webservice is consumed: using WebReference; Stream streamReturnVal = null; streamReturnVal = new MemoryStream(); WebserviceInstanceName.LoadImageFromDB(100,streamReturnVal ); PS: Stream - is from System.IO.Stream

    Read the article

  • WCF - WebReferences not working

    - by JMSA
    At the client end, I have generated a Proxy using SvcUtil.exe and it is working fine. Then I have added a WebReference to the client assembly and calling the same method. But it is not working. My program is running in console mode and the method is suppose to return a string. It is not returning the string. I just see a blank console window. No exception is thrown. And after setting a debug point on the method call I see that, program is halted on the method call for ever. What should I look for to solve the problem? I am using VS2005. And adding the webReference by right-clicking the client project and then clicking "Add Web Reference" pop-up menu.

    Read the article

  • Using PHP Encryption for Login Authentication

    <b>Webreference:</b> "Following up on "Implementing One-way Encryption in PHP," my previous tutorial about using one-way encryption to build a secure online diary application, this article explores using PHP encryption for login authentication."

    Read the article

  • Implementing One-way Encryption in PHP

    <b>Webreference:</b> "To demonstrate one-way encryption in PHP, this article describes how to start building a secure online diary application. The one-way encryption will allow the diary to log a user in and generally encrypt the contents of the file that it loads."

    Read the article

  • Changing namespace of Stream

    - by phenevo
    Hi, I've got asmx with method [Webmethod] public Ssytem.IO.Stream GetStream(string path) { ... } and winforms application which has webreference to this webservice. I cannot do something on my winforms application like something: var myStream= (System.IO.Stream)client.GetStream(path); because i Cannot cast expression "MyWinformsApp.MyService.Stream" to Stream. Why is that ?

    Read the article

  • Invisible class from WebService in application

    - by phenevo
    I've got webservice which has multiple classess My winforms application see theirs, but not everyone. This application has webreference to this webservice. I think that this application see every class which is used in WebMethod, but I using parent class in WebMethod and I wanna casting it to another class,which is not used at webmethod.

    Read the article

  • How to set HTTP Headers from client class inherited from SoapHttpClientProtocol

    - by Alfred
    I'm using a class MyClass inherited from SoapHttpClientProtocol (auto-generated in my project by creating a WebReference from a .wsdl file, representing a service). Before calling a "WebMethod" of this service, I need to custom the http header of my request. I tried overloading the GetWebRequest() method of SoapHttpClientProtocol that way : public partial class MyClass: System.Web.Services.Protocols.SoapHttpClientProtocol{ protected override WebRequest GetWebRequest(Uri uri) { HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(uri); request.Headers.Add("MyCustomHeader", "MyCustomHeaderValue"); return request; } } I was hoping that GetWebRequest was called in the constructor of MyClass, apparently it's not. Could someone help me ?

    Read the article

  • Calling WebService From Same Project

    - by Yehia A.Salam
    Hi, I'm trying to call an asp.net webservice from the same project it's in: [MethodImpl(MethodImplOptions.Synchronized)] public static void OnFileCreated(object source, FileSystemEventArgs e) { trackdata_analyse rWebAnalyse = new trackdata_analyse(); rWebAnalyse.Analyse(@"pending\" + e.Name, "YOUNIVATE"); } However i always get the following "HttpContext is not available. This class can only be used in the context of an ASP.NET request." when calling Server.MapPath from the webservice: [WebMethod] public int Analyse(string fileName, string PARSING_MODULE){ int nRecords; TrackSession rTrackSession = new TrackSession() ; string filePath = Server.MapPath(@"..\data\") + fileName; do i have to add the WebReference instead, though the webservice is in the same project? Thanks In Advance

    Read the article

  • Client App with WCF to consume ASMX

    - by BDotA
    I have a webservice with .NET 1.1 (old school ASMX) and I am creating a client app to connect to it and use its services. From what I remember from the last time I had used Visual studio -which was 2003 version!- I can add a WebReference to it and easily use it. Tried it . it still works. but it looks like things have changed in 2008 and now we also have WCF. so I can add it as a Service Reference. but with this new method I could not find a way to create an Instance object to the ASMX service and call its methods... how do we accomplish the same thing with WCF?

    Read the article

  • WCF does not generate the properties

    - by BDotA
    I have a .NET 1.1 ASMX and want to use it in a client WinForms app. If i go wit the old way and add it as a "WebRefrence" method then I will have access to two of its properties which are "url" and "UseDefaultCredentials" and it works fine. But if I go with the new WCF way and add it as a ServiceReference I still have access to the methods of that ASMX but those two properties are missing. what is the reason for that? so for example in the old way ( adding WebReference) these codes are valid: TransferService transferService= new TransferService(); transferService.Url = "http://something.asmx"; transferService.Credentials = System.Net.CredentialCache.DefaultCredentials; string[] machines = transferService.GetMachines(); But in the new way ( adding Service Reference ) using(TransferServiceSoapClient transferServiceSoapClient = new TransferServiceSoapClient("TransferServiceSoap")) { transferServiceSoapClient.Url = "someUrl.asmx"; //Cannot resolve URL transferServiceSoapClient.GetMachines(new GetMachinesRequest()); transferServiceSoapClient.Credentials = .... // //Cannot resolve Credentials }

    Read the article

  • Consuming Web Service via Windows Authentication

    - by saravanaram
    I am just trying to consuming a web service in remote computer using windows authentication however login credentials are different in local & remote computer. Code Snippet: Dim objproxy As New WebReference.Service1 'Create a new instance of CredentialCache. Dim mycredentialCache As CredentialCache = New CredentialCache() 'Create a new instance of NetworkCredential using the client Dim credentials As NetworkCredential = New NetworkCredential("username", "pwd","domain") 'Add the NetworkCredential to the CredentialCache. 'mycredentialCache.Add(New Uri(objproxy.Url), "Basic", credentials) objproxy.Credentials = credentials It is timing out but when i use mycredentialCache.Add(New Uri(objproxy.Url), "Basic", credentials) I get "401 Unauthorized" message, Please assist.

    Read the article

  • Change dynamic web reference from web./app.config

    - by Snæbjørn
    I have a problem changing a dynamic web reference in the config file. Changing the url in the config file doesn't have any effect. I have to change the url in .settings and compile for it to change. I added the web reference using the wizard. Set the URL behavior to dynamic, which added the relevant XML tags in config file. In my solution I have the web API (web reference) in a separate project (class lib), so I referenced the project and copied the <applicationSettings> over. <applicationSettings> <StartupProject.Properties.Settings> <setting name="WebReference" serializeAs="String"> <value>http://someurl/somefile.asmx</value> </setting> </StartupProject.Properties.Settings> </applicationSettings> Note that it's <StartupProject.Properties.Settings> and not <WebRefProject.Properties.Settings>. Are there some limitations I'm not aware of or am I doing something wrong?

    Read the article

  • HTML5 tags not working at all in firefox 3.6.3

    - by William
    Okay, so I'm trying to get into this whole HTML 5 thing, and this tutorial (http://www.webreference.com/authoring/languages/html/HTML5/) says that these tags should move the content around without any kind of CSS at all, but all I'm getting is a line of text that looks like this: Header tag Nav tag Artical Section tags Aside tag footer tag Here is the code: <!DOCTYPE html> <html lang="en"> <head> <title>HTML5 test1</title> <meta charset="utf-8" /> </head> <body> <header> Header tag </header> <nav> Nav tag </nav> <article> <section> Artical Section tags </section> </article> <aside> Aside tag </aside> <footer> footer tag </footer> </body> </html>

    Read the article

  • How to make placeholder varablies in jquery validate 1.7?

    - by chobo2
    Hi I am using jquery 1.4.2 and jquery validate 1.7(http://bassistance.de/jquery-plugins/jquery-plugin-validation/) Say I have this example that I just grabbed off some random site(http://www.webreference.com/programming/javascript/jquery/form_validation/) 8 <script type="text/javascript"> 9 $(document).ready(function() { 10 $("#form1").validate({ 11 rules: { 12 name: "required",// simple rule, converted to {required:true} 13 email: {// compound rule 14 required: true, 15 email: true 16 }, 17 url: { 18 url: true 19 }, 20 comment: { 21 required: true 22 } 23 }, 24 messages: { 25 comment: "Please enter a comment." 26 } 27 }); 28 }); 29 </script> now is it possible to do something like this 10 $("#form1").validate({ var NameHolder = "name" 11 rules: { 12 NameHolder: "required",// simple rule, converted to {required:true} 13 email: {// compound rule 14 required: true, 15 email: true So basically I want to make sort of a global variable to hold theses rule names( what correspond to the names on that html control). My concern is the names of html controls can change and it kinda sucks that I will have to go around and change it in many places of my code to make it work again. So basically I am wondering is there away to make a global variable to store this name. So if I need to change the name I only have to change it in one spot in my javascript file sort of the way stopping magic numbers ?

    Read the article

  • Web Reference Code generator template.

    - by Bluephlame
    I Have an internal SOAP Web service that is being called from an external REST service in .NET it works fine however I am simply passing through the SOAP objects of the REST Layer but the automatic generation of the WebReference Code in Visual Studio adds the 'field' to the end of every attribute. basically it makes my XML look all nasty. Everything works I just want to clean up my XML. Any ideas how i can change the template for the reference.cs or to make the XML generate nicely from the Web Service Objects. Here is an example of the reference.cs public int HeadLeft { get { return this.headLeftField; } set { this.headLeftField = value; } } /// <remarks/> public int HeadTop { get { return this.headTopField; } set { this.headTopField = value; } } /// <remarks/> public int HeadWidth { get { return this.headWidthField; } set { this.headWidthField = value; } } Here is an examle of the XML <a:headHeightField>208</a:headHeightField> <a:headLeftField>316</a:headLeftField> <a:headTopField>103</a:headTopField> <a:headWidthField>161</a:headWidthField>

    Read the article

1 2  | Next Page >