[Axis2 0.94] minOccurs=0 issues

2006-03-05 Thread Chuck Williams




Hi Ajith and all,

I ran into another code generation problem. minOccurs=0 elements are
not supported in the 0 case. I.e., for an optional element that is not
present or a zero-length array, the parsing has bugs. The core
serialization in adb also fails to handle this case. For the parsing
(deserialization), the argumentCount mechanism in the generated parse()
methods fails when no elements for a minOccurs=0 property are present.
For serialization, the next() method in the ADBPullParser fails to
handle zero-length arrays as it assumes that every array-valued
property has at least one element.

Also, I found another bug in the generated parse() methods. If an
element named foo has a subelement also named foo, and especially if
the types of the two foo elements are different (e.g., one is complex
and one is simple), then the parse() method fails.

I believe these issues are addressed in the attached patches, although
they have only been lightly tested so far. At least all the exceptions
are gone and visual inspection of the serialized and deserialized
results seems correct. I'm sending this now because I know you are
working on the code generator and want to bring these issues to your
attention in case you have not already addressed them. Our project
will be heavily testing all of this in the coming week.

These fixes overlap with some of my earlier ones, so I can't create
separate patches now. The attached files are consolidated patches to
fix all of these issues:

  Add support for choice particles
  Add support for recursive data types
  Add support for minOccurs=0 elements in the 0 case (i.e., where
no elements for the property are present)
  Fix bug where a subelement with the same name as its parent
element, but different types, was confused by the parse() methods

codgen.patch applies to modules/codegen/src and adb.patch applies to
modules/adb/src, both against Axis2 0.94 source distribution.

Chuck



diff -ur adb.src.orig/org/apache/axis2/databinding/utils/ADBPullParser.java adb.src.new/org/apache/axis2/databinding/utils/ADBPullParser.java
--- adb.src.orig/org/apache/axis2/databinding/utils/ADBPullParser.java	2006-03-04 22:55:03.0 -1000
+++ adb.src.new/org/apache/axis2/databinding/utils/ADBPullParser.java	2006-03-04 22:49:45.0 -1000
@@ -115,6 +115,21 @@
 this.elementQName = adbBeansQName;
 this.attributes = attributes;
 namespaceMap = new HashMap();
