You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Robert Evans <bo...@jhuapl.edu> on 2002/06/03 17:38:51 UTC

Re: How do you pass an XML document between Axis and .Net Client?

This all sounds good, and I have been able to pass XML documents back 
and forth as RPC and Document parameters.  The problem is getting it to 
work with .NET.

1. I haven't found a way to access the Document parameters on the .NET 
side.  If somebody has an example, that would be great.

2. I have tried the XML to string route, and it *should* work, 
unfortunately, I get the following error:

String in is <?xml version="1.0" encoding="utf-16">
<test>
   <name>
     Robert Evans
   </name>
   <time tz="EST">
     12:10
   </time>
</test>
- Exception:
org.xml.sax.SAXException: Fatal Error: URI=null Line=1: Character
conversion error: "Missing byte-order mark" (Line number may be too low).
    at 
org.apache.axis.utils.XMLUtils$ParseErrorHandler.fatalError(XMLUtils.java:472)
    at ....


Note that the String is passed in, but I get this mysterious error on 
the XMLUtils utility.  Source code is below:

	System.out.println("String in is " + string);
	StringBufferInputStream is = new tringBufferInputStream(string);
	Document doc = null;
	doc = XMLUtils.newDocument(is);
	    // if you use parse() you use a string of an ELEMENT as put.
	    // This does not contain the xml declaration that is in most
	    // Documents/files
	    // doc = db.parse( is );
	if (doc == null) {
	    return "HelloWorld6.sayHello() had an error parsing the input";
	}

My problem is that I can't figure out one way to have these two 
platforms (Axis and .Net) pass an XML document!

Bob

Andrew Vardeman wrote:

> I have limited programming experience, and I don't know what sorts of 
> things people are using SOAP for out there.  One thing I wonder 
> (possibly because I just haven't needed to do it yet) is why so many 
> people want to write an RPC client that passes an XML document as a 
> parameter.  What is the advantage of this over document-style 
> messaging?  Are you passing other objects along with the document that 
> you don't want to manually deserialize, or is it just to avoid making a 
> couple DOM calls to extract the document from the SOAP Body?
> 
> Just curious,
> 
> Andrew
> 
> At 05:01 PM 5/30/2002 +0200, you wrote:
> 
>> Bob,
>>
>>  - use the system.xml.xmldocument to create a XMLDocument (DOM) object
>>  - use the loadxml method to load a string into it
>>
>> the precise syntax depends on which .net dialect you use
>>
>> greetings,
>> Gertjan
>>
>>
>> -----Original Message-----
>> From: Robert Evans [mailto:bob@beartoothmountain.com]
>> Sent: donderdag 30 mei 2002 15:06
>> To: axis-user@xml.apache.org
>> Subject: How do you pass an XML document between Axis and .Net Client?
>>
>>
>> Greetings,
>>
>> I have been trying to figure out how to pass an XML document to/from an
>> axis web server from/to a .Net client.
>>
>> As near as I can tell, on the Java side I need to convert the XML
>> document to/from a string (no problem).  The part I can't figure out is
>> how to convert the Xml String to a .Net XML document.
>>
>> I realize this isn't exactly an Axis issue, but I figured this mailing
>> list would have somebody who has done something like this already.
>>
>> Any hints would be appreciated.
>>
>> Bob Evans
> 
> 
> 
> 
> 
>