Sharing data among multiple portTypes
Hi, I am using Axis2 1.3. Appreciate any advice/sample code to allow a client that has multiple stubs but want to share the session data among the services. Based on http://www.developer.com/java/web/article.php/10935_3620661_2, I have turned on the Transport session, and put the multiple server under the same service group on server side, and enable session management on each stub on client side. But the session cannot be shared among services belong to different stubs. Is this possible? Thanks, -Bo
Re: Axis2 1.1.1 WSDL2JAVA - Not generating java classes for
Hi Ajith, Thanks for the comments. Look forward to your explanation. Like to know the difference between the workaround and the expected. Thanks, -Bo On 6/13/07, Ajith Ranabahu <[EMAIL PROTECTED]> wrote: Hi, We will definitely look at the possibility of supporting this during the hackathon. I will perhaps explain in a separate mail what is the thinking behind starting from the port but it seems that we need to rethink this when it comes to skeletons. What I can suggest as a workaround is to generate code for each port with separate WSDL2Java calls (which will yield multiple skeletons). You can make this easy if you use the ant task Ajith On 6/13/07, Bo Xie <[EMAIL PROTECTED]> wrote: > Hi Amila and all, > > In case this is not working yet, can you suggest any alternative? I have a > few services that shared a lot of common data among them. I have to move all > the methods in all services into one mega service and change method name if > necessary to avoid conflicts. Mixing methods of different purpose into one > service looks messy. > >Appreciate any advice. > > -Bo > > > On 5/24/07, Jess Fisher <[EMAIL PROTECTED]> wrote: > > I still cannot get all the portTypes generated even with Axis 1.2. Any > plans on fixing this ? > > > > > > Bo Xie < [EMAIL PROTECTED]> wrote: > > Sorry to bother you again. Just want to know if this is a bug or I did not > set the parameter correctly. Any advice on how to make this work. > > > > Thanks, > > -Bo > > > > > > On 5/20/07, Bo Xie < [EMAIL PROTECTED]> wrote: > > > I attached the wsdls from the original email. > > > > > > Thanks, > > > -Bo > > > > > > > > > > > > On 5/20/07, Amila Suriarachchi < [EMAIL PROTECTED] > wrote: > > > > Can you send your wsdl? do you have ports for each bining? > > > > Actually code is generated per port. > > > > > > > > > > > > > > > > On 5/20/07, Bo Xie < [EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > > > > > > Just wondering if this is still an issue in Axis2 1.2 or I did not > put the parameters properly. > > > > > > > > > > Thanks, > > > > > -Bo > > > > > > > > > > On 5/17/07, Bo Xie < [EMAIL PROTECTED]> wrote: > > > > > > Thanks, Amila. I tried your advice using no -pn and -sn. It still > only generated last one binding out of the 4. I used asix2 1.2 release. > > > > > > > > > > > > Here is the command line. Anything I did not do right? Attached is > the output files and wsdl files. Sorry for the 500k size. > > > > > > > > > > > > C:\programs\work>wsdl2java -o output -p com.xyz.nbi -t -ss -sd -g > -S src -R src -uri wsrp_service.wsdl > > > > > > Using AXIS2_HOME: C:\programs\axis2-1.2 > > > > > > Using JAVA_HOME:C:\programs\jdk1.5.0_09 > > > > > > Retrieving document at 'wsrp_v1_bindings.wsdl', relative to > 'file:/C:/programs/work/'. > > > > > > Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to > 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. > > > > > > Retrieving schema at 'wsrp_v1_types.xsd', relative to > 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. > > > > > > Retrieving schema at ' http://www.w3.org/2001/xml.xsd', relative > to 'file:/C:/programs/work/wsrp_v1_types.xsd'. > > > > > > Retrieving document at 'wsrp_v1_bindings.wsdl', relative to > 'file:/C:/programs/work/'. > > > > > > Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to > 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. > > > > > > Retrieving schema at 'wsrp_v1_types.xsd', relative to > 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. > > > > > > Retrieving schema at ' http://www.w3.org/2001/xml.xsd', relative > to 'file:/C:/programs/work/wsrp_v1_types.xsd'. > > > > > > May 17, 2007 11:55:31 AM > org.apache.axis2.wsdl.codegen.writer.ClassWriter > createOutFile > > > > > > INFO: The > output\src\com\xyz\nbi\InvalidHandleException.java file > cannot be overwritten. > > > > > > May 17, 2007 11:55:31 AM > org.apache.axis2.wsdl.codegen.writer.ClassWriter > createOutFile > > > > > > INFO: The > output\src\com\xyz\nbi\AccessDeniedException.java
Re: Axis2 1.1.1 WSDL2JAVA - Not generating java classes for
Hi Amila and all, In case this is not working yet, can you suggest any alternative? I have a few services that shared a lot of common data among them. I have to move all the methods in all services into one mega service and change method name if necessary to avoid conflicts. Mixing methods of different purpose into one service looks messy. Appreciate any advice. -Bo On 5/24/07, Jess Fisher <[EMAIL PROTECTED]> wrote: I still cannot get all the portTypes generated even with Axis 1.2. Any plans on fixing this ? *Bo Xie <[EMAIL PROTECTED]>* wrote: Sorry to bother you again. Just want to know if this is a bug or I did not set the parameter correctly. Any advice on how to make this work. Thanks, -Bo On 5/20/07, Bo Xie <[EMAIL PROTECTED]> wrote: > > I attached the wsdls from the original email. > > Thanks, > -Bo > > On 5/20/07, Amila Suriarachchi < [EMAIL PROTECTED] > wrote: > > > > Can you send your wsdl? do you have ports for each bining? > > Actually code is generated per port. > > > > On 5/20/07, Bo Xie < [EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > > > > Just wondering if this is still an issue in Axis2 1.2 or I did not > > > put the parameters properly. > > > > > > Thanks, > > > -Bo > > > On 5/17/07, Bo Xie < [EMAIL PROTECTED]> wrote: > > > > > > > > Thanks, Amila. I tried your advice using no -pn and -sn. It still > > > > only generated last one binding out of the 4. I used asix2 1.2release. > > > > > > > > Here is the command line. Anything I did not do right? Attached is > > > > the output files and wsdl files. Sorry for the 500k size. > > > > > > > > C:\programs\work>wsdl2java -o output -p com.xyz.nbi -t -ss -sd -g > > > > -S src -R src -uri wsrp_service.wsdl > > > > Using AXIS2_HOME: C:\programs\axis2-1.2 > > > > Using JAVA_HOME:C:\programs\jdk1.5.0_09 > > > > Retrieving document at 'wsrp_v1_bindings.wsdl', relative to > > > > 'file:/C:/programs/work/'. > > > > Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to > > > > 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. > > > > Retrieving schema at 'wsrp_v1_types.xsd', relative to > > > > 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. > > > > Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to > > > > 'file:/C:/programs/work/wsrp_v1_types.xsd'. > > > > Retrieving document at 'wsrp_v1_bindings.wsdl', relative to > > > > 'file:/C:/programs/work/'. > > > > Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to > > > > 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. > > > > Retrieving schema at 'wsrp_v1_types.xsd', relative to > > > > 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. > > > > Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to > > > > 'file:/C:/programs/work/wsrp_v1_types.xsd'. > > > > May 17, 2007 11:55:31 AM > > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > > INFO: The output\src\com\xyz\nbi\InvalidHandleException.java file > > > > cannot be overwritten. > > > > May 17, 2007 11:55:31 AM > > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > > INFO: The output\src\com\xyz\nbi\AccessDeniedException.java file > > > > cannot be overwritten. > > > > May 17, 2007 11:55:31 AM > > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > > INFO: The output\src\com\xyz\nbi\InvalidRegistrationException.java > > > > file cannot be overwritten. > > > > May 17, 2007 11:55:31 AM > > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > > INFO: The output\src\com\xyz\nbi\MissingParametersException.java > > > > file cannot be overwritten. > > > > May 17, 2007 11:55:31 AM > > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > > INFO: The output\src\com\xyz\nbi\InvalidUserCategoryException.java > > > > file cannot be overwritten. > > > > May 17, 2007 11:55:31 AM > > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > > INFO: The output\src\com\xyz\nbi\OperationFailedException.java > > > > file cannot be overwritten. > > > &
Re: Axis2 1.1.1 WSDL2JAVA - Not generating java classes for
Sorry to bother you again. Just want to know if this is a bug or I did not set the parameter correctly. Any advice on how to make this work. Thanks, -Bo On 5/20/07, Bo Xie <[EMAIL PROTECTED]> wrote: I attached the wsdls from the original email. Thanks, -Bo On 5/20/07, Amila Suriarachchi <[EMAIL PROTECTED] > wrote: > > Can you send your wsdl? do you have ports for each bining? > Actually code is generated per port. > > On 5/20/07, Bo Xie < [EMAIL PROTECTED]> wrote: > > > > Hi, > > > > Just wondering if this is still an issue in Axis2 1.2 or I did not > > put the parameters properly. > > > > Thanks, > > -Bo > > On 5/17/07, Bo Xie < [EMAIL PROTECTED]> wrote: > > > > > > Thanks, Amila. I tried your advice using no -pn and -sn. It still > > > only generated last one binding out of the 4. I used asix2 1.2release. > > > > > > Here is the command line. Anything I did not do right? Attached is > > > the output files and wsdl files. Sorry for the 500k size. > > > > > > C:\programs\work>wsdl2java -o output -p com.xyz.nbi -t -ss -sd -g -S > > > src -R src -uri wsrp_service.wsdl > > > Using AXIS2_HOME: C:\programs\axis2-1.2 > > > Using JAVA_HOME:C:\programs\jdk1.5.0_09 > > > Retrieving document at 'wsrp_v1_bindings.wsdl', relative to > > > 'file:/C:/programs/work/'. > > > Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to > > > 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. > > > Retrieving schema at 'wsrp_v1_types.xsd', relative to > > > 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. > > > Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to > > > 'file:/C:/programs/work/wsrp_v1_types.xsd'. > > > Retrieving document at 'wsrp_v1_bindings.wsdl', relative to > > > 'file:/C:/programs/work/'. > > > Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to > > > 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. > > > Retrieving schema at 'wsrp_v1_types.xsd', relative to > > > 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. > > > Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to > > > 'file:/C:/programs/work/wsrp_v1_types.xsd'. > > > May 17, 2007 11:55:31 AM > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > INFO: The output\src\com\xyz\nbi\InvalidHandleException.java file > > > cannot be overwritten. > > > May 17, 2007 11:55:31 AM > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > INFO: The output\src\com\xyz\nbi\AccessDeniedException.java file > > > cannot be overwritten. > > > May 17, 2007 11:55:31 AM > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > INFO: The output\src\com\xyz\nbi\InvalidRegistrationException.java > > > file cannot be overwritten. > > > May 17, 2007 11:55:31 AM > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > INFO: The output\src\com\xyz\nbi\MissingParametersException.java > > > file cannot be overwritten. > > > May 17, 2007 11:55:31 AM > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > INFO: The output\src\com\xyz\nbi\InvalidUserCategoryException.java > > > file cannot be overwritten. > > > May 17, 2007 11:55:31 AM > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > INFO: The output\src\com\xyz\nbi\OperationFailedException.java file > > > cannot be overwritten. > > > May 17, 2007 11:55:31 AM > > > org.apache.axis2.wsdl.codegen.writer.ClassWriter createOutFile > > > INFO: The > > > output\src\com\xyz\nbi\InconsistentParametersException.java file cannot be > > > overwritten. > > > > > > Thanks, > > > -Bo > > > On 5/17/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > On 5/17/07, Bo Xie <[EMAIL PROTECTED] > wrote: > > > > > > > > > > Hi > > > > > > > > > > I tried on Axis2 1.2 release package. I see there is an -pn > > > > > operation. Here is the command line I used. The skeleton file still only > > > > > have the operations in the last port(see attached skeleton file). > > > > > > > > > &g
Re: Axis2 1.1.1 WSDL2JAVA - Not generating java classes for
Hi, Just wondering if this is still an issue in Axis2 1.2 or I did not put the parameters properly. Thanks, -Bo On 5/17/07, Bo Xie <[EMAIL PROTECTED]> wrote: Thanks, Amila. I tried your advice using no -pn and -sn. It still only generated last one binding out of the 4. I used asix2 1.2 release. Here is the command line. Anything I did not do right? Attached is the output files and wsdl files. Sorry for the 500k size. C:\programs\work>wsdl2java -o output -p com.xyz.nbi -t -ss -sd -g -S src -R src -uri wsrp_service.wsdl Using AXIS2_HOME: C:\programs\axis2-1.2 Using JAVA_HOME:C:\programs\jdk1.5.0_09 Retrieving document at 'wsrp_v1_bindings.wsdl', relative to 'file:/C:/programs/work/'. Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. Retrieving schema at 'wsrp_v1_types.xsd', relative to 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to 'file:/C:/programs/work/wsrp_v1_types.xsd'. Retrieving document at 'wsrp_v1_bindings.wsdl', relative to 'file:/C:/programs/work/'. Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. Retrieving schema at 'wsrp_v1_types.xsd', relative to 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to 'file:/C:/programs/work/wsrp_v1_types.xsd'. May 17, 2007 11:55:31 AM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\xyz\nbi\InvalidHandleException.java file cannot be overwritten. May 17, 2007 11:55:31 AM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\xyz\nbi\AccessDeniedException.java file cannot be overwritten. May 17, 2007 11:55:31 AM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\xyz\nbi\InvalidRegistrationException.java file cannot be overwritten. May 17, 2007 11:55:31 AM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\xyz\nbi\MissingParametersException.java file cannot be overwritten. May 17, 2007 11:55:31 AM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\xyz\nbi\InvalidUserCategoryException.java file cannot be overwritten. May 17, 2007 11:55:31 AM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\xyz\nbi\OperationFailedException.java file cannot be overwritten. May 17, 2007 11:55:31 AM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\xyz\nbi\InconsistentParametersException.java file cannot be overwritten. Thanks, -Bo On 5/17/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote: > > > > On 5/17/07, Bo Xie <[EMAIL PROTECTED] > wrote: > > > > Hi > > > > I tried on Axis2 1.2 release package. I see there is an -pn > > operation. Here is the command line I used. The skeleton file still only > > have the operations in the last port(see attached skeleton file). > > > > My questions are: > > 1. Is "-pn WSRPRegistrationService" used correctly, why the > > skeleton file does not have the operations from this portType. > > > pn is for port name not for port type. > > 2. Is there any options to have wsdl2java generate all the portTypes > > in the WSDL. > > > > C:\programs\work>wsdl2java -o output -p com.cisco.csm.nbi -t -ss -sd > > -g -S src -R src -pn WSRPRegistrationService -uri wsrp_service.wsdl > > > if you do not use the -pn and -sn parameters it will generate the code > for all bindings. > > Using AXIS2_HOME: C:\programs\axis2- 1.2 > > Using JAVA_HOME:C:\programs\jdk1.5.0_09 > > Retrieving document at 'wsrp_v1_bindings.wsdl', relative to > > 'file:/C:/programs/work/'. > > Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to > > 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. > > Retrieving schema at 'wsrp_v1_types.xsd', relative to > > 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. > > Retrieving schema at ' http://www.w3.org/2001/xml.xsd ', relative to > > 'file:/C:/programs/work/wsrp_v1_types.xsd'. > > Retrieving document at 'wsrp_v1_bindings.wsdl', relative to > > 'file:/C:/programs/work/'. > > Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to > > 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. > > Retrieving schema at 'wsrp_v1_types.xsd', relative to > > 'file:/C:/programs/work/wsrp
Re: Axis2 1.1.1 WSDL2JAVA - Not generating java classes for
Hi I tried on Axis2 1.2 release package. I see there is an -pn operation. Here is the command line I used. The skeleton file still only have the operations in the last port(see attached skeleton file). My questions are: 1. Is "-pn WSRPRegistrationService" used correctly, why the skeleton file does not have the operations from this portType. 2. Is there any options to have wsdl2java generate all the portTypes in the WSDL. C:\programs\work>wsdl2java -o output -p com.cisco.csm.nbi -t -ss -sd -g -S src -R src -pn WSRPRegistrationService -uri wsrp_service. wsdl Using AXIS2_HOME: C:\programs\axis2-1.2 Using JAVA_HOME:C:\programs\jdk1.5.0_09 Retrieving document at 'wsrp_v1_bindings.wsdl', relative to 'file:/C:/programs/work/'. Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. Retrieving schema at 'wsrp_v1_types.xsd', relative to 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to 'file:/C:/programs/work/wsrp_v1_types.xsd'. Retrieving document at 'wsrp_v1_bindings.wsdl', relative to 'file:/C:/programs/work/'. Retrieving document at 'wsrp_v1_interfaces.wsdl', relative to 'file:/C:/programs/work/wsrp_v1_bindings.wsdl'. Retrieving schema at 'wsrp_v1_types.xsd', relative to 'file:/C:/programs/work/wsrp_v1_interfaces.wsdl'. Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to 'file:/C:/programs/work/wsrp_v1_types.xsd'. May 16, 2007 6:05:12 PM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\cisco\csm\nbi\InvalidHandleException.java file cannot be overwritten. May 16, 2007 6:05:12 PM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\cisco\csm\nbi\AccessDeniedException.java file cannot be overwritten. May 16, 2007 6:05:12 PM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\cisco\csm\nbi\InvalidRegistrationException.java file cannot be overwritten. May 16, 2007 6:05:12 PM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\cisco\csm\nbi\MissingParametersException.java file cannot be overwritten. May 16, 2007 6:05:12 PM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\cisco\csm\nbi\InvalidUserCategoryException.java file cannot be overwritten. May 16, 2007 6:05:12 PM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\cisco\csm\nbi\OperationFailedException.java file cannot be overwritten. May 16, 2007 6:05:12 PM org.apache.axis2.wsdl.codegen.writer.ClassWritercreateOutFile INFO: The output\src\com\cisco\csm\nbi\InconsistentParametersException.java file cannot be overwritten. Thanks, -Bo On 3/14/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote: I recently added multi services support to axis2. can you have a look with a nighly build? On 3/7/07, Amila Suriarachchi < [EMAIL PROTECTED]> wrote: > > > > On 3/7/07, Jess Fisher <[EMAIL PROTECTED]> wrote: > > > > I'm trying to understand what's happening here, so bear with me... > > Using Axis 1.4, I run the WSDL2Java like this: > > java org.apache.axis.wsdl.WSDL2Java -s -o C:\temp\generated_source > > C:\temp\wsrp_service.wsdl > > > > This created all the java interfaces for the defined wsdl:portType. > > See attached java_interfaces.zip > > > > This also automatically generated all the binding classes for the > > defined in wsrp_v1_bindings.wsdl (see my previous post where > > I attached this file there) > > These were all defined in wsrp_v1_bindings.wsdl: > > > type="intf:WSRP_v1_Markup_PortType"> > > > type="intf:WSRP_v1_ServiceDescription_PortType"> > > > type="intf:WSRP_v1_Registration_PortType"> > > > type="intf:WSRP_v1_PortletManagement_PortType"> > > > > The way I run Axis2's wsdl2java is as follows: > > wsdl2java.bat -uri C:\temp\wsrp_service.wsdl -o > > C:\temp\generated_source -ss -d adb -g -ns2p > > urn:oasis:names:tc:wsrp:v1:types=oasis.names.tc.wsrp.v1.types,urn:oasis:names:tc:wsrp:v1:intf= > > oasis.names.tc.wsrp.v1.intf,urn:oasis:names:tc:wsrp:v1:bind > > =oasis.names.tc.wsrp.v1.bind,urn:oasis:names:tc:wsrp:v1:wsdl= > > oasis.names.tc.wsrp.v1.wsdl -ssi > > However when I used Axis2's wsdl2java I did not get the java > > interfaces for . Why does the axis 1.x generate the > > java interfaces but axis 2 doesn't? > > > > well Axis2 generates the interface if you have specified the -ssi > parameter. But the difference is it has the service name instead of the > porttype name. I am not familiar with the axis 1.x but actually this > interface method signatures are depends on the binding. > > Also, I had to run wsdl2java seperately on wsrp_v1_bindings.wsdl before > > it would read my defined there to create my java classes for > > my wsdl bindings. Note that wsrp_service.wsdl already imports > > wsrp_v1_bindings.wsdl. It also does not generate the java classes for all > > my wsdl:binding (I gue
Re: [axis2] Generate XML schema from java class for parameter objects
*AXIS2-2610 <https://issues.apache.org/jira/browse/AXIS2-2610> created. BTW, is there any quick workaround as of now? Or any one knows any tools that world do that? Thanks, -Bo * On 4/28/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote: Bo, Please log an enhancement issue in JIRA for adding support to Java2WSDL to specify additional classes for which schema needs to be generated. thanks, dims On 4/28/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote: > You might try JiBX or XMLBeans. > > On 4/27/07, Bo Xie <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I need advice on how to use java2wsdl or other tools to generate XML > > schema from java class for operation parameters. I understand using > > java2wsdl, it will generate the schema for all the data type used as > > parameter for the operation. But I could not find a way to generate schema > > for any derived class types. For example, if I have a method doSomething( > > BaseType type). The generated schema will include schema for BaseType only. > > I need to handcraft the schema for devicedTypeA, devicedTypeB into the WSDL > > schema definition in order to pass deviceTypeA, deviceTypeB instances in > > doSomething operation at runtime. > > > > Thanks for your time. > > > > -Bo > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Davanum Srinivas :: http://davanum.wordpress.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[axis2] Generate XML schema from java class for parameter objects
Hi, I need advice on how to use java2wsdl or other tools to generate XML schema from java class for operation parameters. I understand using java2wsdl, it will generate the schema for all the data type used as parameter for the operation. But I could not find a way to generate schema for any derived class types. For example, if I have a method doSomething( BaseType type). The generated schema will include schema for BaseType only. I need to handcraft the schema for devicedTypeA, devicedTypeB into the WSDL schema definition in order to pass deviceTypeA, deviceTypeB instances in doSomething operation at runtime. Thanks for your time. -Bo
[axis2] supported soapAction format
Hi, It seems that when defining WSDL soapAction, axis2 only supports string started with 'urn:' such as the example below. If using ' http://quickstart.samples/xsd/2007/01/01/operation' for soapAction, then the operation won't be located on the server side. Is there any reason for this behavior? ... Thanks a lot. -Bo
Axis2 - Castor?
Hi, Just wondering if anyone can share some insight on why Castor is not part of Axis2 data binding options? Or in another word, any features from XMLBean that makes it a better choice than Castor? Thanks, -Bo
Re: Axis2 - how to set client timeout
Hi, Looks like the SO_TIMEOUT value is overwritten by the following timeout, so the doc is not accurate. stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(). Thanks, -Bo On 2/5/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote: http://wso2.org/library/230#SO_TIMEOUT On 2/5/07, Bo Xie <[EMAIL PROTECTED]> wrote: > Hi All, > > Please help me in setting up the client timeout. I tried the following, it > did not work. > > > stub._getServiceClient().getOptions().setProperty( org.apache.axis2.transport. > http.HTTPConstants.CONNECTION_TIMEOUT , > new Integer("720")); > > With this, I still see the client connection timed out exception in about > 5 seconds when the server side is taking its time(sometime a couple of > minutes). > > run.client: > [java] org.apache.axis2.AxisFault: Read timed out; nested exception > is: > [java] java.net.SocketTimeoutException: Read timed out; nested > exception is: > [java] org.apache.axis2.AxisFault: Read timed out; nested exception > is: > [java] java.net.SocketTimeoutException: Read timed out > [java] at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke( CommonsHTTPTransportSender.java:225) > [java] at org.apache.axis2.engine.AxisEngine.send > (AxisEngine.java:670) > [java] at > org.apache.axis2.description.OutInAxisOperationClient.send( OutInAxisOperation.java:365) > [java] at > org.apache.axis2.description.OutInAxisOperationClient.execute( OutInAxisOperation.java > :295) > [java] at > samples.quickstart.service.xmlbeans.StockQuoteServiceStub.getPrice( StockQuoteServiceStub.java:193) > [java] at > samples.quickstart.clients.XMLBEANSClient.getPrice(XMLBEANSClient.java :48) > [java] at > samples.quickstart.clients.XMLBEANSClient.main(XMLBEANSClient.java:16) > > Thanks, > -Bo > > -- Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Axis2 - how to set client timeout
Hi All, Please help me in setting up the client timeout. I tried the following, it did not work. stub._getServiceClient().getOptions().setProperty( org.apache.axis2.transport. http.HTTPConstants.CONNECTION_TIMEOUT, new Integer("720")); With this, I still see the client connection timed out exception in about 5 seconds when the server side is taking its time(sometime a couple of minutes). run.client: [java] org.apache.axis2.AxisFault: Read timed out; nested exception is: [java] java.net.SocketTimeoutException: Read timed out; nested exception is: [java] org.apache.axis2.AxisFault: Read timed out; nested exception is: [java] java.net.SocketTimeoutException: Read timed out [java] at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke( CommonsHTTPTransportSender.java:225) [java] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java :670) [java] at org.apache.axis2.description.OutInAxisOperationClient.send( OutInAxisOperation.java:365) [java] at org.apache.axis2.description.OutInAxisOperationClient.execute( OutInAxisOperation.java:295) [java] at samples.quickstart.service.xmlbeans.StockQuoteServiceStub.getPrice( StockQuoteServiceStub.java:193) [java] at samples.quickstart.clients.XMLBEANSClient.getPrice( XMLBEANSClient.java:48) [java] at samples.quickstart.clients.XMLBEANSClient.main( XMLBEANSClient.java:16) Thanks, -Bo
Re: Issue loading .xsb resource from XBean-packaged.jar in service [Was:Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type]
Hi all, I need some advice for the following. 0. I use WSDL2JAVA with XmlBean binding to generate the service side code following the quickstartxmlbean example. 1. Our service related XMLBean types/element xsd are packaged in XBean-packaged.jar in our .aar file under services. 2. Looks like when convert a derived type to XML, the code in SchemaTypeSystemImpl(which is in WEB-INF/lib/xbean-2.2.0.jar) is trying to load derived type info from XBean-packaged.jar. For example, it tried to load a derived type "schemaorg_apache_xmlbeans/type/http_3A_2F_2Fquickstart_2Esamples_2Fxsd_2F2007_2F01_2F01/FreeFormPolicyObject.xsb" 3. The problem is the class loader used by xbean-2.2.0.jar is the WebappClassLoader, not the classloader from Axis service. So it cannot load the resource! 4. I tried to put XBean-packaged.jar under WEB-INF/lib w or w/o removing the Xbean-package.jar in .aar, but in both cases got ClassCastException during org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse() I assume now the XBean-packaged.jar are needed both by the web service code and xbean-2.2.0.jar. Any advice on how to make it work? Thanks, -Bo On 1/22/07, Bo Xie <[EMAIL PROTECTED]> wrote: Hi, My previous issue is caused by org.apache.xmlbeans.impl > > .schema.SchemaTypeLoaderImpl's findTypeRef () not be able to load the > following resource in service: schemaorg_apache_xmlbeans/type/http_3A_2F_2Fquickstart_2Esamples_2Fxsd/EU_2DAddress.xsb This resource is actually in my .aar file under dir\XBean-packaged.jar(generated from WSDL2JAVA) Do anyone know how to make it work? Thanks a lot! -Bo On 1/21/07, Bo Xie <[EMAIL PROTECTED] > wrote: > > Hi all, > > Sorry to ask this again, does anyone know what could cause the > following call to return null, is it some kind of setup/configure issue in > the service? How to workaround it? It is in > org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl's findTypeRef (). > This causes the derived type cannot be created properly with the xsi:type > attribute. > > SchemaTypeSystem ts = typeSystemForComponent("schema" + > METADATA_PACKAGE_LOAD + "/type/", name); > > > Thanks, > -Bo > > > On 1/19/07, Bo Xie <[EMAIL PROTECTED] > wrote: > > > > Hi, > > > > Looks like the problem is with the _typeCache in > > org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl's findTypeRef () > > not being populated correctly for derived type when deployed as a service. > > This in turn was caused by typeSystemForComponent() in findTypeRef() > > returning null. As comparison, the _typeCache is populated correctly if I > > run it locally in a test program's main() and in this case the > > typeSystemForComponent() is not null. > > > > Below is the findTypeRef method which suppose to return the derived > > type if Qname passed in is a derived type. In my case, the QName is {http://quickstart.samples/xsd}EU-Address > > <http://quickstart.samples/xsd%7DEU-Address>. > > > > When in service, the _typeCache is populated with CACHED_NOT_FOUND > > for QName {http://quickstart.samples/xsd}EU-Address > > <http://quickstart.samples/xsd%7DEU-Address>. So findTypeRef will > > return null. This will result in the changeType() call to not return the > > derived type. (See call stack at the bottom.) > > > > In the local test program, the _typeCache was initially empty and > > was populated with the correct value at the end of findTypeRef call. > > > > The only way that CACHED_NOT_FOUND can be set for any QName type is > > when the following line in findTypeRef () return null. > > SchemaTypeSystem ts = typeSystemForComponent("schema" + > > METADATA_PACKAGE_LOAD + "/type/", name); > > > > I have no idea why this typeSystemForComponent() could return null > > in service. Can someone help clarify the myth here? When I trace into the > > first incoming message, it indeed shows that the typeSystemForComponent > > return null! > > > > Below are the findTypeRef method and the call stack. > > > > Thanks, > > -Bo > > > > public SchemaType.Ref findTypeRef(QName name) > > { > > /** > > * The maps are synchronized, we use two accesses to the cache > > (one read > > * and one write), but the code inbetween is not synchronized. > > The > > * assumption is that the underlying datastructures (the > > search path and > > * the classloader) do not change, so two threads running the > > code in > > * parallel will come up with the same result. > >
Re: How to get session cookie
Thanks Deepal. I found the info in the following way: MessageContext cxt = MessageContext.getCurrentMessageContext(); org.apache.axis2.transport.http.TransportHeaders headers = ( org.apache.axis2.transport.http.TransportHeaders)cxt.getProperty( MessageContext.TRANSPORT_HEADERS); System.out.println("Message Context Transport Header Propertie Keys: " + headers.keySet() +"\nvalues: "+headers.values()); The output is: Message Context Transport Header Properties Keys: [host=localhost:8080, user-agent=Axis2, transfer-encoding=chunked, content-type=text/xml; charset=UTF-8, cookie=$Version=0; JSESSIONID=FDE73A5E37F98D25033C1DEA7F89AEA9; $Path=/axis2, soapaction="urn:login"] values: [localhost:8080, Axis2, chunked, text/xml; charset=UTF-8, $Version=0; JSESSIONID=FDE73A5E37F98D25033C1DEA7F89AEA9; $Path=/axis2, "urn:login"] Thanks, -Bo On 1/19/07, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote: Hi, > > I have set a service to transport session scope and the session > context worked as expected. But when I try to get the session cookie > id, it always returns null. > MessageContext cxt = MessageContext.getCurrentMessageContext (); > SessionContext session = cxt.getSessionContext(); > String cookieId = session.getCookieID(); > > On the client side, I used the following code, it also always return > null. > > stub._getServiceClient().getOptions().getProperty( > org.apache.axis2.transport. > http.HTTPConstants.COOKIE_STRING) Try ; Object cookieString = msgContext.getProperty(HTTPConstants.COOKIE_STRING); > > Can someone shed some lights on how to get the cookie? > > Thanks, > -Bo -- Thanks, Deepal "The highest tower is built one brick at a time" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Issue loading .xsb resource from XBean-packaged.jar in service [Was:Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type]
Thanks, Ajith. The packaged jar XBean-packaged.jar is under lib subdir within .aar. I am using the generated ant build.xml. -Bo Ajith Ranabahu wrote: Hi, Is the packaged jar file inside the lib folder in the aar ? actually if you use the generated ant build this would placed at the right folder Ajith On 1/22/07, Bo Xie <[EMAIL PROTECTED]> wrote: Hi, My previous issue is caused by org.apache.xmlbeans.impl > .schema.SchemaTypeLoaderImpl's findTypeRef () not be able to load the following resource in service: schemaorg_apache_xmlbeans/type/http_3A_2F_2Fquickstart_2Esamples_2Fxsd/EU_2DAddress.xsb This resource is actually in my .aar file under dir\XBean-packaged.jar(generated from WSDL2JAVA) Do anyone know how to make it work? Thanks a lot! -Bo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Issue loading .xsb resource from XBean-packaged.jar in service [Was:Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type]
Hi, My previous issue is caused by org.apache.xmlbeans.impl .schema.SchemaTypeLoaderImpl's findTypeRef () not be able to load the following resource in service: schemaorg_apache_xmlbeans/type/http_3A_2F_2Fquickstart_2Esamples_2Fxsd/EU_2DAddress.xsb This resource is actually in my .aar file under dir\XBean-packaged.jar(generated from WSDL2JAVA) Do anyone know how to make it work? Thanks a lot! -Bo On 1/21/07, Bo Xie <[EMAIL PROTECTED]> wrote: Hi all, Sorry to ask this again, does anyone know what could cause the following call to return null, is it some kind of setup/configure issue in the service? How to workaround it? It is in org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl's findTypeRef (). This causes the derived type cannot be created properly with the xsi:type attribute. SchemaTypeSystem ts = typeSystemForComponent("schema" + METADATA_PACKAGE_LOAD + "/type/", name); Thanks, -Bo On 1/19/07, Bo Xie <[EMAIL PROTECTED]> wrote: > > Hi, > > Looks like the problem is with the _typeCache in > org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl's findTypeRef () > not being populated correctly for derived type when deployed as a service. > This in turn was caused by typeSystemForComponent() in findTypeRef() > returning null. As comparison, the _typeCache is populated correctly if I > run it locally in a test program's main() and in this case the > typeSystemForComponent() is not null. > > Below is the findTypeRef method which suppose to return the derived > type if Qname passed in is a derived type. In my case, the QName is {http://quickstart.samples/xsd}EU-Address > <http://quickstart.samples/xsd%7DEU-Address>. > > When in service, the _typeCache is populated with CACHED_NOT_FOUND for > QName {http://quickstart.samples/xsd}EU-Address > <http://quickstart.samples/xsd%7DEU-Address>. So findTypeRef will > return null. This will result in the changeType() call to not return the > derived type. (See call stack at the bottom.) > > In the local test program, the _typeCache was initially empty and was > populated with the correct value at the end of findTypeRef call. > > The only way that CACHED_NOT_FOUND can be set for any QName type is > when the following line in findTypeRef () return null. > SchemaTypeSystem ts = typeSystemForComponent("schema" + > METADATA_PACKAGE_LOAD + "/type/", name); > > I have no idea why this typeSystemForComponent() could return null in > service. Can someone help clarify the myth here? When I trace into the first > incoming message, it indeed shows that the typeSystemForComponent return > null! > > Below are the findTypeRef method and the call stack. > > Thanks, > -Bo > > public SchemaType.Ref findTypeRef(QName name) > { > /** > * The maps are synchronized, we use two accesses to the cache > (one read > * and one write), but the code inbetween is not synchronized. > The > * assumption is that the underlying datastructures (the search > path and > * the classloader) do not change, so two threads running the > code in > * parallel will come up with the same result. > */ > Object cached = _typeCache.get(name); > if (cached == CACHED_NOT_FOUND) > return null; ==>exit here in bad one > > SchemaType.Ref result = (SchemaType.Ref) cached; > if (result == null) > { > for (int i = 0; i < _searchPath.length; i++) > if (null != (result = _searchPath[i].findTypeRef(name))) > > break; > if (result == null) > { > SchemaTypeSystem ts = typeSystemForComponent("schema" + > METADATA_PACKAGE_LOAD + "/type/", name); > if (ts != null) > { > result = ts.findTypeRef(name); > assert(result != null) : "Type system registered > type " + QNameHelper.pretty(name) + " but does not return it"; > } > } > _typeCache.put(name, result == null ? CACHED_NOT_FOUND : > result); > } > return result; ==>exit here in good case when the typeCache.putis call with good value. > } > > > Stack: > SchemaTypeLoaderImpl.findTypeRef(QName) line: 369 > SchemaTypeLoaderImpl(SchemaTypeLoaderBase).findType(QName) line: 119 > SchemaTypeImpl.getElementType(QName, QName, SchemaTypeLoader) line: > 910 > GetAddressesResponseDocumentImpl$GetAddressesResponseImpl(XmlObjectBase).get_element_type(QName, > QName) line: 925 > Cur.setType(SchemaType, boole
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Hi all, Sorry to ask this again, does anyone know what could cause the following call to return null, is it some kind of setup/configure issue in the service? How to workaround it? It is in org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl's findTypeRef (). This causes the derived type cannot be created properly with the xsi:type attribute. SchemaTypeSystem ts = typeSystemForComponent("schema" + METADATA_PACKAGE_LOAD + "/type/", name); Thanks, -Bo On 1/19/07, Bo Xie <[EMAIL PROTECTED]> wrote: Hi, Looks like the problem is with the _typeCache in org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl's findTypeRef () not being populated correctly for derived type when deployed as a service. This in turn was caused by typeSystemForComponent() in findTypeRef() returning null. As comparison, the _typeCache is populated correctly if I run it locally in a test program's main() and in this case the typeSystemForComponent() is not null. Below is the findTypeRef method which suppose to return the derived type if Qname passed in is a derived type. In my case, the QName is {http://quickstart.samples/xsd}EU-Address <http://quickstart.samples/xsd%7DEU-Address>. When in service, the _typeCache is populated with CACHED_NOT_FOUND for QName {http://quickstart.samples/xsd}EU-Address<http://quickstart.samples/xsd%7DEU-Address>. So findTypeRef will return null. This will result in the changeType() call to not return the derived type. (See call stack at the bottom.) In the local test program, the _typeCache was initially empty and was populated with the correct value at the end of findTypeRef call. The only way that CACHED_NOT_FOUND can be set for any QName type is when the following line in findTypeRef () return null. SchemaTypeSystem ts = typeSystemForComponent("schema" + METADATA_PACKAGE_LOAD + "/type/", name); I have no idea why this typeSystemForComponent() could return null in service. Can someone help clarify the myth here? When I trace into the first incoming message, it indeed shows that the typeSystemForComponent return null! Below are the findTypeRef method and the call stack. Thanks, -Bo public SchemaType.Ref findTypeRef(QName name) { /** * The maps are synchronized, we use two accesses to the cache (one read * and one write), but the code inbetween is not synchronized. The * assumption is that the underlying datastructures (the search path and * the classloader) do not change, so two threads running the code in * parallel will come up with the same result. */ Object cached = _typeCache.get(name); if (cached == CACHED_NOT_FOUND) return null; ==>exit here in bad one SchemaType.Ref result = (SchemaType.Ref) cached; if (result == null) { for (int i = 0; i < _searchPath.length; i++) if (null != (result = _searchPath[i].findTypeRef(name))) break; if (result == null) { SchemaTypeSystem ts = typeSystemForComponent("schema" + METADATA_PACKAGE_LOAD + "/type/", name); if (ts != null) { result = ts.findTypeRef(name); assert(result != null) : "Type system registered type " + QNameHelper.pretty(name) + " but does not return it"; } } _typeCache.put(name, result == null ? CACHED_NOT_FOUND : result); } return result; ==>exit here in good case when the typeCache.put is call with good value. } Stack: SchemaTypeLoaderImpl.findTypeRef(QName) line: 369 SchemaTypeLoaderImpl(SchemaTypeLoaderBase).findType(QName) line: 119 SchemaTypeImpl.getElementType(QName, QName, SchemaTypeLoader) line: 910 GetAddressesResponseDocumentImpl$GetAddressesResponseImpl(XmlObjectBase).get_element_type(QName, QName) line: 925 Cur.setType(SchemaType, boolean) line: 2546 Xobj$ElementXobj(Xobj).change_type(SchemaType) line: 1876 AddressImpl(XmlObjectBase).changeType(SchemaType) line: 504 StockQuoteServiceSkeleton.populateAddress(GetAddressesResponseDocument) line: 281 StockQuoteServiceSkeleton.getAddresses(GetAddressesDocument) line: 226 StockQuoteServiceMessageReceiverInOut.invokeBusinessLogic(MessageContext, MessageContext) line: 73 StockQuoteServiceMessageReceiverInOut(AbstractInOutSyncMessageReceiver).receive(MessageContext) line: 39 AxisEngine.receive(MessageContext) line: 493 On 1/18/07, Bo Xie <[EMAIL PROTECTED]> wrote: > > Hi, > >Regarding the instanceOf issue, I debugged and saw the following > issue. > >1. In the WSDL2JAVA generated > GetAddressesDocumentImpl.getAddressArray, I would expect the array > element should be of type USAddressImpl if instance is a US address. This is > not the case. For example,
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Hi, Looks like the problem is with the _typeCache in org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl's findTypeRef () not being populated correctly for derived type when deployed as a service. This in turn was caused by typeSystemForComponent() in findTypeRef() returning null. As comparison, the _typeCache is populated correctly if I run it locally in a test program's main() and in this case the typeSystemForComponent() is not null. Below is the findTypeRef method which suppose to return the derived type if Qname passed in is a derived type. In my case, the QName is { http://quickstart.samples/xsd}EU-Address. When in service, the _typeCache is populated with CACHED_NOT_FOUND for QName {http://quickstart.samples/xsd}EU-Address. So findTypeRef will return null. This will result in the changeType() call to not return the derived type. (See call stack at the bottom.) In the local test program, the _typeCache was initially empty and was populated with the correct value at the end of findTypeRef call. The only way that CACHED_NOT_FOUND can be set for any QName type is when the following line in findTypeRef () return null. SchemaTypeSystem ts = typeSystemForComponent("schema" + METADATA_PACKAGE_LOAD + "/type/", name); I have no idea why this typeSystemForComponent() could return null in service. Can someone help clarify the myth here? When I trace into the first incoming message, it indeed shows that the typeSystemForComponent return null! Below are the findTypeRef method and the call stack. Thanks, -Bo public SchemaType.Ref findTypeRef(QName name) { /** * The maps are synchronized, we use two accesses to the cache (one read * and one write), but the code inbetween is not synchronized. The * assumption is that the underlying datastructures (the search path and * the classloader) do not change, so two threads running the code in * parallel will come up with the same result. */ Object cached = _typeCache.get(name); if (cached == CACHED_NOT_FOUND) return null; ==>exit here in bad one SchemaType.Ref result = (SchemaType.Ref) cached; if (result == null) { for (int i = 0; i < _searchPath.length; i++) if (null != (result = _searchPath[i].findTypeRef(name))) break; if (result == null) { SchemaTypeSystem ts = typeSystemForComponent("schema" + METADATA_PACKAGE_LOAD + "/type/", name); if (ts != null) { result = ts.findTypeRef(name); assert(result != null) : "Type system registered type " + QNameHelper.pretty(name) + " but does not return it"; } } _typeCache.put(name, result == null ? CACHED_NOT_FOUND : result); } return result; ==>exit here in good case when the typeCache.put is call with good value. } Stack: SchemaTypeLoaderImpl.findTypeRef(QName) line: 369 SchemaTypeLoaderImpl(SchemaTypeLoaderBase).findType(QName) line: 119 SchemaTypeImpl.getElementType(QName, QName, SchemaTypeLoader) line: 910 GetAddressesResponseDocumentImpl$GetAddressesResponseImpl(XmlObjectBase).get_element_type(QName, QName) line: 925 Cur.setType(SchemaType, boolean) line: 2546 Xobj$ElementXobj(Xobj).change_type(SchemaType) line: 1876 AddressImpl(XmlObjectBase).changeType(SchemaType) line: 504 StockQuoteServiceSkeleton.populateAddress(GetAddressesResponseDocument) line: 281 StockQuoteServiceSkeleton.getAddresses(GetAddressesDocument) line: 226 StockQuoteServiceMessageReceiverInOut.invokeBusinessLogic(MessageContext, MessageContext) line: 73 StockQuoteServiceMessageReceiverInOut(AbstractInOutSyncMessageReceiver).receive(MessageContext) line: 39 AxisEngine.receive(MessageContext) line: 493 On 1/18/07, Bo Xie <[EMAIL PROTECTED]> wrote: Hi, Regarding the instanceOf issue, I debugged and saw the following issue. 1. In the WSDL2JAVA generated GetAddressesDocumentImpl.getAddressArray, I would expect the array element should be of type USAddressImpl if instance is a US address. This is not the case. For example, all elements in targetList filled by find_all_element_users() are instances of AddressImpl not USAddressImpl when the XML element is as follows: http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://quickstart.samples/xsd"; xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> http://quickstart.samples/xsd";>Cupertino http://quickstart.samples/xsd";>XYZ http://quickstart.samples/xsd";>CA http://quickstart.samples/xsd";>95014 This kind of explained why the instanceof is not working properly in service code. Any idea why it is done this way? Is it a bug? public samples.quickstart.service.xmlbeans.xsd.Address[] getAddressesArray
How to get session cookie
Hi, I have set a service to transport session scope and the session context worked as expected. But when I try to get the session cookie id, it always returns null. MessageContext cxt = MessageContext.getCurrentMessageContext(); SessionContext session = cxt.getSessionContext(); String cookieId = session.getCookieID(); On the client side, I used the following code, it also always return null. stub._getServiceClient().getOptions().getProperty( org.apache.axis2.transport. http.HTTPConstants.COOKIE_STRING) Can someone shed some lights on how to get the cookie? Thanks, -Bo
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Hi, Regarding the instanceOf issue, I debugged and saw the following issue. 1. In the WSDL2JAVA generated GetAddressesDocumentImpl.getAddressArray, I would expect the array element should be of type USAddressImpl if instance is a US address. This is not the case. For example, all elements in targetList filled by find_all_element_users() are instances of AddressImpl not USAddressImpl when the XML element is as follows: http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd=" http://quickstart.samples/xsd"; xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/";> http://quickstart.samples/xsd";>Cupertino http://quickstart.samples/xsd";>XYZ http://quickstart.samples/xsd";>CA http://quickstart.samples/xsd";>95014 This kind of explained why the instanceof is not working properly in service code. Any idea why it is done this way? Is it a bug? public samples.quickstart.service.xmlbeans.xsd.Address[] getAddressesArray() { synchronized (monitor()) { check_orphaned(); java.util.List targetList = new java.util.ArrayList(); get_store().find_all_element_users(ADDRESSES$2, targetList); samples.quickstart.service.xmlbeans.xsd.Address[] result = new samples.quickstart.service.xmlbeans.xsd.Address[targetList.size()]; targetList.toArray(result); return result; } } Thanks, -Bo On 1/17/07, Bo Xie <[EMAIL PROTECTED]> wrote: Hi Ramesh, Sorry to get back on this late. I noticed that the same code behave differently when invoked standalone(from main()), or from the service. From standalone, the xsi:type are in the XML properly(same as your test). While from service, the xsi:type attribute are missing. Please see attached file test program. They are calling the same method(populateAddress(). I am just wondering if there is any setting on the service side that may influence the generation of the xsi:type? Below are the XML output from two cases and the populateAddress method. Thanks, -Bo XML dump when running from main(). xsi:type is generated. http://quickstart.samples/xsd";> http://www.w3.org/2001/XMLSchema-instance";> Sunnyvale XYZ CA 94087 http://www.w3.org/2001/XMLSchema-instance";> Hongkong XYZ 2300331 E.C XML dump when running as service. xsi:type is missing. http://quickstart.samples/xsd "> Sunnyvale XYZ CA 94087 Hongkong XYZ 2300331 E.C The populateAddress method. private static void populateAddress(GetAddressesResponseDocument resDoc) { // TODO Auto-generated method stub GetAddressesResponseDocument.GetAddressesResponse res = resDoc.addNewGetAddressesResponse(); samples.quickstart.service.xmlbeans.xsd.Address[] addArray = new samples.quickstart.service.xmlbeans.xsd.Address [2]; samples.quickstart.service.xmlbeans.xsd.USAddress addr = samples.quickstart.service.xmlbeans.xsd.USAddress.Factory.newInstance(); //samples.quickstart.service.xmlbeans.xsd.USAddress addr = samples.quickstart.service.xmlbeans.xsd.USAddress.Factory.newInstance(); addr.setName("XYZ"); addr.setCity("Sunnyvale"); addr.setState(USState.CA); addr.setZip (new BigInteger("94087")); //samples.quickstart.service.xmlbeans.xsd.EUAddress addr1 = (EUAddress) res.addNewAddresses().changeType(EUAddress.type); samples.quickstart.service.xmlbeans.xsd.EUAddress addr1 = samples.quickstart.service.xmlbeans.xsd.EUAddress.Factory.newInstance(); addr1.setName("XYZ"); addr1.setCity("Hongkong"); addr1.setExportCode(new BigInteger("66553322")); addr1.setPostcode("2300331 E.C"); addArray[0] = addr; addArray[1] = addr1; res.setAddressesArray(addArray); XmlOptions ops = new XmlOptions(); ops.setSavePrettyPrint(); ops.setSavePrettyPrintIndent(4); //String xmlStr = res.xmlText(ops); //System.out.println("Response Element String: \n" + xmlStr); String xmlStr1 = resDoc.xmlText(ops); System.out.println("Response Document String: \n" + xmlStr1); } On 1/8/07, Ramesh Gurunathan < [EMAIL PROTECTED]> wrote: > > Hi Bo, > > Sorry for getting back so late. I missed your mail from my email pool. > > I indeed used axis2 1.1 and with xbean-2.2.0.jar that is shipped with > the release. This is what I did to prove that polymorphism in XML > works. My schema defines three complex types - BaseAddress, USAddress, > and UKAddress. The second item extends first and the third item > extends second. There is an element called 'UpdateCu
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Hi Ramesh, Sorry to get back on this late. I noticed that the same code behave differently when invoked standalone(from main()), or from the service. From standalone, the xsi:type are in the XML properly(same as your test). While from service, the xsi:type attribute are missing. Please see attached file test program. They are calling the same method(populateAddress(). I am just wondering if there is any setting on the service side that may influence the generation of the xsi:type? Below are the XML output from two cases and the populateAddress method. Thanks, -Bo XML dump when running from main(). xsi:type is generated. http://quickstart.samples/xsd";> http://www.w3.org/2001/XMLSchema-instance";> Sunnyvale XYZ CA 94087 http://www.w3.org/2001/XMLSchema-instance";> Hongkong XYZ 2300331 E.C XML dump when running as service. xsi:type is missing. http://quickstart.samples/xsd";> Sunnyvale XYZ CA 94087 Hongkong XYZ 2300331 E.C The populateAddress method. private static void populateAddress(GetAddressesResponseDocument resDoc) { // TODO Auto-generated method stub GetAddressesResponseDocument.GetAddressesResponse res = resDoc.addNewGetAddressesResponse(); samples.quickstart.service.xmlbeans.xsd.Address[] addArray = new samples.quickstart.service.xmlbeans.xsd.Address[2]; samples.quickstart.service.xmlbeans.xsd.USAddress addr = samples.quickstart.service.xmlbeans.xsd.USAddress.Factory.newInstance(); //samples.quickstart.service.xmlbeans.xsd.USAddress addr = samples.quickstart.service.xmlbeans.xsd.USAddress.Factory.newInstance(); addr.setName("XYZ"); addr.setCity("Sunnyvale"); addr.setState(USState.CA); addr.setZip(new BigInteger("94087")); //samples.quickstart.service.xmlbeans.xsd.EUAddress addr1 = (EUAddress) res.addNewAddresses().changeType(EUAddress.type); samples.quickstart.service.xmlbeans.xsd.EUAddress addr1 = samples.quickstart.service.xmlbeans.xsd.EUAddress.Factory.newInstance(); addr1.setName("XYZ"); addr1.setCity("Hongkong"); addr1.setExportCode(new BigInteger("66553322")); addr1.setPostcode("2300331 E.C"); addArray[0] = addr; addArray[1] = addr1; res.setAddressesArray(addArray); XmlOptions ops = new XmlOptions(); ops.setSavePrettyPrint(); ops.setSavePrettyPrintIndent(4); //String xmlStr = res.xmlText(ops); //System.out.println("Response Element String: \n" + xmlStr); String xmlStr1 = resDoc.xmlText(ops); System.out.println("Response Document String: \n" + xmlStr1); } On 1/8/07, Ramesh Gurunathan <[EMAIL PROTECTED]> wrote: Hi Bo, Sorry for getting back so late. I missed your mail from my email pool. I indeed used axis2 1.1 and with xbean-2.2.0.jar that is shipped with the release. This is what I did to prove that polymorphism in XML works. My schema defines three complex types - BaseAddress, USAddress, and UKAddress. The second item extends first and the third item extends second. There is an element called 'UpdateCustomerAddress' that includes, by signature, type BaseAddress unbounded. The element could be used in the WSDL messages, but I didn't want go there. Now I complied the schema using the schema compiler tool from XML beans. (It makes no difference whether you use WSDL2Java of axis2 or directly compile using scomp of XML beans). I then wrote a test class, which uses the XML beans classes generated classes, to verify the runtime object type for the address property in UpdateCustomerAddress document. Please refer to the attachment for the schema and test class. In essence, the test class creates an XML programmatically, which contains a BaseAddress, an USAddress, and UKAddress all bound to the addresses property. Then it dumps the objects into XML, re-parses it, and examines the objects using instanceof operator to ensure that the types are correctly created. The test output is also in the attachment. TIP: I am not sure if this is significant, but ensure that your schema's elementFormDefault is "qualified" I hope this helps you. Ramesh On 1/9/07, Bo Xie <[EMAIL PROTECTED]> wrote: > Hi Ramesh, > > Did you by any chance use Axis2 1.1.1 instead of 1.1 for your testing? > If you indeed used 1.1 only, can you give some details on how did you test > the instanceof? BTW, I opened AXIS2-1938 for this issue before saw your last > reply. > > Thanks, > -Bo > > > On 1/5/07, Bo Xie <[EMAIL PROTECTED]> wrote: > > Hi Ramesh, > > > > It is comforting to know it actually works. Thanks for trying it out. > > > > I was u
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Hi Ramesh, Did you by any chance use Axis2 1.1.1 instead of 1.1 for your testing? If you indeed used 1.1 only, can you give some details on how did you test the instanceof? BTW, I opened AXIS2-1938<http://issues.apache.org/jira/browse/AXIS2-1938>for this issue before saw your last reply. Thanks, -Bo On 1/5/07, Bo Xie <[EMAIL PROTECTED]> wrote: Hi Ramesh, It is comforting to know it actually works. Thanks for trying it out. I was using axis2. 1.1 and I just reinstall the axis2 1.1 and tried it again, still get the same problem. I have two question. 1. When you mentioned XML Bean 2.2.0, it is the one xbean-2.2.0.jarcomes with the axis2 package, not an outside jar, right? 2. Do you mind share the test wsdl and the source file that you did the instanceof test. I would like to see if I am not doing the right thing using the generated object. Did you see the xsi:type in the soap message for both directions? Thanks, -Bo On 1/5/07, Ramesh Gurunathan < [EMAIL PROTECTED]> wrote: > > Hi Guys, > > I tested this today against axis2 1.1 [XML beans 2.2.0]. It actually > works. The instanceof check passes. I then switched to Debug > perspective to introspect the object type, everything looks perfect. > > Bo - Try again and see if you can duplicate the problem in axis2 1.1 > > Ramesh > > On 1/4/07, Ajith Ranabahu <[EMAIL PROTECTED]> wrote: > > Hi, > > > > > Hi Ajith, > > > > > >The Address class only has getter and setter for name, city etc. > No > > > getAddress. Do you see this ignoring of xsi:type in creating > instance as a > > > bug? > > > > Yep. It is a bug. But AFAIK it was reported to be working. In any case > > you can file a Jira with your schema. > > > > Ajith > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: [axis2] Advice on how to tell which version of WSDL the client is using.
Thanks Anne. It is clear now what I should when the version is backward compatible. When the version is not backward compatible, according you suggestion. We should use new name space. Can you help on the following 1. Should the client use the same URL to access the new service? 2. If the client can use the same URL, what kind of experience he should get? An fault from the server? Is this something Axis2 provide, or it is the service implementation to check and handle? Thanks, -Bo On 1/6/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote: Only if there is some way to distinguish the messages based on content. The systems are loosely coupled. The only information available to the service is the information conveyed in the message. If you can't distinguish the versions based on the message, there's no way to determine the version of the client. You could force a differentiation by including a version id in either the header or the body, but if the systems truly are compatible, then it seems inappropriate to impose that kind of system information on the client. Anne On 1/6/07, Bo Xie <[EMAIL PROTECTED]> wrote: > Thanks Ann. > > In the case where the updated version is backward compatible, but I still > want to know the version level the client is at, what's the best way of > doing that, does the framework itself provide any support? > > Thanks, > -Bo > > > On 1/6/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote: > > > > If the message formats for the messages are incompatible, then you > > should change the namespace of the top-level message element between > > versions. > > > > Anne > > > > On 1/6/07, Bo Xie < [EMAIL PROTECTED]> wrote: > > > Hi all, > > > > > >I need some advice on handling client using old WSDL. Say I made some > > > change in WSDL and publish a updated service. > > >- How can we tell if the client request is based on the old WSDL or > new > > > WSDL so the service can act accordingly? > > >- What's the best practice to deal the client that is still using the > old > > > WSDL in case the new WSDL is or is not compatible with the old one? > > > > > >Thanks in advance for your time. > > > > > > -Bo > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [axis2] Advice on how to tell which version of WSDL the client is using.
Thanks Ann. In the case where the updated version is backward compatible, but I still want to know the version level the client is at, what's the best way of doing that, does the framework itself provide any support? Thanks, -Bo On 1/6/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote: If the message formats for the messages are incompatible, then you should change the namespace of the top-level message element between versions. Anne On 1/6/07, Bo Xie <[EMAIL PROTECTED]> wrote: > Hi all, > >I need some advice on handling client using old WSDL. Say I made some > change in WSDL and publish a updated service. >- How can we tell if the client request is based on the old WSDL or new > WSDL so the service can act accordingly? >- What's the best practice to deal the client that is still using the old > WSDL in case the new WSDL is or is not compatible with the old one? > >Thanks in advance for your time. > > -Bo > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[axis2] Advice on how to tell which version of WSDL the client is using.
Hi all, I need some advice on handling client using old WSDL. Say I made some change in WSDL and publish a updated service. - How can we tell if the client request is based on the old WSDL or new WSDL so the service can act accordingly? - What's the best practice to deal the client that is still using the old WSDL in case the new WSDL is or is not compatible with the old one? Thanks in advance for your time. -Bo
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Hi Ramesh, It is comforting to know it actually works. Thanks for trying it out. I was using axis2. 1.1 and I just reinstall the axis2 1.1 and tried it again, still get the same problem. I have two question. 1. When you mentioned XML Bean 2.2.0, it is the one xbean-2.2.0.jarcomes with the axis2 package, not an outside jar, right? 2. Do you mind share the test wsdl and the source file that you did the instanceof test. I would like to see if I am not doing the right thing using the generated object. Did you see the xsi:type in the soap message for both directions? Thanks, -Bo On 1/5/07, Ramesh Gurunathan < [EMAIL PROTECTED]> wrote: Hi Guys, I tested this today against axis2 1.1 [XML beans 2.2.0]. It actually works. The instanceof check passes. I then switched to Debug perspective to introspect the object type, everything looks perfect. Bo - Try again and see if you can duplicate the problem in axis2 1.1 Ramesh On 1/4/07, Ajith Ranabahu <[EMAIL PROTECTED]> wrote: > Hi, > > > Hi Ajith, > > > >The Address class only has getter and setter for name, city etc. No > > getAddress. Do you see this ignoring of xsi:type in creating instance as a > > bug? > > Yep. It is a bug. But AFAIK it was reported to be working. In any case > you can file a Jira with your schema. > > Ajith > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Hi Ajith, The Address class only has getter and setter for name, city etc. No getAddress. Do you see this ignoring of xsi:type in creating instance as a bug? Besides using choice option as Ramesh suggested, do we run out of luck here? I am a little hesitate to use choice as in my case, the choice list changes quite fast. Keeping track of the exhaustive list of all the choices is a challenge. Thanks, -Bo On 1/3/07, Ajith Ranabahu <[EMAIL PROTECTED]> wrote: Hi, It seems to me that you have to go one level deep. See whether there is a getAddress method in the Address class. XMLBeans generates a lot of classes and things are a bit confusing specially when types and elements have similar names. AFAIK XMLBeans generates a class per type and element. So there would be a class generated for the address type and also for the address element. My guess is you have to check the address type object instead of the address element object. Ajith On 1/3/07, Bo Xie <[EMAIL PROTECTED]> wrote: > Thanks Ajith. Could you be more specific on how to figure out the right type > of the instance? Here is the code snippet and the output on the service > side. > The getAddressArray indeed returns Address[] which is good. But the > instanceof always returns Address even for USAddress instance. The > interesting thing is the toString output of the addr variable. It includes > the correct xsi-type for each instance. So how can I do the correct > instanceof to figure the right type to cast in this case? > > Thanks, > -Bo > > Code snippet > public void > updateAddresses( samples.quickstart.service.xmlbeans.xsd.UpdateAddressesDocument > param3) > { > //Todo fill this with the necessary business logic > String symbol = param3.getUpdateAddresses().getSymbol(); > System.err.println(getCurrentTime()+"- Update Symbol:" + symbol); > > Address[] addrs = param3.getUpdateAddresses().getAddressesArray(); > for (int i = 0; i < addrs.length; i++) { > Address addr = addrs[i]; > if(addr instanceof USAddress) System.err.println("USAddress > instance"); > if(addr instanceof Address) System.err.println("Address > instance"); > System.err.println(addr.getClass().getName()+":"+addr); > } >...} > > Output from the code > Address instance > samples.quickstart.service.xmlbeans.xsd.impl.AddressImpl: > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xmlns:xsd=" http://quickstart.samples/xsd"; > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> > http://quickstart.samples/xsd";>company name > http://quickstart.samples/xsd";>Sunnyvale > http://quickstart.samples/xsd";>CA > http://quickstart.samples/xsd";>94087 > > > Address instance > samples.quickstart.service.xmlbeans.xsd.impl.AddressImpl: xsi:type="xsd:Address" xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance"; > xmlns:ns1="http://quickstart.samples/xsd"; > xmlns:xsd="http://quickstart.samples/xsd " > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> > http://quickstart.samples/xsd ">company > http://quickstart.samples/xsd";>Hong Kong > > > > On 1/3/07, Ajith Ranabahu <[EMAIL PROTECTED]> wrote: > > Hi, > > Since the xsi:type attribute is present and points to the USAddress, > > the generated object should be of type USAddress. Perhaps the problem > > is the way you check the instanceof. I mean XMLBeans should have > > generated a getAddresses method to updateAddress ? (It's a little bit > > weird how XMLBeans treats these schemas but I'm guessing) > > If you can use a debugger and go through the object hierarchy at > > runtime you should be able to figure this out > > > > Ajith > > > > On 1/3/07, Bo Xie <[EMAIL PROTECTED]> wrote: > > > Thanks Ajith for the quick response. > > > > > > I have tried to use the instanceof to test if the instance is USAddress, > > > but the test returns false. Without that, the type cast is not safe as > > > the Address list can have items of either Address or USAddress. My > > > question here is should the java instance created from XML be of type > > > USAddress even though the signature is Address. Is there anyway to make > > > this happen? > > > > > > Thanks, > > > -Bo > > > Ajith Ranabahu wrote: > > > > Hi, > > > > The reason here is that you have set the type of the addresses element > > > > to be '
Re: [Axis2] is WSDL 2.0 fully supported in Axis2 1.1
Got it. Thanks, Anne. -Bo On 1/3/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote: Axis 2 provides experimental support for WSDL 2.0 through Woden. Note: WSDL 2.0 is not a completed or final specification. You should NOT use WSDL 2.0 in any production application at this time. If you're just experimenting, fine. But be prepared for the spec to change and to toss out anything you're building today. Anne On 1/3/07, Bo Xie <[EMAIL PROTECTED]> wrote: > Hi everyone. > > From the Axis2 home page, it lists WSDL 1.1 as supported version. But there > are numerous places WSDL 2.0 support is mentioned including WSDL2JAVA. Can > anyone clarify if WSDL 2.0 is supported in Axis2 1.1 ? If so, to what level? > I am looking at using the extension and include features in WSDL 2.0 > > Thanks, > -Bo > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Axis2] is WSDL 2.0 fully supported in Axis2 1.1
Hi everyone. From the Axis2 home page, it lists WSDL 1.1 as supported version. But there are numerous places WSDL 2.0 support is mentioned including WSDL2JAVA. Can anyone clarify if WSDL 2.0 is supported in Axis2 1.1? If so, to what level? I am looking at using the extension and include features in WSDL 2.0 Thanks, -Bo
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Thanks Ajith. Could you be more specific on how to figure out the right type of the instance? Here is the code snippet and the output on the service side. The getAddressArray indeed returns Address[] which is good. But the instanceof always returns Address even for USAddress instance. The interesting thing is the toString output of the addr variable. It includes the correct xsi-type for each instance. So how can I do the correct instanceof to figure the right type to cast in this case? Thanks, -Bo Code snippet public void updateAddresses( samples.quickstart.service.xmlbeans.xsd.UpdateAddressesDocument param3) { //Todo fill this with the necessary business logic String symbol = param3.getUpdateAddresses().getSymbol(); System.err.println(getCurrentTime()+"- Update Symbol:" + symbol); Address[] addrs = param3.getUpdateAddresses().getAddressesArray(); for (int i = 0; i < addrs.length; i++) { Address addr = addrs[i]; if(addr instanceof USAddress) System.err.println("USAddress instance"); if(addr instanceof Address) System.err.println("Address instance"); System.err.println(addr.getClass().getName()+":"+addr); } ...} Output from the code Address instance samples.quickstart.service.xmlbeans.xsd.impl.AddressImpl:http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd=" http://quickstart.samples/xsd"; xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/";> http://quickstart.samples/xsd";>company name http://quickstart.samples/xsd";>Sunnyvale http://quickstart.samples/xsd";>CA http://quickstart.samples/xsd";>94087 Address instance samples.quickstart.service.xmlbeans.xsd.impl.AddressImpl:http://www.w3.org/2001/XMLSchema-instance"; xmlns:ns1="http://quickstart.samples/xsd"; xmlns:xsd=" http://quickstart.samples/xsd"; xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/";> http://quickstart.samples/xsd";>company http://quickstart.samples/xsd";>Hong Kong On 1/3/07, Ajith Ranabahu <[EMAIL PROTECTED]> wrote: Hi, Since the xsi:type attribute is present and points to the USAddress, the generated object should be of type USAddress. Perhaps the problem is the way you check the instanceof. I mean XMLBeans should have generated a getAddresses method to updateAddress ? (It's a little bit weird how XMLBeans treats these schemas but I'm guessing) If you can use a debugger and go through the object hierarchy at runtime you should be able to figure this out Ajith On 1/3/07, Bo Xie <[EMAIL PROTECTED]> wrote: > Thanks Ajith for the quick response. > > I have tried to use the instanceof to test if the instance is USAddress, > but the test returns false. Without that, the type cast is not safe as > the Address list can have items of either Address or USAddress. My > question here is should the java instance created from XML be of type > USAddress even though the signature is Address. Is there anyway to make > this happen? > > Thanks, > -Bo > Ajith Ranabahu wrote: > > Hi, > > The reason here is that you have set the type of the addresses element > > to be 'Address' rather than USAddress (the code generator would put > > the reference for the Address rather than the USAddress). However > > since the xsi:type attribute is present the deserializer should create > > the right object and you can just use a type cast to get to the right > > object. > > > > HTH > > > > Ajith > > > > On 1/2/07, Bo Xie <[EMAIL PROTECTED]> wrote: > >> Hi there, > >> > >> I am new to axis2 with XMLBean data binding, please help me with the > >> following issue. > >> > >> I modified the quickstart sample XMLBean program to try a WSDL with > >> the > >> following types. The type US-Address is a derived from type Address. > >> I would > >> like to create a service operation updateAddresses to change > >> addresses of a > >> company based on a symbol. The addresses is an array that can take > >> either > >> Address or USAddress instances. > >> > >> > >> > >> >> minOccurs="0"/> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> >> type="ipo:US-State"/> > >> >>
Re: [axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Thanks Ajith for the quick response. I have tried to use the instanceof to test if the instance is USAddress, but the test returns false. Without that, the type cast is not safe as the Address list can have items of either Address or USAddress. My question here is should the java instance created from XML be of type USAddress even though the signature is Address. Is there anyway to make this happen? Thanks, -Bo Ajith Ranabahu wrote: Hi, The reason here is that you have set the type of the addresses element to be 'Address' rather than USAddress (the code generator would put the reference for the Address rather than the USAddress). However since the xsi:type attribute is present the deserializer should create the right object and you can just use a type cast to get to the right object. HTH Ajith On 1/2/07, Bo Xie <[EMAIL PROTECTED]> wrote: Hi there, I am new to axis2 with XMLBean data binding, please help me with the following issue. I modified the quickstart sample XMLBean program to try a WSDL with the following types. The type US-Address is a derived from type Address. I would like to create a service operation updateAddresses to change addresses of a company based on a symbol. The addresses is an array that can take either Address or USAddress instances. minOccurs="0"/> type="ipo:US-State"/> I used WSDL2JAVA with XMLBean data binding to generate the skeleton and stub code. All looks great and the SOAP exchange looks fine too. In the client code, I created one instance if USAddress and one instance of Address and put them into the addresses list. In the SOAP request message, the instances are as shown as follows below. Note, xsi-type for the instance indicate the correct types which is nice. http://quickstart.samples/xsd";> XYZ http://quickstart.samples/xsd"; xsi:type="xsd:US-Address"> company name Sunnyvale CA 94087 http://quickstart.samples/xsd " xsi:type="xsd:Address"> company name Hong Kong The problem is when the XML object mapped into java object on the service side, all the XML address object passed to the skeleton are all of Address type. I would expect one instance be Address type, another be USAddress type. Since xsi-type in the SOAP message has the right type, why the XMLBean object is not created as the derived type? Is there any option in WSDL2JAVA to make this work? From the XMLBean Address java object, how can I access the xsi-type attribute that was available in the XML string? If I am not heading the right direction, can anyone suggest some alternatives? Thanks for your time! -Bo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[axis2] WSDL2JAVA with XMLBean binding does not create instance of the derived type
Hi there, I am new to axis2 with XMLBean data binding, please help me with the following issue. I modified the quickstart sample XMLBean program to try a WSDL with the following types. The type US-Address is a derived from type Address. I would like to create a service operation updateAddresses to change addresses of a company based on a symbol. The addresses is an array that can take either Address or USAddress instances. I used WSDL2JAVA with XMLBean data binding to generate the skeleton and stub code. All looks great and the SOAP exchange looks fine too. In the client code, I created one instance if USAddress and one instance of Address and put them into the addresses list. In the SOAP request message, the instances are as shown as follows below. Note, xsi-type for the instance indicate the correct types which is nice. http://quickstart.samples/xsd";> XYZ http://quickstart.samples/xsd"; xsi:type="xsd:US-Address"> company name Sunnyvale CA 94087 http://quickstart.samples/xsd"; xsi:type="xsd:Address"> company name Hong Kong The problem is when the XML object mapped into java object on the service side, all the XML address object passed to the skeleton are all of Address type. I would expect one instance be Address type, another be USAddress type. Since xsi-type in the SOAP message has the right type, why the XMLBean object is not created as the derived type? Is there any option in WSDL2JAVA to make this work? From the XMLBean Address java object, how can I access the xsi-type attribute that was available in the XML string? If I am not heading the right direction, can anyone suggest some alternatives? Thanks for your time! -Bo
Can I use Axis-C for http transport?
Hi all, I found there were HTTPTransport.dll and HTTPChannel.dll in axis-c-1.6b-Win32-trace-bin\bin directory. My question is: Can I use Axis-C for http transport? e.g., like windows API "URLDownloadToFile"[1] or libcurl[2]? If Yes, how to do it? Is there any sample source code? Reference 1. http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/moniker/reference/functions/urldownloadtofile.asp 2. http://curl.haxx.se/libcurl/ Thank you very much! Best Regards, Xie, Bo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]