|
|
No one is going to look at this mess of unformatted garbage.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Did you bother to preview this before you posted it, or read it afterwards? I assume not as it is unreadable. Please edit the content and place between <pre></pre> tags using the "code block" button at the top of the edit window.
MVP 2010 - are they mad?
|
|
|
|
|
Hi
I want to implement a webservice with soap and C#
But i am wondering about to change tag as soapenv
How can this be possible?
|
|
|
|
|
Hi,
I'm not sure if I understood your problem. You want to implement a webservice with C#.
For the first steps have a look here:
Your first C# Web Service[^]
Or if you want to use WCF take a look here:
Writing your first WCF Service[^]
SOAP is just the protocol used to call a webservice. Fortunately this protocol is transparent for you, since the .NET framework manages everything for you (serialization, deserialization, transport etc.)
Regards
Sebastian
|
|
|
|
|
How is it possible to import a COM dll from any flavor of unix.
On C++ on windows we can use the #import command to achieve this.
Does the same command help on any unix flavor.
The intent is to use the parsing functionality of msxml [parser.
|
|
|
|
|
AFAIK, Unix doesn't have the necessary COM infrastructure to let you use COM. So, you're out of luck.
However...there are a lot of other XML parsers out there - I'd suggest looking at libxml2[^], expat[^] or Xerces-C++[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Please let me know your comments in below:-
1) Xerces: we need a separate platform/architecture specific binary. This is provided by Xerces.
2) libxml2- Can this be used on unix. I guess its usage is limited to windows.
3) xmllite is another one- One needs to leverage COM technology as interfaces are provided for XML related functions.
4) msxml works on similar way as that in 3)
The requirement is to read a simple xml document in an application.
This application would hold the XML DOM if created in memory in static area as the string that holds the static XML string would be static.
|
|
|
|
|
Xerces and libxml2 are both avaiable Windows OR Unix. Xerces is part of the Apache project, libxml2 part of Gnome (I think).
Neither msxml nor XML Lite are available on Unix.
Another cross-platform alternative - RapidXML[^].
I would go for RapidXML, I think.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
I have heard that parsers that support XPATH give the best performance and should be used if applications from scratch are used.
IS RapidXML XPATH suppotive?
If no, let me know your comments?
|
|
|
|
|
Ummm - well, what are you trying to do with it? XPath is useful for querying an XML document, but does nothing for the performance of the raw parser.
Think about how you're going to get information in and out of the XML file, then make your technology decisions based on those specific requirements.Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Hi
Working with ArcGIS catalog for map files you can create an XML file which contains info about the map.My intention is to gather this data in a DB (PostGreSQL) and create a searching system.The main thing is that searching for the info I want to get as a result the map corresponding to this XML data I searched.Anybody have any clues and give me any orientation because I have little experience with XML.
Thank you in advance
Best regards
Endri
|
|
|
|
|
Maybe [this] XLINQ(LINQ to xml) tutorial will help you get the data from the XML file.
|
|
|
|
|
Rather than use a database (which might well not be a good match for hierarchical XML data), you could consider using XQuery[^]?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
I am getting the data in xml file(microsoft office xml) . data is updating in xml file continously
I parsed the xml file to get the data display in my own gui . I get the data but problem is that
data is not updating . I see the different data in xml file and my gui. as I click save button of xml file
my gui get updated data. why it is happening . can I read the updated data without clicking the save button
note that xml file is microsoft office xml
Trioum
|
|
|
|
|
Hi There
I am new to XML and related technologies.
I would like to know if it is possible to store media files within an XML file?
From what I know, most data stored within an XML file is textural based.
If one converts a database file, Excel sheet, etc. into an XML file, it simply stores this data in a textural format.
Does this mean that if I store an image (for example) within the XML file, it stores it as the textural representation of that image, or as a link to that image? Or is there a way of storing it within the XML file? (also, does the same apply to video, audio - mp3, midi, wav, etc, and all other media files)
Thanks in advance
|
|
|
|
|
Hi,
it is possible to store media files within an XML file. As you already mentioned the textual representation of the file will be stored. A media file is a binary representation of the media itself. This binary representation can be stored on a sheet of paper, a database or an XML file. I suggest that you convert the binary representation of the file into a base64 encoded string (use Convert.ToBase64String) and place that string in an XML element.
Let me know if you need further details.
Regards
Sebastian
|
|
|
|
|
Thanks for the advice...much appreciated.
I found a program that can convert an image to base64 string, and I can then embed this within the XML file.
I tried programming this myself in order to be able to convert files of any media format (images, audio, video, etc.)
I am kinda stuck trying to use the Convert.ToBase64String. I am trying to get an array of bytes from the image file to put in as a parameter for the Convert method.
The only array I can get from the image in the form of 'Guid' type.
Is the any other way of converting an image (and other files) to base64 string format?
|
|
|
|
|
|
Hi Again
I managed to get it working...both the conversion to XML and back to it's original file.
Thanks for the help...much appreciated!
|
|
|
|
|
I am writing a program that will be processing XML files. There are roughly 5 schemas involved. I should tell you now that I'm not using C# but a language called ABAP (SAP), although I think that's largely irrelevant.
The pseudocode for how this works is as follows:
OPEN FILE file AS TEXT.<br />
<br />
WHILE NOT EOF<br />
<br />
APPEND LINE OF file INTO xml_string.<br />
<br />
END.<br />
<br />
CALL TRANSFORMATION my_transformation USING xml_string INTO my_table.
Originally, there was just one schema and one transformation (a transformation is a small program in SAP that is used to take the XML string and turn it into something called an "internal table" - think of it as a DataTable for you C# developers).
Now that we've got different schemas, however, I need a way to know which one to call based upon the type of file. I've thought of two ways but if someone else has a better idea I'd love to know!
1) Use something in the filename to indicate the type of schema
2) Use an attribute in the root element to indicate the file type:
<envelope ftype='terminations'>
...
</envelope>
Unfortunately, with this approach I'd have to parse the first line of the file manually in my program as ABAP doesn't natively handle XML files very easily so it would be less work to do that. So, I'm leaning that way but I wanted a second opinion.
Thanks in advance.
|
|
|
|
|
Ummm - there are various ways of inidicating the schema in use - usually use of different namespaces, on eper schema. The namespace declaration attribute is generally on the root node of the document.
Alternatively, there is a specific namespace and set of attributes[^] that can be used to show what schema is in use.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Hi,
Apologies if this in the wrong place but its the first time I've posted.
I've got a problem using the .net XMLSerializer object. My experience of this is limited and I haven't worked with XML much. I'm trying to something like the following:
<Record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Property1>blah</Property1>
<oai_dc:dc xmlns:oai_dc=http:
<dc:Property2>asdsd</dc:Property2>
<dc:Property3>asdasasdda</dc:Property3>
</oai_dc:dc>
</Record>
however the best I can get at the moment is
<Record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<Property1>blah</Property1>
<oai_dc:dc>
<dc:Property2>asdsd</dc:Property2>
<dc:Property3>asdasasdda</dc:Property3>
</oai_dc:dc>
</Record>
The namespaces are being declared in the root element, not on the dc element as I would like.
I'm attaching the XMLSerializerNamespaces as follows:
Dim XMLNamespaces As New XmlSerializerNamespaces()
XMLNamespaces.Add("oai_dc", "http://www.openarchives.org/OAI/2.0/oai_dc/")
XMLNamespaces.Add("dc", "http://purl.org/dc/elements/1.1/")
XMLNamespaces.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance")
XMLSerializer.Serialize(XMLWriter, inputObject, XMLNamespaces)
and the objects I'm using are shown below:
<XmlRoot("Record")> _
Public Class Record
<XmlElement("Property1")> _
Public Property1 As String
<XmlElement("dc", Namespace:="http://www.openarchives.org/OAI/2.0/oai_dc/")> _
Public DCMetadata As DublinCore
Public Sub New()
DCMetadata = New DublinCore()
End Sub
End Class
<XmlRoot("dc", Namespace:="http://www.openarchives.org/OAI/2.0/oai_dc/")> _
Public Class DublinCore
<XmlElement("Property2", Namespace:="http://purl.org/dc/elements/1.1/")> _
Public Property2 As String
<XmlElement("Property3", Namespace:="http://purl.org/dc/elements/1.1/")> _
Public Property3 As String
Public Sub New()
End Sub
End Class
Is there any way to force the XMLSerializer to output the namespace declarations against an element further down the line?
Thanks for any input,
Andy
modified on Wednesday, January 27, 2010 9:17 AM
|
|
|
|
|
Hi,
this might not the answer you expected, but what is wrong with the namespaces declared within the root element? Both xml are correct, and express the same.
Regards
Sebastian
|
|
|
|
|
Thanks for that, my limited knowledge of XML is the problem here. I have found a way to render the XML as I had intended though. This might be useful to someone else at some point...
Declare an XmlSerializerNamespaces object within the class to be serialized.
<XmlNamespaceDeclarations()> _
Public xmlns As XmlSerializerNamespaces
Then add the namespaces to this collection instead of attaching it to the serializer directly. This has the desired effect of declaring the namespace where it is used.
xmlns = New XmlSerializerNamespaces()
xmlns.Add("oai_dc", "http://www.openarchives.org/OAI/2.0/oai_dc/")
xmlns.Add("dc", "http://purl.org/dc/elements/1.1/")
xmlns.Add("xsi", "http://www.w3.org/2001/XMLSchema-instance")
Andrew
|
|
|
|