HI AMila,
Thanks for the reply.
I did some more investigation and was able to get to the root cause for one
of the issues which I was facing namely the "Unexpected namespace URI". As
suggested by you I did try generating the code without using the Helper
option. The getOMElement method which was generated was very different from
the one generated by the Helper option. When I say different, it means that it
had a lot of conditional checks for null and was using the
xmlWriter.writeStartElement API with three parameters i.e. prefix, namespace
and localpart. However the Helper code "getOMElement" generated using the
helper option was using the overloaded method of XMLSTreamWRiter i.e.
xmlWriter.writeStartElement(namespace, localPart). On futher changing this
function call to three parameters in case of the helper option I was able to
do away with the exception. Hence I conclude that the Helper option code
generation of AXIS 2 would need some revisiting.
Initially I was of the opinion that the code generator would be using the
same logic for generating the code with/without the helper option. However on
looking into the AXIS 2 code I observed that it was not the case. AXIS 2 uses
XSL for code generation and this XSL has a conditional statement at the top
level which checks if the code is to be generated using the Helper option or
without the Helper option. What I fail to understand is why is this
conditional processing required in the XSL. We can have the same in the code
generator java class wherein, depending upon if the helper option is enabled
or not we can open a new FileWriter object to write to a different Helper
class or use the same Bean for writing the Helper methods as well. Just a
thought.
My plan is to code another XSL and configure the same in the
axis2-adb-codegen-1.1.jar file.
Please let me know if you have any better options.
Regarding the second issue I am not able to understand what you mean when u
say that we can have cyclic reference to classes but not objects. Can you
please elaborate. Also is there a way we can tune the Helper class which is
having the de-serialization logic to overcome the same?
Thanks,
Nilesh
Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
On 1/10/07, Nilesh Ghorpade <[EMAIL PROTECTED]> wrote: Hi Gurus,
I have two issues.
1. When using AXIS 2 with ADB I get "Unexpected namespaceURI " exception. I
am not sure why the error should arise as it is coming from one of the AXIS
generated classes namely Helper class. This exception is encountered while
writting the start element of the response.
Can you send your wsdl? What are the parameters you used to generate the code?
Can you try without the helper mode?
2. Is cyclic references allowed in AXIS 2? For example I have the following
classes
class A{
B objB;
}
class B{
//Here I am having an array of the Objects A.
A[] objA;
}
yes, But when creating Object instances you can't have same object A inside
its Object B array. On the other hand there can be a cyclic dependency at
class level. But not in Object level.
Thanks in advance.
Nile
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
Amila Suriarachchi,
WSO2 Inc.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com