Thank you sir ... but this is old news, I have tried the diffenent codesnippets back and forth and now the problem isn´t the code. It is the WSE and DIME, and why I can´t make that work. I have uninstalled the WSE and reinstalled it (WSE 2.0) and still it points on WSE 1.0, I get an errormessage when I run it in the Fusion Log "File or assembly name Mirosoft.Web.Services or one of its dependencies, was not found." Do I need to make any changes in a config-file? I have tried changes in both web.config and machine.config, but I can´t get it to work. With the highest regards:) // Daniel
adaoja
Posts
-
Almost desperate, C# into C++, why not work? -
"The WSE must be installed to enable this feature"Hi I wan´t to implement DIME in my managed c++ web service, but after I´ve installed WSE 2.0 and chooses to "Enable this project for Web Service Enhencments" I get the errormessage "The WSE must be installed to enable this feature" Why is that, I have installed, the dll is in the assembly. What is wrong? With highest regards // Daniel
-
Almost desperate, C# into C++, why not work?Sure sir. I´m using WSE 1.0 SP1 on Microsoft.NET framework 1.0 I have installed WSE 2.0, but I don´t get it to work. Here goes. //Create a new DimeAttachment class CString m_sFilepath = Server->MapPath("/.../.../"); CString m_sFilename(inFileName) ; // an incomming string FileStream *fs; try { fs = new FileStream(m_sFilepath + m_sFilename,FileMode::Open,FileAccess::Read); //copy stream to stream unsigned char sbuf __gc[]; sbuf = new unsigned char __gc[fs->Length]; fs->Read(sbuf, 0, sbuf.Length); MemoryStream *ms; ms = new MemoryStream(); //close file fs->Close(); //attach body DimeAttachment* da; da = new DimeAttachment("application/octet-stream", TypeFormatEnum::MediaType, ms); HttpSoapContext *hsc; hsc->get_ResponseContext()->get_Attachments()->Clear(); hsc->get_ResponseContext()->get_Attachments()->Add(da); } I can compile it but not run it, due to "Object not set to an instance" HttpSoapContext->ResponseContext->Attachments->Clear(); HttpSoapContext->ResponseContext->Attachments->Add(attachment); The above doesn´t work either. "Left of -> must point on a class/struct/union/" I have had the thread in ExpertsExchange http://www.experts-exchange.com/Programming/Programming\_Languages/Dot\_Net/Q\_20714751.html#9208316 With the highest regards // Daniel
-
Almost desperate, C# into C++, why not work?Thank you sir As I wrote before, the object is NULL, not very good. But what do I do? Remember that I´m a newbie. With the highest regards :):) Daniel
-
Almost desperate, C# into C++, why not work?Thank you sir I do understand that and when I don´t instantiate the object HttpSoapContext the compiler doesn´t complain. The proble occurs when I try to run/debug the program. Then I get the response "Object not set to an ..." This I found very strange? Is there a bug somewhere? Do I need to make any other adjustment? With the highest regards :) // Daniel
-
Bug in WSE for C++ Web Service?Hi I´ve been trying to use DIME in my Managed C++ Web Service and I can´t get it to work. My question is if there is some bug with WSE 1.0 and 2.0 making it impossible to use it for this kind of web service. The "WSE Settings.." and "WSE 2.0 Settings..." int the Project cannot be enabled without the errormessage "WSE must be installed" Regards // Daniel
-
Almost desperate, C# into C++, why not work?woops! That is true, they both return null. Now I´m even more lost. With the highest regards // Daniel:confused:
-
Almost desperate, C# into C++, why not work?Hi Nemanja I do understand that, but why can´t I run the program? Why do I at that line get a "Object not set to an instance" - error. It doesn´t make any sense to me. With the highest regards // Daniel
-
Almost desperate, C# into C++, why not work?Thank you Nemanja But, the problem is (as i wrote previously) not really that codesnippet but why I can´t make an instance of the HttpSoapContext-object. And why do I have to? In C# there is no need for a HttpSoapContext variable = new HttpSoapContext(); statement. If I use your codesnippet it works for the compiler but not when I run the project (much like when I use pointers like above). I get the error "Object not set to an instance..." and if I try to make an instance the compiler complains with C2512 "No deafult constructor available". This is what confuses me. With the highest regards :):) Daniel
-
create xml file using streamwriterYou can use XmlDocument.CreateElement and .AppendChild to add your information to your document. in c++ given that Child,Name,TopElement all are XmlElements sData is the content, the info in the element; ChildElement = doc->CreateElement("tagname"); TopElement->AppendChild(ChildElement); NameElement = doc->CreateElement("tagname"); NameElement->InnerText = sData; ChildElement->AppendChild(NameElement); .. or something like that I guess you have to check in the button_click function if you already have pressed the button and if not -> create a new xmldokument Regards:) Daniel
-
Almost desperate, C# into C++, why not work?Hello everyone! I hope that I won´t be kicked out for asking the same question again and again until I get it to work. But here goes: I´m developing a managed C++-web Service and my problem occured months ago when I tried to pass binary files as dataset between the client and the service. I then got the advice to use DIME and recently downloaded WSE 1.0 SP1. I read an example in C# and tried to convert the code to c++. But it don´t get it to work. C# DimeAttachment attachment = new DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType, ms); HttpSoapContext.ResponseContext.Attachments.Clear(); HttpSoapContext.ResponseContext.Attachments.Add(attachment); C++ (I´ve tried this, and similar) DimeAttachment* attachment; attachment = new DimeAttachment("application/octet-stream", TypeFormatEnum::MediaType, ms); HttpSoapContext* hsc; hsc->get_ResponseContext()->get_Attachments()->Clear(); hsc->ResponseContext->Attachments->Add(attachment); This will compile, but when I run I get the error "Object not set to an instance.." on the ...->Clear(); row. If I then try to instance the object; HttpSoapContext* phsc = new HttpSoapContext(); or SoapContext* sc = new SoapContext(); i get the error C2512 "no deafult constructor" when I compile. What can be wrong? Are there som arguments missing; Intellisense doesn´t detect any. Are there some error in the config-files? With the very highest regards PS************************************************* Well actually, I also can´t get a C#-version to function. I downloaded Roman Kiss-example "Using WSE-DIME for Remoting over Internet" http://www.codeproject.com/cs/webservices/remotingdime.asp ...allthough I did everything according to the book I kept on getting the error .FileLoadException "The assembly manifest definition [name] does not match the assembly reference". DS**************************************************;);) Daniel
-
Problem with createElement/createNode of IXMLDOMDocumentPtrHi This probably doesn´t help but when I used lstElement->Item(0)->NamespaceURI in creating an xmlElemnt XmlElement *NameElement = doc->CreateElement("Name",lstElement->Item(0)->NamespaceURI); given that doc is an XMLDocument and lstElement is of type XmlNodelist. I got it to work. But again, I assume that there are two different problems. I added elements to an existing XMLDocument. Regards Daniel
-
create xml file using streamwriterHi Isn´t XmlTextWriter a better choice? in VB Dim wrtXMLWriter As New XmlTextWriter("TestFile.xml", Nothing) and use .WriteRaw or any other XmlTextWriter-method that works for your purposes. Regards Daniel
-
Problem with FileLoadExceptionHi I´m trying to install Roman Kiss-WSE-DIME-project at http://www.codeproject.com/cs/webservices/remotingdime.asp But I keep on getting the error "Remoting configuration failed with the exception System.IO.FileLoadException: The located assembly's manifest definition with name 'WSDimeChannel' does not match the assembly reference." when I testdrive the WindowsClient. I have done everything that the instruction says. Including draging the 3 dll to the %windows%/assembly - folder. Running the WebService and trying the echo-method works fine. I may have some errors in the machine.config-file. Can this be of importance (several names with the same ID") Is there something I have forgot when I install the project? What can be wrong? Regards Daniel
-
Reading XML file with VB.NetNow I´m lost, I´ve found an example from MS Imports System Imports System.IO Imports System.Xml public class Sample public shared sub Main() Dim doc as XmlDocument = new XmlDocument() doc.LoadXml("" & _ "1-861001-57-5" & _ "Pride And Prejudice" & _ "") 'Display information on the ISBN element. Dim elem as XmlElement elem = CType(doc.DocumentElement.ChildNodes.Item(0),XmlElement) Console.Write("{0} = {1}", elem.Name, elem.InnerText) Console.WriteLine(" namespaceURI=" + elem.NamespaceURI) end sub end class You can try that one. XmlElement.Name gives the name of the node. :confused: // Daniel
-
"No appropriate constructor available"I guess so, but it has a "C++ definition" since [Visual Basic] NotInheritable Public Class HttpSoapContext [C#] public sealed class HttpSoapContext [C++] public __gc __sealed class HttpSoapContext [JScript] public class HttpSoapContext ... hence it should be supported in c++ also. Is there a problem that the class is sealed? I haven´t had any problem with other conversions from C# into C++ when I have worked with web services. Regards Daniel
-
"No appropriate constructor available"Hi Hmm.. I can´t find the declaration on my computer, is it possible? It´s under the namespace Microsoft.Web.Services imported from the dll with the same name. How do I proceed? // Daniel
-
"No appropriate constructor available"Hi Thank you both for the answer, I have previously tried both with and without the brackets. It´s a sealed class, does that make any difference? I have copied the class declaration in a reply above. Regards Daniel
-
"No appropriate constructor available"Hi Thank you for the answer, the class declaration goes as follows. ******************************* HttpSoapContext Class HttpSoapContext Members | Microsoft.Web.Services Namespace Requirements Namespace: Microsoft.Web.Services Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family Assembly: Microsoft.Web.Services (in Microsoft.Web.Services.dll) Provides access to the SoapContext associated with a SOAP request and SOAP response for XML Web services created using ASP.NET. This class cannot be inherited. For a list of all members of this type, see HttpSoapContext Members. System.Object Microsoft.Web.Services.HttpSoapContext [C++] public __gc __sealed class HttpSoapContext Thread Safety Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe. Remarks The SoapContext provides access to the WS-Security, WS-Routing, and other XML Web services architecture-specific details associated with a SOAP message. Use this class to gain access from within an XML Web service to the the SoapContext associated with a SOAP request through the static members RequestContext and ResponseContext.When an XML Web service method is a one-way method, an XML Web service cannot gain access to the SoapContext using the static members of this class. To gain access to the SoapContext for one-way methods, the class implementing the XML Web service should inherit from System.Web.Services.WebService and add code within the one-way method to get the Context property. Requirements Namespace: Microsoft.Web.Services Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family Assembly: Microsoft.Web.Services (in Microsoft.Web.Services.dll) ******************************** Regards Daniel
-
Reading XML file with VB.NetHi I guess you mean XmlElement.Name ? Regards Daniel