Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 54095 invoked from network); 20 Sep 2007 09:10:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Sep 2007 09:10:09 -0000 Received: (qmail 75505 invoked by uid 500); 20 Sep 2007 09:09:51 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 75477 invoked by uid 500); 20 Sep 2007 09:09:51 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 75466 invoked by uid 99); 20 Sep 2007 09:09:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2007 02:09:51 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of amilasuriarachchi@gmail.com designates 209.85.146.177 as permitted sender) Received: from [209.85.146.177] (HELO wa-out-1112.google.com) (209.85.146.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2007 09:09:48 +0000 Received: by wa-out-1112.google.com with SMTP id k22so600196waf for ; Thu, 20 Sep 2007 02:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=S28yitcjtmCWdzSiwdjf3mf+b96sZ48Ly1ciFmWR+qA=; b=qD8ta9eBT03YA0BFROZnXLbf2Byu0qq4NvX2NS6DcX2eUKhn22Hfb+Kq3JMH0YkGh5nooWdI48da3iKYbLntdgficjxwBHUd4MW1y+bsaozPRXOjYATYjKzYV3p49s4A2wcPOsei0N3QaOhuyDJUl8mMIHr5+eDxM5EABynPyoE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=I+S7FfnF4GOJkJLHXQvASHiyYk36dZAdXPG5k7FBuAkLmJS2AgZVkccEh468RrF0+GeT+ahC5Lckk3CX92wfhL/t9ufkqYJB51mlI0pFAF1JWnsl9tm6RaFbTt7UBm6l0zvZ/IS5gbX5FhvdLdnKI08vZ4exWhabIrrd0qHXpqA= Received: by 10.115.75.1 with SMTP id c1mr979901wal.1190279367413; Thu, 20 Sep 2007 02:09:27 -0700 (PDT) Received: by 10.141.170.21 with HTTP; Thu, 20 Sep 2007 02:09:27 -0700 (PDT) Message-ID: <60708f4b0709200209q41f2d875oefb9a6b8c9a30423@mail.gmail.com> Date: Thu, 20 Sep 2007 14:39:27 +0530 From: "Amila Suriarachchi" To: axis-user@ws.apache.org Subject: Re: FW: [Axis2] Xml beans databinding with WSDL2java tool improvments. **HTML Content Modified** In-Reply-To: <60708f4b0709192302s472bf286o53381a56b32ba847@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10375_29428718.1190279367407" References: <60708f4b0709192302s472bf286o53381a56b32ba847@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_10375_29428718.1190279367407 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline hi, Xmlbeans save method has an option to remove the xml declarations. i.e org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions(); param.save(mtomxmlStreamWriter.getOutputStream(),xmlOptions.setSaveNoXmlDecl ()); I did this change to xmlbens template and I it worked fine. Please test with a nightly build. Amila. On 9/20/07, Amila Suriarachchi wrote: > > > > On 9/20/07, Youtsey, Sean J CTR NUWC, Code 441 > wrote: > > > > Amila, > > > > Thanks so much for your work on this. It will really help me as I am > > having current AXIS2 XMLBeans issues that are preventing me from using > > AXIS2. > > > > I have one slight issue with the process defined below in Step 3, where > > if I replace XMLBeans generated code with AXIS2 generated code the > > getters/setters defined by schema type go away, so while I can create an > > instance of the type, I am unable to set any of the types specific > > values. > > > > For example...see attached type-OK.txt vs. type-BAD.txt and compare > > interface HandleTrackInfoLiteEvent. > > > > Also, I assume when you say replace generated code, it includes > > resources as well. > > > yes. > > It does seem to work better if I replace Axis2 generated with XMLBeans > > generated. > > > My bad English. This is actually what I mean. Finally there must be > XMLBeans generated classes. > Axis2 Generated classes are dummy classes. > > I can receive incoming messages (which I have not been able > > to do as of yet with AXIS2). But, then I seem to run into the following > > issue (depicted below from logs) when sending messages where XML > > declaration is placed twice in outgoing messages causing issues on > > receiving side of SOAP message. > > > > 2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> " > version='1.0' encoding='UTF-8'?> > xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:wsa="http://www.w3.org/2005/08/addressing">... > > > apenv:Header>" > > 2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> " > version="1.0" encoding="UTF-8"?>[\r][\n]" > > 2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> "<...specific > > type XML...>" > > 2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> "[\r][\n]" > > 2007-09-19 12:21:33,765 DEBUG > > org.apache.axis2.transport.http.SOAPMessageFormatter - end writeTo() > > 2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> "22[\r][\n]" > > 2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> > > "" > > > > > > Is this because I am doing things in the wrong order? Has anyone else > > complained about this issue yet? I do not recall seeing any other > > related postings. I would love to have this resolved, since I am unable > > > > to use AXIS2 (and would love to). > > > Do you get this problem for every request? I'll look into this. > > Can anyone shed any light on this issue? > > > > Thanks in advance for any help, > > Sean > > > > > > -----Original Message----- > > From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com ] > > Sent: Sunday, August 26, 2007 23:34 > > To: axis-user@ws.apache.org; axis-dev@ws.apache.org > > Subject: [Axis2] Xml beans databinding with WSDL2java tool improvments. > > **HTML Content Modified** > > > > hi, > > I added a new option to wsdl2 java. (-Ewdc -- without databinding code) > > When someone put this option with the Xmlbeans data binding then Axis2 > > generates an dummy schema set with only contain top xml elements needed > > to generate other codegen classes. > > Then users can generate the xmlbeans correct code (with resources) using > > the scomp command comes with the xmlbeans distribution. > > eg. scomp test.wsd -d temp -src temp -srconly to generate code for a > > temp folder. > > > > Here is the complete set of steps > > > > 1. generate the code with wsdl2java. give -d xmlbeans -Ewdc as > > arguments. > > 2. generate the code with scomp command --> eg. scomp test.wsd -d temp > > -src temp -srconly 3. replace the xmlbeans generated code with the code > > generated with the > > Axis2 . > > > > After that either deploy service or access client in the normal way. > > > > In addition to this. > > now it uses the OMDataSource in serializing the xmlbeans generated code. > > > > > > org.apache.axiom.om.OMDataSource omDataSource = new > > org.apache.axiom.om.OMDataSource() { > > > > > > public void > > serialize(javax.xml.stream.XMLStreamWriterxmlStreamWriter) > > throws javax.xml.stream.XMLStreamException { > > > > org.apache.axiom.om.impl.MTOMXMLStreamWritermtomxmlStreamWriter = > > ( > > org.apache.axiom.om.impl.MTOMXMLStreamWriter) xmlStreamWriter; > > try { > > > > param.save(mtomxmlStreamWriter.getOutputStream > > ()); > > > > mtomxmlStreamWriter.getOutputStream().flush(); > > } catch (java.io.IOException e) { > > throw new > > javax.xml.stream.XMLStreamException("Problem > > with saving document", e); > > } > > } > > > > public javax.xml.stream.XMLStreamReader getReader() > > throws javax.xml.stream.XMLStreamException { > > return param.newXMLStreamReader(); > > } > > }; > > > > return new > > org.apache.axiom.om.impl.llom.OMSourcedElementImpl(xmlReader.getName(), > > > > org.apache.axiom.om.OMAbstractFactory.getOMFactory > > (), > > omDataSource); > > } > > > > As you can see this improvs the perfornamce and it serialize the > > xmlbeans directly using xmlbeans. > > > > Can people have problems with xmlbeans try out with -Ewdc with a nighly > > build? > > > > > > -- > > Amila Suriarachchi, > > WSO2 Inc. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org > > For additional commands, e-mail: axis-user-help@ws.apache.org > > > > > > > -- > Amila Suriarachchi, > WSO2 Inc. -- Amila Suriarachchi, WSO2 Inc. ------=_Part_10375_29428718.1190279367407 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline hi,
Xmlbeans save method has an option to remove the xml declarations.

i.e
org.apache.xmlbeans.XmlOptions xmlOptions = new org.apache.xmlbeans.XmlOptions();
param.save(mtomxmlStreamWriter.getOutputStream(), xmlOptions.setSaveNoXmlDecl());

I did this change to xmlbens template and I it worked fine.

Please test with a nightly build.

Amila.

On 9/20/07, Amila Suriarachchi <amilasuriarachchi@gmail.com> wrote:


On 9/20/07, Youtsey, Sean J CTR NUWC, Code 441 < sean.youtsey.ctr@navy.mil> wrote:
Amila,

Thanks so much for your work on this.  It will really help me as I am
having current AXIS2 XMLBeans issues that are preventing me from using
AXIS2.

I have one slight issue with the process defined below in Step 3, where
if I replace XMLBeans generated code with AXIS2 generated code the
getters/setters defined by schema type go away, so while I can create an
instance of the type, I am unable to set any of the types specific
values.

For example...see attached type-OK.txt vs. type-BAD.txt and compare
interface HandleTrackInfoLiteEvent.

Also, I assume when you say replace generated code, it includes
resources as well.

yes.

It does seem to work better if I replace Axis2 generated with XMLBeans
generated. 

My bad English. This is actually what I mean.  Finally there must be XMLBeans generated classes.
Axis2 Generated classes are dummy classes.

 I can receive incoming messages (which I have not been able
to do as of yet with AXIS2).  But, then I seem to run into the following
issue (depicted below from logs) when sending messages where XML
declaration is placed twice in outgoing messages causing issues on
receiving side of SOAP message.

2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> "<?xml
version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsa=" http://www.w3.org/2005/08/addressing"><soapenv:Header>...</so
apenv:Header><soapenv:Body>"
2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> "<?xml
version="1.0" encoding="UTF-8"?>[\r][\n]"
2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> "<...specific
type XML...>"
2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> "[\r][\n]"
2007-09-19 12:21:33,765 DEBUG
org.apache.axis2.transport.http.SOAPMessageFormatter - end writeTo()
2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >> "22[\r][\n]"
2007-09-19 12:21:33,765 DEBUG httpclient.wire.content - >>
"</soapenv:Body></soapenv:Envelope>"


Is this because I am doing things in the wrong order?  Has anyone else
complained about this issue yet?  I do not recall seeing any other
related postings.  I would love to have this resolved, since I am unable
to use AXIS2 (and would love to).

Do you get this problem for every request?  I'll look into this.

Can anyone shed any light on this issue?

Thanks in advance for any help,
Sean


-----Original Message-----
From: Amila Suriarachchi [mailto: amilasuriarachchi@gmail.com ]
Sent: Sunday, August 26, 2007 23:34
To: axis-user@ws.apache.org; axis-dev@ws.apache.org
Subject: [Axis2] Xml beans databinding with WSDL2java tool improvments.
**HTML Content Modified**

hi,
I added a new option to wsdl2 java. (-Ewdc  -- without databinding code)
When someone put this option with the Xmlbeans data binding then Axis2
generates an dummy schema set with only contain top xml elements needed
to generate other codegen classes.
Then users can generate the xmlbeans correct code (with resources) using
the scomp command comes with the xmlbeans distribution.
eg. scomp test.wsd -d temp -src temp -srconly to generate code for a
temp folder.

Here is the complete set of steps

1. generate the code with wsdl2java. give -d xmlbeans -Ewdc as
arguments.
2. generate the code with scomp command --> eg. scomp test.wsd -d temp
-src temp -srconly 3. replace the xmlbeans generated code with the code
generated with the
Axis2 .

After that either deploy service or access client in the normal way.

In addition to this.
now it uses the OMDataSource in serializing the xmlbeans generated code.

org.apache.axiom.om.OMDataSource omDataSource = new
org.apache.axiom.om.OMDataSource() {


                    public void
serialize(javax.xml.stream.XMLStreamWriterxmlStreamWriter)
                            throws javax.xml.stream.XMLStreamException {

org.apache.axiom.om.impl.MTOMXMLStreamWritermtomxmlStreamWriter =
                                                        (
org.apache.axiom.om.impl.MTOMXMLStreamWriter) xmlStreamWriter;
                        try {

param.save(mtomxmlStreamWriter.getOutputStream
());

mtomxmlStreamWriter.getOutputStream().flush();
                        } catch (java.io.IOException e) {
                            throw new
javax.xml.stream.XMLStreamException("Problem
with saving document", e);
                        }
                    }

                    public javax.xml.stream.XMLStreamReader getReader()
                            throws javax.xml.stream.XMLStreamException {
                        return param.newXMLStreamReader();
                    }
                };

                return  new
org.apache.axiom.om.impl.llom.OMSourcedElementImpl(xmlReader.getName(),

org.apache.axiom.om.OMAbstractFactory.getOMFactory
(),
                        omDataSource);
            }

As you can see this improvs the perfornamce and it serialize the
xmlbeans directly using xmlbeans.

Can people have problems with xmlbeans try out with -Ewdc with a nighly
build?


--
Amila Suriarachchi,
WSO2 Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org




--
Amila Suriarachchi,
WSO2 Inc.



--
Amila Suriarachchi,
WSO2 Inc. ------=_Part_10375_29428718.1190279367407--