[Axis2] Unordered elements in response
Hi, I'm using JiBX for databinding and in my response, the sub-elements of the object that gets marshalled, appear to not be in the order that the schema reflects. The schema uses 'sequence' keyword to order the sub-elements, but the response has the elements jumbled. The object to be marshalled (UserBean) has an implementation for toString and also encapsulates lot more information than what needs to be exposed to the outside world as part of the Web Service response. I see that the response element in the SOAP envelope has sub-elements ordered in the same sequence as in the output of the toString method. To better understand, if you consider that the following is the output of the toString method, ... ... ... ... and only fields B,D are to be exposed and defined as part of the response object in the schema, the SOAP envelope contains the following information; ... ... although the schema defines a sequence with element D to appear before B. The JiBX documentation says that no additional coding is required to support "sequence", but things are not working properly in my case. Can anyone throw some light on this problem. Thanks in advance, vedha -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
{Axis2] contextRoot and servicePath settings
Hi, I use Axis2-1.1.1 version as an embedded webapp in Tomcat 5.5.17. I've deployed my service and the endpoint to this service is http://localhost:8080/Comergent/ws/matrix/services/UserService . Without changing the settings for contextRoot and servicePath properties in axis2.xml, the service is never found on the server side. So, I tried to change these settings in axis2.xml file, the values being; contextRoot -> Comergent/ws servicePath -> matrix/services But, I still face the same problem wherein none of the dispatchers are able to locate the service. My queries: 1. Given that all endpoints will have a common context http://localhost:8080/Comergent/ws , should'nt this be the context root value? 2. The URL includes a dynamic property in that, the endpoint follows this pattern, http://localhost:8080/Comergent/ws//services/ . What should the values for contextRoot and servicePath be in this case. 3. Are these the only parameters i need to modify, or are there any other parameters that need modification. Thanks in advance. vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Axis2] JiBX schema generation problem
Hi, I'm using Axis2-1.1.1 and i'm trying to generate the schema for a binding xml file using jibx SchemaGenerator tool. However, even though i run this before and was successfully able to generate the schema, when i run this tool again, I'm getting "Error: Could not find information for class " error. The classpath is set correctly to find the class file, but no matter what, I keep running into this issue. Can someone please let me know what could be the reason for this. Thanks, vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Service not found problem
I think, the reason why this problem occurs is because of the combination of usin "unwrapped" elements in my wsdl and the wsdl importing the schema defined in a different namespace. The input parameter to "getUser" operation defined in the wsdl, is userContactBean which is in a namespace that is different from the wsdl's namespace. The incoming SOAP element's root object is "userContactBean" and since its namespace is different to that of the service namespace, the SOAPMessageBodyBasedDispatcher cannot locate the service. This is my theory. Can someone ratify this. Also, if i were to continue using "unwrapped" style, what do i need to do to overcome this service location issue. Thanks in advance. vedha On Thu, 2007-02-01 at 14:44 -0800, Vedha Vijayan wrote: > Yes, the services.xml does describe the UserService. I've attached the > services.xml file and the wsdl. > > Thanks, > vedha > > On Thu, 2007-02-01 at 17:36 -0500, Sathija Pavuluri wrote: > > Does your services.xml describe the UserService? > > > > > > > Hi, > > > > > > I'm having trouble fixing the "Service not found operation terminated" > > > problem. > > > > > > The end point in my wsdl in > > > "http://localhost:8080/Comergent/ws/matrix/services/UserService";. I've > > > turned on logging and i see in the logs on the server side, that the > > > 'RequestURIBasedDispatcher handler is trying to parse the request URI > > > which is > > > "http://localhost:8080/Comergent/ws/matrix/services/UserService";, same > > > as the defined in the wsdl. However, the RequestURIBasedDispatcher does > > > not find the service and neither can any of the other dispatchers find > > > the service. The soap action does have the operation parameter > > > (action="urn:getUser") set. I've configured axis2 as an embedded webapp. > > > Is this causing the problem when the dispatchers are trying to locate > > > the service? Can anyone let me know where i've gone wrong. > > > > > > Thanks in advance, > > > vedha > > > > > > > > > > > > > > > - > > > 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] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Vedha Vijayan Senior Software Engineer Comergent Technologies Inc. Ph: 650 232 5833 Fax: 650 232 6010 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Service not found problem
Yes, the services.xml does describe the UserService. I've attached the services.xml file and the wsdl. Thanks, vedha On Thu, 2007-02-01 at 17:36 -0500, Sathija Pavuluri wrote: > Does your services.xml describe the UserService? > > > > Hi, > > > > I'm having trouble fixing the "Service not found operation terminated" > > problem. > > > > The end point in my wsdl in > > "http://localhost:8080/Comergent/ws/matrix/services/UserService";. I've > > turned on logging and i see in the logs on the server side, that the > > 'RequestURIBasedDispatcher handler is trying to parse the request URI > > which is > > "http://localhost:8080/Comergent/ws/matrix/services/UserService";, same > > as the defined in the wsdl. However, the RequestURIBasedDispatcher does > > not find the service and neither can any of the other dispatchers find > > the service. The soap action does have the operation parameter > > (action="urn:getUser") set. I've configured axis2 as an embedded webapp. > > Is this causing the problem when the dispatchers are trying to locate > > the service? Can anyone let me know where i've gone wrong. > > > > Thanks in advance, > > vedha > > > > > > > > > > - > > 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] > -- Vedha Vijayan services.xml Description: application/xml http://schemas.xmlsoap.org/wsdl/http/"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:types="http://www.comergent.com/webservices/versions/1.0/types"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:ns="http://www.comergent.com/webservices/versions/1.0/wservices"; targetNamespace="http://www.comergent.com/webservices/versions/1.0/wservices";> http://www.w3.org/2001/XMLSchema"; attributeFormDefault="qualified" elementFormDefault="qualified" xmlns:types="http://www.comergent.com/webservices/versions/1.0/types"; targetNamespace="http://www.comergent.com/webservices/versions/1.0/wservices";> http://www.comergent.com/webservices/versions/1.0/types"; schemaLocation="UserContactBean.xsd" />
Service not found problem
Hi, I'm having trouble fixing the "Service not found operation terminated" problem. The end point in my wsdl in "http://localhost:8080/Comergent/ws/matrix/services/UserService";. I've turned on logging and i see in the logs on the server side, that the 'RequestURIBasedDispatcher handler is trying to parse the request URI which is "http://localhost:8080/Comergent/ws/matrix/services/UserService";, same as the defined in the wsdl. However, the RequestURIBasedDispatcher does not find the service and neither can any of the other dispatchers find the service. The soap action does have the operation parameter (action="urn:getUser") set. I've configured axis2 as an embedded webapp. Is this causing the problem when the dispatchers are trying to locate the service? Can anyone let me know where i've gone wrong. Thanks in advance, vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2] Service Endpoint related question
I was hoping that someone will answer my queries. But since i didnt get any reply yet, I did some more digging and I see that from the "Re: [Axis2] Problem with endpoint in wsdl" thread, that there is a bug in Axis2 1.1.1 with respect to the soap address being different for Soap 11 and Soap 12 protocols. Is this correct? Is there a fix for this already? Can someone please let me know as to how i can overcome the issues i'm facing. Thanks, vedha On Mon, 2007-01-29 at 17:16 -0800, Vedha Vijayan wrote: > Hi, > > I have few questions regarding the service end point in a wsdl: (I'm > using Axis2 1.1.1 version) > > My initial endpoint for UserService was > http://localhost:8080/Comergent/services/UserService, and things worked > fine. I have Axis2 installed as an embedded webapp. I wanted my service > endpoint to point to > http://localhost:8080/Comergent/ws/matrix/services/UserService instead. > My wsdl is updated to reflect this change. I have a custom wsdl that is > part of the UserService.aar file and the services.xml has the > 'useOriginalwsdl' property set. On the browser when i point to > http://localhost:8080/Comergent/ws/matrix/services/UserService?wsdl the > wsdl obtained is different from the custom wsdl. The auto-generated wsdl > has two bindings one for Soap11 and another for Soap12. The Soap11 > binding for some reason points to my initial endpoint > ( http://localhost:8080/Comergent/services/UserService ), but the Soap12 > binding has the newer end point. > > 1. Although the custom wsdl has both bindings pointing to the newer > URL, why does the auto-generated wsdl use different binding for > Soap11? And why doesnt the 'useOriginalwsdl' property though set > to true, not work in my case? > 2. Are there any changes to be made on the server side in-order to > map the updated URL to service archive file? (Other than the > necessary modifications to web.xml to include the > servlet-mapping for updated URL) > > > The client stub has the following line to set the appropriate Soap > version; > > > _serviceClient.getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI); > > > Even then, when i run my client with the newer endpoint, I hit the > following problem; > > org.apache.axis2.AxisFault: Service not found operation terminated !! > [java] at > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:271) > [java] at > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202) > > > I have setup SOAPMonitor on the server side and I dont see any request > coming in at all. This leads me to believe that the in pre-dispatch > phase none of the dispatchers are able to locate the operation within > the service. > > However, when the client is run with the older endpoint, the server is > still able to honor the request and send back the response. This > behavior leads to another set of questions I have: > > 3. What information is used by the dispatchers to verify the existence > of an operation within a service? > > 4. I have a scenario, where in the service endpoint is determined at > runtime based on location of the incoming request. Given this scenario, > how does one map the service class to multiple end points. The wsdl > location is generated at runtime and the client then invokes the > operation defined within the service. On the server-side, how do we > handle this in terms of verifying the service location? > > > Thanks in advance. > > vedha > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Vedha Vijayan Senior Software Engineer Comergent Technologies Inc. Ph: 650 232 5833 Fax: 650 232 6010 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Axis2] Service Endpoint related question
Hi, I have few questions regarding the service end point in a wsdl: (I'm using Axis2 1.1.1 version) My initial endpoint for UserService was http://localhost:8080/Comergent/services/UserService, and things worked fine. I have Axis2 installed as an embedded webapp. I wanted my service endpoint to point to http://localhost:8080/Comergent/ws/matrix/services/UserService instead. My wsdl is updated to reflect this change. I have a custom wsdl that is part of the UserService.aar file and the services.xml has the 'useOriginalwsdl' property set. On the browser when i point to http://localhost:8080/Comergent/ws/matrix/services/UserService?wsdl the wsdl obtained is different from the custom wsdl. The auto-generated wsdl has two bindings one for Soap11 and another for Soap12. The Soap11 binding for some reason points to my initial endpoint ( http://localhost:8080/Comergent/services/UserService ), but the Soap12 binding has the newer end point. 1. Although the custom wsdl has both bindings pointing to the newer URL, why does the auto-generated wsdl use different binding for Soap11? And why doesnt the 'useOriginalwsdl' property though set to true, not work in my case? 2. Are there any changes to be made on the server side in-order to map the updated URL to service archive file? (Other than the necessary modifications to web.xml to include the servlet-mapping for updated URL) The client stub has the following line to set the appropriate Soap version; _serviceClient.getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI); Even then, when i run my client with the newer endpoint, I hit the following problem; org.apache.axis2.AxisFault: Service not found operation terminated !! [java] at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:271) [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202) I have setup SOAPMonitor on the server side and I dont see any request coming in at all. This leads me to believe that the in pre-dispatch phase none of the dispatchers are able to locate the operation within the service. However, when the client is run with the older endpoint, the server is still able to honor the request and send back the response. This behavior leads to another set of questions I have: 3. What information is used by the dispatchers to verify the existence of an operation within a service? 4. I have a scenario, where in the service endpoint is determined at runtime based on location of the incoming request. Given this scenario, how does one map the service class to multiple end points. The wsdl location is generated at runtime and the client then invokes the operation defined within the service. On the server-side, how do we handle this in terms of verifying the service location? Thanks in advance. vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JiBX binding file not found error
Hi, I've deployed a service successfully using JiBX databinding framework. The Jibx binding file (binding.xml) has been included in the service archive file (.aar). But when the client invokes the service operation, I see that the server throws the following exception: org.apache.axis2.AxisFault: java.lang.RuntimeException: Unable to access binding information for class com.comergent.bean.simple.UserContactBean [java] Make sure the binding has been compiled [java] at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:271) [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202) I've tried adding the binding.xml to the META-INF directory and to the parent directory, but i still run into the same issue. Can someone help me resolve this problem. Thanks in advance. vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom exception mapping with JibX
Thanks for your reply. I'm currently doing some research and after perusing the recommendations, I wanted to try out the abstract+concrete wsdl approach. Although, the advantages to following this approach is not significant, I'd like to think that in future there will be few benefits. I have a follow up question to this thread: I create the wsdl, which i can validate properly. I generate the skeleton code using wsdl2java by providing the binding file using -Ebindingfile. I'm able to successfully deploy the service. However, I have a problem with my client. I use ADB databinding for the client, and when i run my client, I get the following exception: org.apache.axis2.AxisFault: java.lang.RuntimeException: Unable to access binding information for class com.comergent.bean.simple.UserContactBean Make sure the binding has been compiled at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:271) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202) at com.comergent.user.stub.UserServiceStub.getUser(Unknown Source) at com.comergent.user.client.UserServiceAdbClient.getUser(Unknown Source) at com.comergent.user.client.UserServiceAdbClient.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:202) at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:134) at org.apache.tools.ant.taskdefs.Java.run(Java.java:710) at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178) at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382) at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) at org.apache.tools.ant.Project.executeTargets(Project.java:1068) at org.apache.tools.ant.Main.runBuild(Main.java:668) What is surprising to me is that, it is trying to look for the binding file for the Userbean. From what I understand, the binding file is required only for JiBX databinding and that is the choice on the server side. However, when the client uses a different databinding framework and when there is no dependency on the UserContactBean class from the client-side, why do i run into this problem? Thanks in advance, vedha On Wed, 2007-01-17 at 11:46 +1300, Dennis Sosnoski wrote: > Vedha Vijayan wrote: > > I'm trying to expose an existing service as a Web service. I've got few > > queries regarding the process involved in doing so and about custom > > exception mapping with JiBX. > > > > 1. I generated the bindings (JiBX) and the schema for the classes > > involved. The recommended procedure of creating a wsdl is to have an > > abstract wsdl that defines the messages and then a concrete wsdl that > > defines the bindings and the services. Is there a automated process to > > go from the xsd and the Java class to generating the wsdl's? I had to > > hand-code/edit the wsdl created using java2wsdl command. Is there any > > tool that takes in the schema generated as a parameter and uses that to > > automatically generate the wsdl? How do people go about devising means > > to generate abstract and concrete wsdl's? > > > There currently is no automated process to go from the xsd and Java > class to generating the WSDL(s), but I'm working on a tool of that type > and will post to this list when something is available. > &
Custom exception mapping with JibX
Hi, I'm trying to expose an existing service as a Web service. I've got few queries regarding the process involved in doing so and about custom exception mapping with JiBX. 1. I generated the bindings (JiBX) and the schema for the classes involved. The recommended procedure of creating a wsdl is to have an abstract wsdl that defines the messages and then a concrete wsdl that defines the bindings and the services. Is there a automated process to go from the xsd and the Java class to generating the wsdl's? I had to hand-code/edit the wsdl created using java2wsdl command. Is there any tool that takes in the schema generated as a parameter and uses that to automatically generate the wsdl? How do people go about devising means to generate abstract and concrete wsdl's? 2. I'm trying to expose an operation that defines a custom exception. The custom exception basically extends from java.lang.Exception and uses exception chaining. I understand that I need to define a mapping for the custom exception class. I try to create the binding and the schema using the JiBX generator tools, but there is some problem or the other with respect to java.lang.StackTraceElement. It does not have a no-argument constructor or the schema definitions for java.lang.Throwable is not properly created. This is something that people here must have encountered. Can someone pin-point the right approach or if i'm going wrong here. I'd like to know if people write their own serializers/deserializers for mapping custom exceptions? Appreciate the help in advance!! Thanks, vedha -- Vedha Vijayan Senior Software Engineer Comergent Technologies Inc. Ph: 650 232 5833 Fax: 650 232 6010 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
POJO service related question
Hi, I'm trying to expose an existing service as a POJO service. I have few queries; 1. I understand that the MessageReceivers defined in the services.xml file have to be in the same order as the methods defined in the service implementation class. Should one define message receivers for only "public" methods ? Is this assumption correct? 2. How do we inform the WSDL generator to not map (filter out) certain "public" methods to WSDL operations? 3. In one of the replies to my previous post, I was asked to use Axis2-1.1.1 version in-order to overcome problems with stub code generation using XMLBeans databinding. I'd like to use a RC version. When do you anticipate releasing RC for v1.1.1? And is the problem with Stub code generation tightly coupled to the databinding scheme used? What i'm trying to understand is if I could get around the problem if i move to a different databinding scheme such as Adb or JibX. Thanks in advance. vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
POJO service related question
Hi, I'm trying to expose an existing service as a POJO service. I have few queries; 1. I understand that the MessageReceivers defined in the services.xml file have to be in the same order as the methods defined in the service implementation class. Should one define message receivers for only "public" methods ? Is this assumption correct? 2. How do we inform the WSDL generator to not map (filter out) certain "public" methods to WSDL operations? 3. In one of the replies to my previous post, I was asked to use Axis2-1.1.1 version in-order to overcome problems with stub code generation using XMLBeans databinding. I'd like to use a RC version. When do you anticipate releasing RC for v1.1.1? And is the problem with Stub code generation tightly coupled to the databinding scheme used? What i'm trying to understand is if I could get around the problem if i move to a different databinding scheme such as Adb or JibX. Thanks in advance. vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error in stub generation
Hi, I'm working on the "pojoguide" sample bundled with Axis2 1.1. I'm trying to expose WeatherService as a POJO service i.e. using WeatherService.java I run java2wsdl and generate the wsdl file. I then use "XMLBeans" as databinding option for client code generation. When I try to compile the generated stub, I get the following error: /home/vvijayan/axis2-1.1/samples/pojoguide/build/client/src/sample/pojo/service/xmlbeans/WeatherServiceStub.java:203: missing return statement [javac] } [javac] ^ [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: /home/vvijayan/axis2-1.1/samples/pojoguide/build/client/src/sample/pojo/service/xmlbeans/WeatherServiceStub.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 1 error BUILD FAILED When you look at the Stub code, you'll find that there are multiple instances of " //Unknown style detected !! No code is generated" comment. I've attached the wsdl and the stub code. Can anyone let me know the reason why I'm running into this issue. Thanks in advance. vedha -- Vedha Vijayan http://service.pojo.sample"; xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:ns="http://service.pojo.sample/xsd"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; targetNamespace="http://service.pojo.sample";>http://www.w3.org/2001/XMLSchema"; xmlns:ax21="http://data.pojo.sample/xsd"; attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://data.pojo.sample/xsd";> http://www.w3.org/2001/XMLSchema"; xmlns:ns0="http://data.pojo.sample/xsd"; attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.pojo.sample/xsd";> http://schemas.xmlsoap.org/soap/http"; style="Document" />http://service.pojo.sample"; />http://service.pojo.sample"; />http://service.pojo.sample"; />http://schemas.xmlsoap.org/soap/http"; style="Document" />http://service.pojo.sample"; />http://service.pojo.sample"; />http://service.pojo.sample"; />http://localhost:8080/axis2/services/WeatherService"; />http://localhost:8080/axis2/services/WeatherService"; /> services.xml Description: application/xml /** * WeatherServiceStub.java * * This file was auto-generated from WSDL * by the Apache Axis2 version: 1.1 Nov 13, 2006 (07:31:44 LKT) */ package sample.pojo.service.xmlbeans; /* * WeatherServiceStub java implementation */ public class WeatherServiceStub extends org.apache.axis2.client.Stub { protected org.apache.axis2.description.AxisOperation[] _operations; //hashmaps to keep the fault mapping private java.util.HashMap faultExeptionNameMap = new java.util.HashMap(); private java.util.HashMap faultExeptionClassNameMap = new java.util.HashMap(); private java.util.HashMap faultMessageMap = new java.util.HashMap(); private void populateAxisService() throws org.apache.axis2.AxisFault { //creating the Service with a unique name _service = new org.apache.axis2.description.AxisService("WeatherService" + this.hashCode()); //creating the operations org.apache.axis2.description.AxisOperation __operation; _operations = new org.apache.axis2.description.AxisOperation[2]; __operation = new org.apache.axis2.description.OutInAxisOperation(); __operation.setName(new javax.xml.namespace.QName("", "getWeather")); _service.addOperation(__operation); _operations[0]=__operation; __operation = new org.apache.axis2.description.OutOnlyAxisOperation(); __operation.setName(new javax.xml.namespace.QName("", "setWeather")); _service.addOperation(__operation); _operations[1]=__operation; } //populates the faults private void populateFaults(){ } /** Constructor that takes in a configContext */ public WeatherServiceStub(org.apache.axis2.context.ConfigurationContext configurationContext, java.lang.String targetEndpoint)
Re: Axis2 Newbie question
Thanks a bunch. vedha On Tue, 2007-01-02 at 23:55 +, Paul Fremantle wrote: > Vedha > > I'm confused by what you are trying to achieve. But I would like to > make a couple of points. > > 1) If you go the POJO route you will still not share resources between > the client and server. The client stub will be generated from the WSDL > and will use databound objects not your original objects (which will > be used in the AAR file). > > 2) JIBX is a binding system supported by Axis2 that allows you to use > your existing beans. Through the use of a mapping file and byte code > enhancement it supports mapping XML into existing beans. > > Paul > > On 1/2/07, Vedha Vijayan <[EMAIL PROTECTED]> wrote: > > Thanks Paul for your prompt reply. > > > > The primary reason why I want to go the WSDL route and not the POJO > > service route, is because I want to decouple any resource dependencies > > between the client and the server. To elaborate, if i were to deploy my > > service as a POJO service, I would have to include the > > "simple.bean.UserBean" in the service archive (AAR) file. I do not wish > > to do so. So, WSDL route is my option. > > > > My question is how do people handle creating instances of custom beans, > > as in this scenario where I have an existing bean that I want to be > > populated/created for an incoming request. > > > > 1. Is writing Axiom code the only option? > > 2. Is there any means to use an existing class for marshalling incoming > > request? > > > > Thanks in advance. > > > > vedha > > > > On Tue, 2007-01-02 at 19:31 +, Paul Fremantle wrote: > > > Vedha > > > > > > Hi! > > > > > > When you run Java2WSDL it only creates the WSDL, not the actual code. > > > So although you have a WSDL, you don't actually have a service. > > > > > > You can follow your route in which case you should do the following: > > > 1) J2W > > > 2) WSDL2Java -ss -sd -uri your.wsdl > > > This creates the server-side skeleton file. You know edit this to add > > > your business logic (i.e. call your existing code) > > > 3) ant - will build the AAR file for you > > > 4) deploy your AAR service > > > 5) Now you will have an updated WSDL pointing to your deployed service > > > 6) Run WSDL2Java to create the client (as you did). > > > > > > However, there is a much simpler way of doing this!!! Just deploy your > > > existing code/bean as a POJO service. Then the WSDL is automatically > > > generated for you. > > > > > > To do this you need to: > > > 1) Create a services.xml file like this: > > > > > > my POJO service > > > > > > http://www.w3.org/2004/08/wsdl/in-only"; > > > > > > class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/> > > > http://www.w3.org/2004/08/wsdl/in-out"; > > > > > > class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/> > > > > > > > > locked="false">simple.bean.UserBean > > > > > > > > > Now create an AAR file (just a JAR file) with the following: > > > META-INF/services.xml > > > simple/bean/UserBean.class > > > > > > Then deploy it (copy the AAR file into the repository/services > > > directory). Now you can browse > > > http://localhost:8080/axis2/services/UserBean?wsdl and you can > > > generate the client from there. > > > > > > Look at samples/pojo for an example. > > > > > > Paul > > > > > > On 1/2/07, Vedha Vijayan <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > > > > > I'm new to Axis2 and I'm trying to piece together a web service using > > > > axis2. Here is the scenario and the queries i have: > > > > > > > > I'm trying to publish an existing service as a web service. I use > > > > Java2Wsdl to come up with a wsdl from the existing code base. The > > > > existing bean has the package "simple.bean.UserBean" and the generated > > > > wsdl has the schema under "simple.bean.xsd.UserBean" namespace. The > > > > client uses Wsdl2Java to generate client code and invokes the service > > > > using the same. I use XMLBeans for databinding. What I need is to find a > > > > means for Axis2 (on the server side) to generate an instance of my
Re: Axis2 Newbie question
Thanks Paul for your prompt reply. The primary reason why I want to go the WSDL route and not the POJO service route, is because I want to decouple any resource dependencies between the client and the server. To elaborate, if i were to deploy my service as a POJO service, I would have to include the "simple.bean.UserBean" in the service archive (AAR) file. I do not wish to do so. So, WSDL route is my option. My question is how do people handle creating instances of custom beans, as in this scenario where I have an existing bean that I want to be populated/created for an incoming request. 1. Is writing Axiom code the only option? 2. Is there any means to use an existing class for marshalling incoming request? Thanks in advance. vedha On Tue, 2007-01-02 at 19:31 +, Paul Fremantle wrote: > Vedha > > Hi! > > When you run Java2WSDL it only creates the WSDL, not the actual code. > So although you have a WSDL, you don't actually have a service. > > You can follow your route in which case you should do the following: > 1) J2W > 2) WSDL2Java -ss -sd -uri your.wsdl > This creates the server-side skeleton file. You know edit this to add > your business logic (i.e. call your existing code) > 3) ant - will build the AAR file for you > 4) deploy your AAR service > 5) Now you will have an updated WSDL pointing to your deployed service > 6) Run WSDL2Java to create the client (as you did). > > However, there is a much simpler way of doing this!!! Just deploy your > existing code/bean as a POJO service. Then the WSDL is automatically > generated for you. > > To do this you need to: > 1) Create a services.xml file like this: > > my POJO service > > http://www.w3.org/2004/08/wsdl/in-only"; > > class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/> > http://www.w3.org/2004/08/wsdl/in-out"; > > class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/> > > locked="false">simple.bean.UserBean > > > Now create an AAR file (just a JAR file) with the following: > META-INF/services.xml > simple/bean/UserBean.class > > Then deploy it (copy the AAR file into the repository/services > directory). Now you can browse > http://localhost:8080/axis2/services/UserBean?wsdl and you can > generate the client from there. > > Look at samples/pojo for an example. > > Paul > > On 1/2/07, Vedha Vijayan <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'm new to Axis2 and I'm trying to piece together a web service using > > axis2. Here is the scenario and the queries i have: > > > > I'm trying to publish an existing service as a web service. I use > > Java2Wsdl to come up with a wsdl from the existing code base. The > > existing bean has the package "simple.bean.UserBean" and the generated > > wsdl has the schema under "simple.bean.xsd.UserBean" namespace. The > > client uses Wsdl2Java to generate client code and invokes the service > > using the same. I use XMLBeans for databinding. What I need is to find a > > means for Axis2 (on the server side) to generate an instance of my class > > ("simple.bean.UserBean") from the incoming SOAP message. > > > > 1. Is using AXIOM API my only choice to accomplish this? Or are there > > other alternatives? > > > > > > Thanks in advance for your help! > > > > vedha > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- Vedha Vijayan Senior Software Engineer Comergent Technologies Inc. Ph: 650 232 5833 Fax: 650 232 6010 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Axis2 Newbie question
Hi, I'm new to Axis2 and I'm trying to piece together a web service using axis2. Here is the scenario and the queries i have: I'm trying to publish an existing service as a web service. I use Java2Wsdl to come up with a wsdl from the existing code base. The existing bean has the package "simple.bean.UserBean" and the generated wsdl has the schema under "simple.bean.xsd.UserBean" namespace. The client uses Wsdl2Java to generate client code and invokes the service using the same. I use XMLBeans for databinding. What I need is to find a means for Axis2 (on the server side) to generate an instance of my class ("simple.bean.UserBean") from the incoming SOAP message. 1. Is using AXIOM API my only choice to accomplish this? Or are there other alternatives? Thanks in advance for your help! vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java.sql.Timestamp support
Hi, I'm working on exposing an existing feature as a web service. I run java2wsdl task on my java file and the resulting wsdl has the following erroneous schema for java.sql.Timestamp; http://www.w3.org/2001/XMLSchema"; xmlns:ax22="http://sql.java/xsd"; xmlns:ax26="http://calendar.util.sun/xsd"; attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://sql.java/xsd";> http://calendar.util.sun/xsd"; /> The type name "BaseCalendar$Date" is not a valid QName. This is the error i get when the wsdl is validated. Is there any other means to get around this other than manually modifying the wsdl? Help is welcome. Thanks. vedha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Axis2] databinding parameters
Let me explain my use case and hopefully people have answers to my query; I can an existing interface/implementation that I want to expose as web service. I use Java2Wsdl to generate the wsdl file, which includes the xsd for the defined objects. For examples, I want to expose getUser(com.comergent.api.UserBean b) as a web service. Since the client should have no dependency on the server object/classes (com.comergent.api.UserBean), the client uses the generated classes (com.comergent.xsd.UserBean) from a databinding scheme. The client uses WSDL2Java and invokes the operation using the generated classes. The server on having received the call has to construct its version of a bean (com.comergent.api.UserBean) that adheres to the XSD specified in the WSDL. My question is how do i go about doing this? One possibility is to register custom MessageReceiver and code to AXIOM api's to construct the bean. But, is there an alternative approach that I can adopt. Any help/insight will be greatly appreciated. Thanks, vedha -- Vedha Vijayan Senior Software Engineer Comergent Technologies Inc. Ph: 650 232 5833 Fax: 650 232 6010 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Axis2 dynamic usertoken configuration problem
I'm working with rampart samples to better understand dynamic configuration of usernameToken context. I'm trying to do the following; ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[1], args[1] + "/conf/axis2.xml"); ServiceClient client = new ServiceClient(ctx, null); //programmatically enable "rampart" module client.engageModule( new javax.xml.namespace.QName("rampart")); Options options = new Options(); options.setAction("urn:echo"); options.setTo(new EndpointReference(args[0])); //set user context OutflowConfiguration ofc = new OutflowConfiguration(); try { ofc.setActionItems("UsernameToken"); ofc.setUser("bob1"); ofc.setPasswordCallbackClass("org.apache.rampart.samples.sample03.PWCBHandler"); ofc.setPasswordType("PasswordText"); options.setProperty( WSSHandlerConstants.OUTFLOW_SECURITY, ofc.getProperty()); client.setOptions(options); OMElement response = client.sendReceive(getPayload("Hello world")); System.out.println(response); } catch(Throwable t) { t.printStackTrace(); } When i execute the client, I get the following error message: java.lang.ClassCastException: org.apache.axiom.om.impl.llom.OMElementImpl [java] at org.apache.axiom.soap.impl.llom.SOAPFaultImpl.getCode(SOAPFaultImpl.java:101) [java] at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:308) [java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:579) [java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508) [java] at org.apache.rampart.samples.sample03.DynamicUTClient.main(Unknown Source) The sample code works when I configure the usernameToken from within the client's axis2.xml file. However, when i try to set it programmatically, I end up with this error message. I have included rampart's jar as part of my client classpath. Can anyone please let me know how to resolve this. Thanks, vedha -- Vedha Vijayan Senior Software Engineer Comergent Technologies Inc. Ph: 650 232 5833 Fax: 650 232 6010 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]