+if (attributes==null || attributes.length==0) {
+if (properties==null || properties.length==0)
+isEndElementFinished = true;
+else {
+boolean allEmptyArrays = true;
+for (int i=1; iproperties.length; i+=2) {
+if (!(properties[i] instanceof Object[]  ((Object[])properties[i]).length==0)) {
+allEmptyArrays = false;
+break;
+}
+}
+if (allEmptyArrays)
+isEndElementFinished = true;
+}
+}
 }
 
 /**
@@ -265,8 +280,12 @@
 if (o instanceof QName) {
 Object object = properties[currentIndex];
 if (object instanceof Object[]) {
-secondArrayIndex = 0;
 complexArray = (Object[]) object;
+if (complexArray.length==0) {
+currentIndex += 2;
+return this.next();
+}
+secondArrayIndex = 0;
 complexArrayQName = (QName) o;
 getPullParser(complexArray[secondArrayIndex], complexArrayQName);
 processingComplexArray = true;
@@ -286,8 +305,12 @@
 
 if (property instanceof String[]) {
 
-complexStringArrayName = simplePropertyName;
 complexStringArray = (String[]) property;
+if (complexStringArray.length==0) {
+currentIndex += 2;
+return this.next();
+}
+complexStringArrayName = simplePropertyName;
 secondArrayIndex = 0;
 processingComplexADBNameValuePair = true;
 
diff -urX exclude.files codegen.src.orig/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java codegen.src.new/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
--- codegen.src.orig/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java	2006-01-24 18:14:07.0 -1000
+++ codegen.src.new/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java	2006-02-08 22:24:45.0 -1000
@@ -32,6 +32,7 @@
 
 
 private boolean ordered = false;
+private boolean choice = false;
 private boolean anonymous = false;
 private boolean extension = false;
 private String extensionClassName = ;
@@ -115,6 +116,24 @@
 public void setOrdered(boolean ordered) {
 this.ordered 

Async Service with callback for BPEL process (any hints?)

2006-03-05 Thread SOA Work

Hi there,

almost every BPEL guide is talking about invoking services in a asynchronous 
way and reveiving the result via callback later. Now I was thinking about how 
such a service in axis or axis2 would look like.

I guess the service has to now the callback port and maybe the endpoint. At the 
end of  the operation the service has to use the client side axis and callback 
the process. 

Does somebody do any similar? Any examples? Is there a way how to determine 
from which sender the invocation was received?

Best regards
Dominik
__
Erweitern Sie FreeMail zu einem noch leistungsstarkeren E-Mail-Postfach!

Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131



SOAP spec

2006-03-05 Thread eric kong
  after reading soap specification at w3c i have a few questions1) you can't use soap-envelope namespace with application specific element?since soap schema have not define namespace (env) can use with MyElementinside soap schema -- targetNamespace=http://www.w3.org/2003/05/soap-envelope indicates that the elements defined by this schema are Header Body Envelope etc... but not MyElement right?for example: env:MyElement -- we cannot use the envlope namespace with MyElement?note: MyElement is an element generate from my own application2) in soap schema we have   
 p;
  xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/2003/05/soap-envelope" targetNamespace="http://www.w3.org/2003/05/soap-envelope" elementFormDefault="qualified"in soap request xml we can delcare using that namespace by env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"so all element with env namespace will follow rules in soap schema at   http://www.w3.org/2003/05/soap-envelope/   is that correct?at the same time all element inMy namespace will follow rules in my new schema that i define?3) the above is why we need namespace? for example -a) soap-envelope namespace is a set of elements includes Envelope Header Body Fault 
 ..etc
 etcb) WSDL namespace is for a set of elements definitions types message portType binding .. etc etcc) My own defined namespace is for a set of elements MyElement .. etc etc that i defined.so namespace can distinguish a set of elements in XML that's defined by di
 fferent
 people?Thanks  
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


Re: Async Service with callback for BPEL process (any hints?)

2006-03-05 Thread Prashanth.S
Cant you use SOAP over JMS rather than SOAP over HTTP??  I think it provides async invocations using queues.Rgds  Prashanth  SOA Work [EMAIL PROTECTED] wrote:  Hi there,almost every BPEL guide is talking about invoking services in a asynchronous way and reveiving the result via callback later. Now I was thinking about how such a service in axis or axis2 would look like.I guess the service has to now the callback port and maybe the endpoint. At the end of the operation the service has to use the client side axis and callback the process. Does somebody do any similar? Any examples? Is there a way how to determine from which sender the invocation was received?Best
 regardsDominik__Erweitern Sie FreeMail zu einem noch leistungsstarkeren E-Mail-Postfach! Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131
		Do you Yahoo!? 
New and Improved Yahoo! Mail - 1GB free storage!

XML namespace

2006-03-05 Thread eric kong
  namespace is used for extending XML document that's define by another / different people?for example soap, someone defined soap envelope which is the basic structure / framework HEADER BODY ...etcthen user of soap can add his own elements inside the framework -- inside HEADER tag or BODY tag.but the new user elements is defined by different people then soap envolpe, so we need to have another namespaceis that the only reason why we need namespace? any other reason we need namespace for each element?Thanks
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


Aixs support intermediaries

2006-03-05 Thread susae lee
For the applications i worked on, it's only client / server - request / response, one - one communication. But when i read SOAP specification, it may have many intermediaries between the web serviceclient and serverHere is my question -1 --Does Aixs support intermediaries and what is intermediaries used for?2 --Does use ofintermediaries happen often in the real world industry?3 --What are example of intermediaries and use of it?4 -- Are those intermediaries just anotherSOAPengine (e.g. axis) sit on aother Computer / Host?5 --i also heard intermediaries modify the SOAP request / response too why they need to do so?6 --i saw alot web service at www.xmethods.net they are all one - one-- request / response, did all the web services there ever use intermediaries? am i sending request to intermediaries or Ultimate soap receiver? Usually it will have 1 request, and thenresponse XML when i click on "Try It" there.  
		Relax. Yahoo! Mail 
virus scanning helps detect nasty viruses!

soap HEADER in Axis documentation

2006-03-05 Thread susae lee
i just read through Axis user doc, but all sample app it mention doesn't show how to use the HEADER tag inside soap request / response.1 -- is HEADER tag not much a use when doing 1 - 1 host to host request /response?2 -- HEADER is only useful when soap massage need to pass multiple endpoints / hosts ?3 -- Why most of the web services at www.xmethods.net don't use HEADER tag on request / response xml?4 -- Is that in most cases, BODY tag in soap is enough? no HEADER needed?5 -- Hosts in between web service client + provider process HEADER elements but not the content of BODY element? and the Ultimate SOAP receiver will process the BODY elements?
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


soap HEADER in Axis documentation

2006-03-05 Thread susae lee
i just read through Axis user doc, but all sample app it mention doesn't show how to use the HEADER tag inside soap request / response.1 -- is HEADER tag not much a use when doing 1 - 1 host to host request /response?2 -- HEADER is only useful when soap massage need to pass multiple endpoints / hosts ?3 -- Why most of the web services at www.xmethods.net don't use HEADER tag on request / response xml?4 -- Is that in most cases, BODY tag in soap is enough? no HEADER needed?5 -- Hosts in between web service client + provider process HEADER elements but not the content of BODY element? and the Ultimate SOAP receiver will process the BODY elements?
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


soap HEADER in Axis documentation

2006-03-05 Thread susae lee
i just read through Axis user doc, but all sample app it mention doesn't show how to use the HEADER tag inside soap request / response.1 -- is HEADER tag not much a use when doing 1 - 1 host to host request /response?2 -- HEADER is only useful when soap massage need to pass multiple endpoints / hosts ?3 -- Why most of the web services at www.xmethods.net don't use HEADER tag on request / response xml?4 --   Is that in most cases, BODY tag in soap is enough? no HEADER needed?5 --   Hosts in between web service client + provider process HEADER elements but not the content of BODY element? and the Ultimate SOAP receiver will process the BODY elements?
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


repost - error for soap HEADER in Axis documentation

2006-03-05 Thread susae lee
i just read through Axis user doc, but all sample app it mention doesn't show how to use the HEADER tag inside soap request / response.1 -- is HEADER tag not much a use when doing 1 - 1 host to host request /response?2 -- HEADER is only useful when soap massage need to pass multiple endpoints / hosts ?3 -- Why most of the web services at www.xmethods.net don't use HEADER tag on request / response xml?4 -- Is that in most cases, BODY tag in soap is enough? no HEADER needed?5 -- Hosts in between web service client + provider process HEADER elements but not the content of BODY element? and the Ultimate SOAP receiver will process the BODY elements?
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


Re: repost - error for soap HEADER in Axis documentation

2006-03-05 Thread Anne Thomas Manes
People typically use a SOAP Header to perform system-level functionality, such as authentication, session management, and routing. These functional requirements apply to both 1-to-1 and intermediated connections.Most web services on 
xmethods.com do not require these system-level functions.Typically header information is not passed to the application agent. Instead, the header is processed either by an intermediary or by a handler with the hosting SOAP engine.
AnneOn 3/5/06, susae lee [EMAIL PROTECTED] wrote:
i just read through Axis user doc, but all sample app it mention doesn't show how to use the HEADER tag inside soap request / response.1 -- is HEADER tag not much a use when doing 1 - 1 host to host request /response?
2 -- HEADER is only useful when soap massage need to pass multiple endpoints / hosts ?3 -- Why most of the web services at 
www.xmethods.net don't use HEADER tag on request / response xml?4 -- Is that in most cases, BODY tag in soap is enough? no HEADER needed?5 -- Hosts in between web service client + provider process HEADER elements but not the content of BODY element? and the Ultimate SOAP receiver will process the BODY elements?

		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 




Re: SOAP spec

2006-03-05 Thread Anne Thomas Manes
Eric asked:
so namespace can distinguish a set of elements in XML that's defined by di
 fferent
 people?Yes.


On 3/5/06, eric kong [EMAIL PROTECTED] wrote:
  after reading soap specification at w3c i have a few questions  
  1) you can't use soap-envelope namespace with application specific element?
since soap schema have not define namespace (env) can use with MyElementinside soap schema -- 
targetNamespace=
http://www.w3.org/2003/05/soap-envelope indicates that the elements defined by this schema are Header Body Envelope etc... but not MyElement right?
for example: env:MyElement -- we cannot use the envlope namespace with MyElement?
note: MyElement is an element generate from my own application  
  2) in soap schema we have   nbs
 p;
  xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema
 xmlns:tns=http://www.w3.org/2003/05/soap-envelope targetNamespace=
http://www.w3.org/2003/05/soap-envelope elementFormDefault=qualifiedin soap request xml we can delcare using that namespace by 
env:Envelope xmlns:env=
http://www.w3.org/2003/05/soap-envelopeso all element with env namespace will follow rules in soap schema at 
  http://www.w3.org/2003/05/soap-envelope/
   is that correct?at the same time all element inMy namespace will follow rules in my new schema that i define?
3) the above is why we need namespace?   
  for example -a) soap-envelope namespace is a set of elements includes Envelope Header Body Fault 
 ..etc
 etcb) WSDL namespace is for a set of elements 
definitions types message 
portType binding .. etc etc  

  
c) My own defined namespace is for a set of elements MyElement .. etc etc that i defined.
  
  

so namespace can distinguish a set of elements in XML that's defined by di
 fferent
 people?  
  

Thanks  

		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 




tools to validate a WSDL document

2006-03-05 Thread eric kong
any tools /editor out there to validate WSDL document is valid one?i heard alot WSDL on the web are out dated / invalid.xmlspy a good one?do i need to get xml schema / DTD for WSDL since tools like xmlspy wouldneed the DTD for validation is that correct?  http://schemas.xmlsoap.org/wsdl/so that i can genenrate stub client code using automated tools (WSDL2Java..etc)Thanks
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


Re: [Axis2 0.94] minOccurs=0 issues

2006-03-05 Thread Ajith Ranabahu
Hi chuck,
is this a 0.94 issue ? I've done some (significant) changes to the
de-ser code lately so things look different now. We handle the min
occurs properly. Unfortunately the current code handles sequence
properly but not choice or all (I'll be working on that soon
though)
I'll fix the codegen issues but I may not be able to apply your
patches directly now

Ajith

On 3/5/06, Chuck Williams [EMAIL PROTECTED] wrote:
  Hi Ajith and all,

  I ran into another code generation problem.  minOccurs=0 elements are not
 supported in the 0 case.  I.e., for an optional element that is not present
 or a zero-length array, the parsing has bugs.  The core serialization in adb
 also fails to handle this case.  For the parsing (deserialization), the
 argumentCount mechanism in the generated parse() methods fails when no
 elements for a minOccurs=0 property are present.  For serialization,  the
 next() method in the ADBPullParser fails to handle zero-length arrays as it
 assumes that every array-valued property has at least one element.

  Also, I found another bug in the generated parse() methods.  If an element
 named foo has a subelement also named foo, and especially if the types of
 the two foo elements are different (e.g., one is complex and one is simple),
 then the parse() method fails.

  I believe these issues are addressed in the attached patches, although they
 have only been lightly tested so far.  At least all the exceptions are gone
 and visual inspection of the serialized and deserialized results seems
 correct.  I'm sending this now because I know you are working on the code
 generator and want to bring these issues to your attention in case you have
 not already addressed them.  Our project will be heavily testing all of this
 in the coming week.

  These fixes overlap with some of my earlier ones, so I can't create
 separate patches now.  The attached files are consolidated patches to fix
 all of these issues:


 Add support for choice particles
 Add support for recursive data types
 Add support for minOccurs=0 elements in the 0 case (i.e., where no elements
 for the property are present)
 Fix bug where a subelement with the same name as its parent element, but
 different types, was confused by the parse() methods codgen.patch applies to
 modules/codegen/src and adb.patch applies to modules/adb/src, both against
 Axis2 0.94 source distribution.

  Chuck





--
Ajith Ranabahu


logging request/response messages

2006-03-05 Thread Christopher Cheng
I would like to log XML request / response text messages and their response 
times in database, is there a way to do it in Axis? 





WSDD

2006-03-05 Thread eric kong
does you guys usually hand code your WSDD files?are there are tools auto generateWSDD?you guys usually get deploy.WSDD from WSDL2Java when generating sbut / skeletons?(java interface) -- Java2WSDL -- (WSDL) -- WSDL2Java -- deploy.WSDDis that the way people usually use to get WSDD?Thanks
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 


Re: logging request/response messages

2006-03-05 Thread Mike Barton
Try using WSABI, available @ http://sourceforge.net/projects/wsabi4axis 
It comes with monitoring module that does exactly what you want.


--Mike

Christopher Cheng wrote:
I would like to log XML request / response text messages and their response 
times in database, is there a way to do it in Axis? 










Re: [Axis2 0.94] minOccurs=0 issues

2006-03-05 Thread Chuck Williams




Thanks Ajith.

I need to make progress on my project and so unfortunately have to fix
the issues in 0.94 as they arise. We have a fairly complicated set of
types in our wsdl to support. If only 0.95 was done with all your
fixes in it (including choice)... 
:-) 

FYI, there was a bug in my fixes to ADBPullParser to handle
minOccurs=0. The changes to next() fully resolve the issues without
any change to the constructor.

Also, the fixes to deserialization (code generated for the parse()
methods) uncovered a bug in OMStAXWrapper.getElementText(). In the
case where parser==null (i.e., working directly on an OMElement), it
did not obey the proper contract for getElementText(). Specifically,
it did not advance itself to the END_ELEMENT. This caused my parse()
methods to parse the same element infinitely since they were always at
the START_ELEMENT. This case appears to have only occured (in my uses
so far) when the entire message body was a single element of simple
type (e.g., document/literal message with an xsd:string element
payload). In other cases, OMStAXWrapper apparently switched to the
parser!=null state, which worked properly.

The attached xml.src.patch fixes OMStAXWrapper.getElementText(). The
attached adb.patch contains the updated fix to ADBPullParser. I
included codegen.patch again just for completeness re. all the issues
covered on this thread, although it has not changed from the prior
message.

Looking forward to 0.95!

Chuck



"Ajith Ranabahu" [EMAIL PROTECTED] wrote on
03/05/2006 05:53:56 PM:



  Hi chuck,
is this a 0.94 issue ? I've done some (significant) changes to the
de-ser code lately so things look different now. We handle the min
occurs properly. Unfortunately the current code handles sequence
properly but not "choice" or "all" (I'll be working on that soon
though)
I'll fix the codegen issues but I may not be able to apply your
patches directly now

Ajith

On 3/5/06, Chuck Williams [EMAIL PROTECTED] wrote:
  
  
 Hi Ajith and all,

 I ran into another code generation problem.  minOccurs=0 elements are not
supported in the 0 case.  I.e., for an optional element that is not present
or a zero-length array, the parsing has bugs.  The core serialization in adb
also fails to handle this case.  For the parsing (deserialization), the
argumentCount mechanism in the generated parse() methods fails when no
elements for a minOccurs=0 property are present.  For serialization,  the
next() method in the ADBPullParser fails to handle zero-length arrays as it
assumes that every array-valued property has at least one element.

 Also, I found another bug in the generated parse() methods.  If an element
named foo has a subelement also named foo, and especially if the types of
the two foo elements are different (e.g., one is complex and one is simple),
then the parse() method fails.

 I believe these issues are addressed in the attached patches, although they
have only been lightly tested so far.  At least all the exceptions are gone
and visual inspection of the serialized and deserialized results seems
correct.  I'm sending this now because I know you are working on the code
generator and want to bring these issues to your attention in case you have
not already addressed them.  Our project will be heavily testing all of this
in the coming week.

 These fixes overlap with some of my earlier ones, so I can't create
separate patches now.  The attached files are consolidated patches to fix
all of these issues:


Add support for choice particles
Add support for recursive data types
Add support for minOccurs=0 elements in the 0 case (i.e., where no elements
for the property are present)
Fix bug where a subelement with the same name as its parent element, but
different types, was confused by the parse() methods codgen.patch applies to
modules/codegen/src and adb.patch applies to modules/adb/src, both against
Axis2 0.94 source distribution.

 Chuck




  
  

--
Ajith Ranabahu
  


-- 

Chuck Williams
Manawiz
Principal
V: (808)885-8688
C: (415)846-9018
[EMAIL PROTECTED]
Skype: manawiz
AIM: hawimanawiz
Yahoo: jcwxx




diff -urX exclude.files adb.src.orig/org/apache/axis2/databinding/utils/ADBPullParser.java adb.src.new/org/apache/axis2/databinding/utils/ADBPullParser.java
--- adb.src.orig/org/apache/axis2/databinding/utils/ADBPullParser.java	2006-03-04 22:55:03.0 -1000
+++ adb.src.new/org/apache/axis2/databinding/utils/ADBPullParser.java	2006-03-05 18:34:40.0 -1000
@@ -265,8 +265,12 @@
 if (o instanceof QName) {
 Object object = properties[currentIndex];
 if (object instanceof Object[]) {
-secondArrayIndex = 0;
 complexArray = (Object[]) object;
+if (complexArray.length==0) {
+currentIndex += 2;
+return this.next();
+}
+secondArrayIndex = 0;
 complexArrayQName = (QName) o;