Works great... Thanks for your help on this.  Very much appreciated!
 

-----Original Message-----
From: Amila Suriarachchi [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 20, 2007 2:09
To: [email protected]
Subject: Re: FW: [Axis2] Xml beans databinding with WSDL2java tool
improvments. **HTML Content Modified**

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 <[EMAIL PROTECTED]> wrote:



        On 9/20/07, Youtsey, Sean J CTR NUWC, Code 441 <
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > 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
<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:
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ]
                Sent: Sunday, August 26, 2007 23:34
                To: [email protected]; [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
                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:
[EMAIL PROTECTED]
                For additional commands, e-mail:
[EMAIL PROTECTED] 
                
                




        -- 
        Amila Suriarachchi,
        WSO2 Inc. 




--
Amila Suriarachchi,
WSO2 Inc. 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to