Re: Document/Literal - Handwritten wsdl? Method signature OMELement?
hi Asmita, please define a method likes: public String myWebServiceMethod(String, String, String) { ... } and publish it from your the service. After that, please look at the wsdl in the URL (?wsdl) once again. Guo - Original Message - From: Attharkar, Asmita aatth...@telcordia.com To: axis-user@ws.apache.org Sent: Wednesday, February 25, 2009 12:02 PM Subject: RE: Document/Literal - Handwritten wsdl? Method signature OMELement? | Hi Guo, | | My problem is not about which approach I should follow. | The question is when I using the document/literal can I have a method whose signature is String myWebServiceMethod(String, String, String). | If not, and I need to use the method OMElement myWebServiceMethod(OMElement) and I need to publish my wsdl how can I tell the web service users that my web service needs those three String values and it will return a response that has String. | | If I need to edit wsdl manually, how do I do it? | | Thanks, | Asmita | | From: Guo Tianchong [gu...@nec-as.nec.com.cn] | Sent: Tuesday, February 24, 2009 10:50 PM | To: axis-user@ws.apache.org | Subject: Re: Document/Literal - Handwritten wsdl? Method signature OMELement? | | hi Asmita, | | Your senario seems : | 1. write java code | 2. java2wsdl | 3. publish your wsdl generated by step2. | | Is it right? | | I met the same confusion ago. | I also created my service by axiom databinding ago. | The generated wsdl in the URL (?wsdl) is xs:anytype and return type is also xs:anytype. | | It seems that Axis2 will identify OMElement as Object. | and it is xs:anytype in URL (?wsdl). | | I'm still not know how to resolve the problem. | | but how about the following? | 1. write wsdl | 2. wsdl2java | 3. publish your wsdl generated by step1. | | | Guo. | | - Original Message - | From: Attharkar, Asmitamailto:aatth...@telcordia.com | To: axis-user@ws.apache.orgmailto:axis-user@ws.apache.org | Sent: Wednesday, February 25, 2009 6:37 AM | Subject: Document/Literal - Handwritten wsdl? Method signature OMELement? | | Hi, | | I need to use Document/Literal style in my web service. | | My web service needs few (say three) strings from client. The Web service needs to send a String back to the client. | | I am looking at web service method signature now. | | Is it true that the only option I have when using document/literal my method will look something like this? OMElement myWebService (OMElement requestElement). | | I can add the three parameters needed by the web service to the requestElement as its child elements. | | The problem now is the wsdl. | | When I see the generated wsdl in the URL (?wsdl) I see that xs:anytype is the only parameter taken into the webservice and return type is also xs:anytype. | | How will my web service client know what exactly are those three parameters and what should be their names and what should he be seeing in the return type. | | I checked few forum entries and it says that I need to handwrite my wsdl? Is it true? | | Is there a way that I can automatically generate the wsdl which indicates all the parameters needed by my webservice as well as the return String.? | | Is there a way that I am implementing RawXMLINOutMessageReceiver but my method signature can have the distinct three parameters as separate method arguments? | | If not how will I publish my wsdl which explains the parameters and return type String to the outside world. | | This one is very urgent. My code is ready but now I need to publish my wsdl for the world. | | I am using ant script to generate the wsdl but I get the error: | | java.lang.RuntimeException: java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be cast to org.apache.axis2.engine.MessageReceiver | | | | | Thanks, | Asmita | | | | (Tel) 732-699-4657 | 4B566 | Telcordia Technologies | Piscataway NJ 08854 |
Re: AXIS2 |SOAP XML at Server Side
hi Appasamy, Please use SOAPMonitor. ref: http://ws.apache.org/axis2/1_4_1/soapmonitor-module.html Guo - Original Message - From: Appasamy Thirugnana To: axis-user@ws.apache.org Sent: Thursday, February 19, 2009 5:48 PM Subject: AXIS2 |SOAP XML at Server Side I need to print the SOAP request XML that is coming inside to access my webservice in Axis2. In skeleton we cant do that it seems. Can anyone tell me which file i need to do that Thanks Appasamy
how to make classes for soap:Header by wsdl2java
hi all, I am using wsdl2java command to create java class. Now, I can create classes for my soap:Body's child elements. but, how to make classes for soap:Header's child elements? My resquest/response soap message is the following: request message soap:Enveloper ... soap:Header mh:ID soap:mustUnderstand=11mh:ID mh:MACAddress soap:mustUnderstand=101234567ABCmh:ID /soap:Header soap:Body mh:Inform ... ... /mh:Inform soap:Body /soap:Enveloper response message soap:Enveloper ... soap:Header mh:ID soap:mustUnderstand=11mh:ID mh:MACAddress soap:mustUnderstand=101234567ABCmh:ID /soap:Header soap:Body mh:InformResponse ... ... /mh:InformResponse soap:Body /soap:Enveloper and my .wsdl file is: definitions types xsd:schema targetNamespace=... xs:element name=Inform xs:complexType xs:sequence /xs:sequence /xs:complexType /xs:element xs:element name=InformResponse xs:complexType xs:sequence /xs:sequence /xs:complexType /xs:element /xsd:schema /types message name=Headers part name=ID element=tns:ID / part name=MACAddress element=tns:MACAddress / /message message name=InformRequest part name=part0 element=tns:Inform / /message message name=InformResponse part name=part0 element=tns:InformResponse / /message . binding name=Mybinding type=tns:MyportType soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http; / operation name=inform soap:operation style=document soapAction=urn:inform / input soap:header message=tns:Headers part=ID use=literal / soap:header message=tns:Headers part=MACAddress use=literal / soap:body use=literal / /input output soap:header message=tns:Headers part=ID use=literal / soap:header message=tns:Headers part=MACAddress use=literal / soap:body use=literal / /output /operation /binding /definitions Now, I can create InformDocument InformResponseDocument classes, but how can make classes for soap:Header by wsdl2java? Thanks for any help! Guo
Re: how to make classes for soap:Header by wsdl2java
hi all, It seems that this is one solution. Thanks! Yves-Marie. Does anybody know that how to make classes for soap:Header by wsdl2java without AXIOM-API(s) ? such as, create the following classes by wsdl2java. mypackage.ID; mypackage.MACAddress; Regards! Guo - Original Message - From: DANIEL, Yves Marie yves-marie.dan...@capgemini.com To: axis-user@ws.apache.org Sent: Wednesday, February 18, 2009 7:22 PM Subject: RE: how to make classes for soap:Header by wsdl2java |I don't konw, but you can add elements in the header with : | | |QName elementName = new QName( YOUR_ID ); |OMFactory omFactory = OMAbstractFactory.getOMFactory(); |OMElement omElement = omFactory.createOMElement( elementName, null ); |omElement.setText( YOUR_VALUE ); |this._YOUR_STUB._getServiceClient().addHeader( omElement ); | | | Yves-Marie | | | | | | -Message d'origine- | De : Guo Tianchong [mailto:gu...@nec-as.nec.com.cn] | Envoyé : mercredi 18 février 2009 11:09 | À : axis-user | Objet : how to make classes for soap:Header by wsdl2java | | hi all, | | I am using wsdl2java command to create java class. | Now, I can create classes for my soap:Body's child elements. | but, how to make classes for soap:Header's child elements? | | My resquest/response soap message is the following: | | request message | soap:Enveloper ... |soap:Header | mh:ID soap:mustUnderstand=11mh:ID | mh:MACAddress soap:mustUnderstand=101234567ABCmh:ID |/soap:Header |soap:Body | mh:Inform |... ... | /mh:Inform |soap:Body | /soap:Enveloper | | response message | soap:Enveloper ... |soap:Header | mh:ID soap:mustUnderstand=11mh:ID | mh:MACAddress soap:mustUnderstand=101234567ABCmh:ID |/soap:Header |soap:Body | mh:InformResponse |... ... | /mh:InformResponse |soap:Body | /soap:Enveloper | | | and my .wsdl file is: | definitions | | types | xsd:schema targetNamespace=... |xs:element name=Inform | xs:complexType |xs:sequence | |/xs:sequence | /xs:complexType |/xs:element |xs:element name=InformResponse | xs:complexType |xs:sequence | |/xs:sequence | /xs:complexType |/xs:element | /xsd:schema | /types | | message name=Headers | part name=ID element=tns:ID / | part name=MACAddress element=tns:MACAddress / /message message name=InformRequest | part name=part0 element=tns:Inform / /message message name=InformResponse | part name=part0 element=tns:InformResponse / /message | | . | | binding name=Mybinding type=tns:MyportType |soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http; / |operation name=inform | soap:operation style=document soapAction=urn:inform / | input |soap:header message=tns:Headers part=ID use=literal / |soap:header message=tns:Headers part=MACAddress use=literal / |soap:body use=literal / | /input | output |soap:header message=tns:Headers part=ID use=literal / |soap:header message=tns:Headers part=MACAddress use=literal / |soap:body use=literal / | /output |/operation | /binding | | | /definitions | | | | Now, I can create InformDocument InformResponseDocument classes, but how can make classes for soap:Header by wsdl2java? | | Thanks for any help! | | Guo | | | | | | | | This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is | intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to | read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message | in error, please notify the sender immediately and delete all copies of this message. |
Re: how to make classes for soap:Header by wsdl2java
hi Amila, I'm using Axis2 1.4.1 Since with axis2.x this happens automatically, which APIs can I use to get the headers object in the Skeleton class? for example: My skeleton class likes: public class MySkeleton { public mypackage.InformResponseDocument inform(mypackage.InformDocument inform) { //TODO : fill this with the necessary business logic // here, which API(s) can I use to get the headers info? } } - Original Message - From: Amila Suriarachchi To: axis-user@ws.apache.org Sent: Thursday, February 19, 2009 12:47 PM Subject: Re: how to make classes for soap:Header by wsdl2java Are you using axis1.x? with axis2.x this happens automatically. thanks, Amila. On Wed, Feb 18, 2009 at 3:38 PM, Guo Tianchong gu...@nec-as.nec.com.cn wrote: hi all, I am using wsdl2java command to create java class. Now, I can create classes for my soap:Body's child elements. but, how to make classes for soap:Header's child elements? My resquest/response soap message is the following: request message soap:Enveloper ... soap:Header mh:ID soap:mustUnderstand=11mh:ID mh:MACAddress soap:mustUnderstand=101234567ABCmh:ID /soap:Header soap:Body mh:Inform ... ... /mh:Inform soap:Body /soap:Enveloper response message soap:Enveloper ... soap:Header mh:ID soap:mustUnderstand=11mh:ID mh:MACAddress soap:mustUnderstand=101234567ABCmh:ID /soap:Header soap:Body mh:InformResponse ... ... /mh:InformResponse soap:Body /soap:Enveloper and my .wsdl file is: definitions types xsd:schema targetNamespace=... xs:element name=Inform xs:complexType xs:sequence /xs:sequence /xs:complexType /xs:element xs:element name=InformResponse xs:complexType xs:sequence /xs:sequence /xs:complexType /xs:element /xsd:schema /types message name=Headers part name=ID element=tns:ID / part name=MACAddress element=tns:MACAddress / /message message name=InformRequest part name=part0 element=tns:Inform / /message message name=InformResponse part name=part0 element=tns:InformResponse / /message . binding name=Mybinding type=tns:MyportType soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http; / operation name=inform soap:operation style=document soapAction=urn:inform / input soap:header message=tns:Headers part=ID use=literal / soap:header message=tns:Headers part=MACAddress use=literal / soap:body use=literal / /input output soap:header message=tns:Headers part=ID use=literal / soap:header message=tns:Headers part=MACAddress use=literal / soap:body use=literal / /output /operation /binding /definitions Now, I can create InformDocument InformResponseDocument classes, but how can make classes for soap:Header by wsdl2java? Thanks for any help! Guo -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
Re: Error establishing end to end conectivity in axis and jboss
hi Salman, It seems that you didn't speify the action of M/C-3's WebService. | http://192.168.1.28:9000/axis2/services/ and the WSA | Action = null please check your code in M/C-1 calling the M/C-3's WebService Guo - Original Message - From: Salman A. Kagzi salma...@s7software.com To: axis-user@ws.apache.org; axis-...@ws.apache.org Sent: Thursday, February 05, 2009 2:33 PM Subject: Error establishing end to end conectivity in axis and jboss | Hi All, | | I have an axis web service which can acts as a client as well as server. | | I am trying to deploy two instances of this web service on separate servers | and try and setup a communication link between them. | | On M/C-1 I have installed axis2 1.3 under jboss 4.0.5 and have deployed my | web service. | On M/C-2 I have installed a standalone axis2 1.3 server and have my service | deployed there. | Both deployments are successful and no error/exception is seen. | | I have a client running on M/C-3, this is a simple java program to call my | web service deployed on M/C-1 which will in turn call the web service on | M/C-2. | Web service on M/C-2 returns some data through callback to M/C-1 which will | in turn pass it over to M/C-3. | | When I call this service I am getting following exception on axis2 server | running on M/C-2 | org.apache.axis2.AxisFault: The endpoint reference (EPR) for the | Operation not found is | http://192.168.1.28:9000/axis2/services/ and the WSA | Action = null |at | org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java | :86) |at org.apache.axis2.engine.Phase.invoke(Phase.java:308) |at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212) |at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132) |at | org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT | TPTransportUtils.java:275) |at | org.apache.axis2.transport.nhttp.ServerWorker.processPost(ServerWorker.java: | 207) |at | org.apache.axis2.transport.nhttp.ServerWorker.run(ServerWorker.java:171) |at | edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run | Task(ThreadPoolExecutor.java:665) |at | edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run | (ThreadPoolExecutor.java:690) |at java.lang.Thread.run(Thread.java:595) | | I am trying to use HttpCoreNIOListener on both ends. As on later stage I | need to enable ssl as well for these web service | | transportReceiver name=http | class=org.apache.axis2.transport.nhttp.HttpCoreNIOListener | parameter name=port locked=false8080/parameter | parameter name=non-blocking locked=falsetrue/parameter | /transportReceiver | | PS: I have tested many different configurations and only this one works for | me. | On Jboss axis2.xml when I use SimpleHTTPServer for transportReceiver and | CommonsHTTPTransportSender for transportSender and disable global addressing | module, end to end communication is achieved. But this is not acceptable as | on later stage I need to enable ssl also and am forced to use non-blocking | methods. | | I have been working out for 5-6 days to figure this out and am still no | where. Any help would be appreciated. | | -Salman
Re: Error establishing end to end conectivity in axis and jboss
hi Salman, I'm sorry. It should be M/C-2. please check your code in M/C-1 calling the M/C-2's WebService Guo - Original Message - From: Salman A. Kagzi salma...@s7software.com To: axis-user@ws.apache.org Sent: Thursday, February 05, 2009 4:43 PM Subject: RE: Error establishing end to end conectivity in axis and jboss | Hi Guo, | | Thanks for your response. | | But M/C-3 is not a hosting a webservice. It's a plain java client to invoke | WS on M/C-1 which will invoke WS on M/C-2. M/C-2 now returns some data which | is later stored on M/C-1. | | You can see that now M/C-1 in not trying to connect to M/C-3 at all. | Also the exception is seen on M/C-2 console. | | -Salman | | -Original Message- | From: Guo Tianchong [mailto:gu...@nec-as.nec.com.cn] | Sent: Thursday, February 05, 2009 1:59 PM | To: axis-user@ws.apache.org | Subject: Re: Error establishing end to end conectivity in axis and jboss | | hi Salman, | | It seems that you didn't speify the action of M/C-3's WebService. | || http://192.168.1.28:9000/axis2/services/ and the WSA || Action = null | | please check your code in M/C-1 calling the M/C-3's WebService | | Guo | | - Original Message - | From: Salman A. Kagzi salma...@s7software.com | To: axis-user@ws.apache.org; axis-...@ws.apache.org | Sent: Thursday, February 05, 2009 2:33 PM | Subject: Error establishing end to end conectivity in axis and jboss | | || Hi All, || || I have an axis web service which can acts as a client as well as server. || || I am trying to deploy two instances of this web service on separate | servers || and try and setup a communication link between them. || || On M/C-1 I have installed axis2 1.3 under jboss 4.0.5 and have deployed my || web service. || On M/C-2 I have installed a standalone axis2 1.3 server and have my | service || deployed there. || Both deployments are successful and no error/exception is seen. || || I have a client running on M/C-3, this is a simple java program to call my || web service deployed on M/C-1 which will in turn call the web service on || M/C-2. || Web service on M/C-2 returns some data through callback to M/C-1 which | will || in turn pass it over to M/C-3. || || When I call this service I am getting following exception on axis2 server || running on M/C-2 || org.apache.axis2.AxisFault: The endpoint reference (EPR) for the || Operation not found is || http://192.168.1.28:9000/axis2/services/ and the WSA || Action = null ||at || | org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java || :86) ||at org.apache.axis2.engine.Phase.invoke(Phase.java:308) ||at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212) ||at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132) ||at || | org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT || TPTransportUtils.java:275) ||at || | org.apache.axis2.transport.nhttp.ServerWorker.processPost(ServerWorker.java: || 207) ||at || org.apache.axis2.transport.nhttp.ServerWorker.run(ServerWorker.java:171) ||at || | edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run || Task(ThreadPoolExecutor.java:665) ||at || | edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run || (ThreadPoolExecutor.java:690) ||at java.lang.Thread.run(Thread.java:595) || || I am trying to use HttpCoreNIOListener on both ends. As on later stage I || need to enable ssl as well for these web service || || transportReceiver name=http || class=org.apache.axis2.transport.nhttp.HttpCoreNIOListener || parameter name=port locked=false8080/parameter || parameter name=non-blocking locked=falsetrue/parameter || /transportReceiver || || PS: I have tested many different configurations and only this one works | for || me. || On Jboss axis2.xml when I use SimpleHTTPServer for transportReceiver and || CommonsHTTPTransportSender for transportSender and disable global | addressing || module, end to end communication is achieved. But this is not acceptable | as || on later stage I need to enable ssl also and am forced to use non-blocking || methods. || || I have been working out for 5-6 days to figure this out and am still no || where. Any help would be appreciated. || || -Salman
Fw: WSDL2java : Duplicate global type error
Can someone give some insight on this Guo - Original Message - From: Guo Tianchong gu...@nec-as.nec.com.cn To: axis-user axis-user@ws.apache.org Sent: Tuesday, February 03, 2009 6:14 PM Subject: WSDL2java : Duplicate global type error | Hi, all | | When I run WSDL2java in xmlbeans databinding. it's always report the following exception. | | Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: project://local/soapenc.xsd:95:3: error: | sch-props-correct.2: Duplicate global type: ar...@http://schemas.xmlsoap.org/soap/encoding/ (Original global type found in file: | null) |at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:325) |... 8 more | Caused by: org.apache.xmlbeans.XmlException: project://local/soapenc.xsd:95:3: error: sch-props-correct.2: Duplicate global type: | ar...@http://schemas.xmlsoap.org/soap/encoding/ (Original global type found in file: null) |at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) |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:324) |at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) | | | The soapenc.xsd file has been downloaded from http://schemas.xmlsoap.org/soap/encoding/, and has been saved in localhost. | My applications's wsdl import the soapenc.xsd file as this: | | xs:import namespace=http://schemas.xmlsoap.org/soap/envelope/; | schemaLocation=./soapenc.xsd/ | | Can anyone tell me how to resolve this problem? | Thanks | | Guo | | | | | | |
Re: Fw: WSDL2java : Duplicate global type error
Thanks for your response! Guo - Original Message - From: keith chapman To: axis-user@ws.apache.org Sent: Friday, February 06, 2009 1:52 PM Subject: Re: Fw: WSDL2java : Duplicate global type error I'm not sure about your exact scenario. But Axis2 does not support soap-encoding Thanks, Keith. On Fri, Feb 6, 2009 at 7:15 AM, Guo Tianchong gu...@nec-as.nec.com.cn wrote: Can someone give some insight on this Guo - Original Message - From: Guo Tianchong gu...@nec-as.nec.com.cn To: axis-user axis-user@ws.apache.org Sent: Tuesday, February 03, 2009 6:14 PM Subject: WSDL2java : Duplicate global type error | Hi, all | | When I run WSDL2java in xmlbeans databinding. it's always report the following exception. | | Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: project://local/soapenc.xsd:95:3: error: | sch-props-correct.2: Duplicate global type: ar...@http://schemas.xmlsoap.org/soap/encoding/ (Original global type found in file: | null) |at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:325) |... 8 more | Caused by: org.apache.xmlbeans.XmlException: project://local/soapenc.xsd:95:3: error: sch-props-correct.2: Duplicate global type: | ar...@http://schemas.xmlsoap.org/soap/encoding/ (Original global type found in file: null) |at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) |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:324) |at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) | | | The soapenc.xsd file has been downloaded from http://schemas.xmlsoap.org/soap/encoding/, and has been saved in localhost. | My applications's wsdl import the soapenc.xsd file as this: | | xs:import namespace=http://schemas.xmlsoap.org/soap/envelope/; | schemaLocation=./soapenc.xsd/ | | Can anyone tell me how to resolve this problem? | Thanks | | Guo | | | | | | | -- Keith Chapman Senior Software Engineer WSO2 Inc. Oxygenating the Web Service Platform. http://wso2.org/ blog: http://www.keith-chapman.org
Re: HTTP status
hi, Sriram: I think I met the same problem as yours. My application asks the webservice to return the http 204 status. My solution is to put the following code snippet in my ServiceClass's method. HttpServletResponse resp = (HttpServletResponse)MessageContext.getCurrentMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE); resp.setStatus(204); Using a kind of Http Monitor (ex: Live HTTP headers in Firefox), I could find the Http Response header's status is 204. All But I put the following code snippet in my outflow's handler, public InvocationResponse invoke(MessageContext msgContext) throws AxisFault { .. HttpServletResponse response = (HttpServletResponse)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE); response.setStatus(204); .. } It always throw the NullPointerException for response.setStatus(204); statement. Does the handler can not get HttpServletResponse? Any ideas? Thanks Guo. - Original Message - From: sri ram To: axis-user@ws.apache.org Sent: Monday, February 02, 2009 6:32 PM Subject: Re: HTTP status Can someone give some insight on this --- On Mon, 2/2/09, sri ram pinnamaraju_sri...@yahoo.co.in wrote: From: sri ram pinnamaraju_sri...@yahoo.co.in Subject: HTTP status To: axis-user@ws.apache.org Date: Monday, 2 February, 2009, 1:55 PM Hi all, I am using Axis 2.1.4 and XMLBeans as my databinding. I have extended AxisServlet .If I get the proper response with no exceptions I am getting HTTP status as 200, which is completely fine but when I get any fault message its sets the status to 500 automatically. So I have added the code to set the staus to 200 everytime even if there is an exception but its not working .Does the Axis 2 apis prevent it from setting . response.setContentType(text/xml; charset=UTF-8); response.setStatus(200); Do help me on this its urgent Thanks , Sriram -- Add more friends to your messenger and enjoy! Invite them now. -- Unlimited freedom, unlimited storage. Get it now
WSDL2java : Duplicate global type error
Hi, all When I run WSDL2java in xmlbeans databinding. it's always report the following exception. Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: project://local/soapenc.xsd:95:3: error: sch-props-correct.2: Duplicate global type: ar...@http://schemas.xmlsoap.org/soap/encoding/ (Original global type found in file: null) at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:325) ... 8 more Caused by: org.apache.xmlbeans.XmlException: project://local/soapenc.xsd:95:3: error: sch-props-correct.2: Duplicate global type: ar...@http://schemas.xmlsoap.org/soap/encoding/ (Original global type found in file: null) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) 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:324) at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) The soapenc.xsd file has been downloaded from http://schemas.xmlsoap.org/soap/encoding/, and has been saved in localhost. My applications's wsdl import the soapenc.xsd file as this: xs:import namespace=http://schemas.xmlsoap.org/soap/envelope/; schemaLocation=./soapenc.xsd/ Can anyone tell me how to resolve this problem? Thanks Guo
Re: How to Return XML data from a webservice and how is it consumed?
Please try AXIOM as your operation's return type. Guo. - Original Message - From: Shravan Mahankali To: axis-user@ws.apache.org Sent: Thursday, January 22, 2009 8:46 PM Subject: How to Return XML data from a webservice and how is it consumed? Hi, Can anyone advise me, how return XML data from a webservice? Also, how a client consuming this service should interpret the output, I mean what type of data can they expect? Thanks in advance. Thank You, Shravan Kumar. M -
How to generate customer Java Class
hi, all I know the request/response SOAP message ex: ==request SOAP body is: soap:Envelope ... soap:Body cwmp:Inform cwmp:DeviceId cwmp:ManufacturerABC/cwmp:Manufacturer cwmp:OUIABC/cwmp:OUI /DeviceId cwmp:Event soapenc:arrayType=cwmp:EventStruct[2] cwmp:EventStruct cwmp:EventCode0 BOOTSTRAPcwmp:EventCode cwmp:CommandKey0/cwmp:CommandKey /cwmp:EventStruct cwmp:EventStruct cwmp:EventCode1 BOOTSTRAPcwmp:EventCode cwmp:CommandKey1/cwmp:CommandKey /cwmp:EventStruct /cwmp:Event /cwmp:Inform /soap:Body /soap:Envelope ==response SOAP body is soap:Envelope ... soap:Body cwmp:InformResponse cwmp:MaxEvenlopes xsi:type=xsdUnsignedInt1/cwmp:MaxEvenlopes /cwmp:InformResponse /soap:Body /soap:Envelope And I have the cwmp's xsd file. Then, how to generate customer Java Class for my servce's opertion? My Servce's opertion likes public ? inform(DeviceId device, EventStruct[] event) {...} Thanks! Guo
Re: How to generate customer Java Class
No, I haven't wsdl for my service now. Should I create a wsdl file? Guo - Original Message - From: Amila Suriarachchi To: axis-user@ws.apache.org Sent: Wednesday, January 21, 2009 11:52 AM Subject: Re: How to generate customer Java Class Do you have the wsdl for your service? Amila. On Wed, Jan 21, 2009 at 7:33 AM, Guo Tianchong gu...@nec-as.nec.com.cn wrote: hi, all I know the request/response SOAP message ex: ==request SOAP body is: soap:Envelope ... soap:Body cwmp:Inform cwmp:DeviceId cwmp:ManufacturerABC/cwmp:Manufacturer cwmp:OUIABC/cwmp:OUI /DeviceId cwmp:Event soapenc:arrayType=cwmp:EventStruct[2] cwmp:EventStruct cwmp:EventCode0 BOOTSTRAPcwmp:EventCode cwmp:CommandKey0/cwmp:CommandKey /cwmp:EventStruct cwmp:EventStruct cwmp:EventCode1 BOOTSTRAPcwmp:EventCode cwmp:CommandKey1/cwmp:CommandKey /cwmp:EventStruct /cwmp:Event /cwmp:Inform /soap:Body /soap:Envelope ==response SOAP body is soap:Envelope ... soap:Body cwmp:InformResponse cwmp:MaxEvenlopes xsi:type=xsdUnsignedInt1/cwmp:MaxEvenlopes /cwmp:InformResponse /soap:Body /soap:Envelope And I have the cwmp's xsd file. Then, how to generate customer Java Class for my servce's opertion? My Servce's opertion likes public ? inform(DeviceId device, EventStruct[] event) {...} Thanks! Guo -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
Re: Call AXIOM Web Service Using Microsoft Office 2003 Web Services Toolkit 2.01
I see. Thanks a lot Guo - Original Message - From: Amila Suriarachchi To: axis-user@ws.apache.org Sent: Tuesday, December 30, 2008 11:04 PM Subject: Re: Call AXIOM Web Service Using Microsoft Office 2003 Web Services Toolkit 2.01 On Tue, Dec 30, 2008 at 12:20 PM, Guo Tianchong gu...@nec-as.nec.com.cn wrote: My service is working well via Axis2 client. It seems that the MS Web Services Toolkit 2.01 do not support complex type XML input. The real world is: My service operation's parameter is a AXIOM OMElement. I called this service operation in VBA, and passed a XML String to it. At the service operation side, I sysout the operation's parameter value. It's supprised that the input paramerter is encapsulated by param0... ... /param0 and the XML '' character is also changed to 'lt;' this means it try to send your xml as a string. i.e. your xml string as the value of the param0 thanks, Amila. Do you know how to deal this problem? Anybody else? Thanks! Guo - Original Message - From: Amila Suriarachchi To: axis-user@ws.apache.org Sent: Tuesday, December 30, 2008 10:44 AM Subject: Re: Call AXIOM Web Service Using Microsoft Office 2003 Web Services Toolkit 2.01 First try to access the service with a Axis2 client. Anyway sending the full stack trace(see the server console) may be useful. thanks, Amila. On Mon, Dec 29, 2008 at 1:59 PM, Guo Tianchong gu...@nec-as.nec.com.cn wrote: Hi all, I create a very simple Web Service in AXIOM for my project. Now, I need to test it using Microsoft Office 2003 Web Services Toolkit 2.01. But when I call the proxy of my Service in EXCEL, it always alert run time error 2147221504(8004) java.lang.NullPointerException Does anyone know how to resolve this problem? Thanks! Guo -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
Call AXIOM Web Service Using Microsoft Office 2003 Web Services Toolkit 2.01
Hi all, I create a very simple Web Service in AXIOM for my project. Now, I need to test it using Microsoft Office 2003 Web Services Toolkit 2.01. But when I call the proxy of my Service in EXCEL, it always alert run time error 2147221504(8004) java.lang.NullPointerException Does anyone know how to resolve this problem? Thanks! Guo
Re: Call AXIOM Web Service Using Microsoft Office 2003 Web Services Toolkit 2.01
My service is working well via Axis2 client. It seems that the MS Web Services Toolkit 2.01 do not support complex type XML input. The real world is: My service operation's parameter is a AXIOM OMElement. I called this service operation in VBA, and passed a XML String to it. At the service operation side, I sysout the operation's parameter value. It's supprised that the input paramerter is encapsulated by param0... ... /param0 and the XML '' character is also changed to 'lt;' Do you know how to deal this problem? Anybody else? Thanks! Guo - Original Message - From: Amila Suriarachchi To: axis-user@ws.apache.org Sent: Tuesday, December 30, 2008 10:44 AM Subject: Re: Call AXIOM Web Service Using Microsoft Office 2003 Web Services Toolkit 2.01 First try to access the service with a Axis2 client. Anyway sending the full stack trace(see the server console) may be useful. thanks, Amila. On Mon, Dec 29, 2008 at 1:59 PM, Guo Tianchong gu...@nec-as.nec.com.cn wrote: Hi all, I create a very simple Web Service in AXIOM for my project. Now, I need to test it using Microsoft Office 2003 Web Services Toolkit 2.01. But when I call the proxy of my Service in EXCEL, it always alert run time error 2147221504(8004) java.lang.NullPointerException Does anyone know how to resolve this problem? Thanks! Guo -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
Re: Axis 1.3 - Problem with Handler
Hi, you can do something in the Handler's invoke() method and encapsulate a new SOAP body in the MessageContext object. Using AXIOM, that looks like : public InvocationResponse invoke(MessageContext msgContext) throws AxisFault { SOAPFactory fac = OMAbstractFactory.getSOAP12Factory(); OMNamespace soapNamespace = fac.createOMNamespace(Constants.URI_SOAP11_ENV, soap); // make envelope element SOAPEnvelope newEnvelope = fac.createSOAPEnvelope(soapNamespace); // make header element SOAPHeader header = fac.createSOAPHeader(newEnvelope); // add your header blocks here .. // make body element SOAPBody body = fac.createSOAPBody(newEnvelope); // add your body response here // body.addChild(.) msgContext.setEnvelope(newEnvelope); return InvocationResponse.CONTINUE; } Please have a try. guo - Original Message - From: Harikrishna Vemula To: axis-user@ws.apache.org Sent: Monday, December 15, 2008 10:36 PM Subject: Axis 1.3 - Problem with Handler Hi, I have a Webservice for that i implemented a Handler to validate input request with XSD. Whenever any exception occurs in invoke method i'm throwing AxisFault. But client doesn't want to have exception as return value even though any exception occurs. Client is expecting to recieve a normal SOAP response with ErrorCode ErrorMsg parameters in the response. How can i send response with ErrorCode ErrorMsg when any exception raised in Handlers? Please help me out, this is an urgent requirement. Thanks in advance... -- Hari Krishna Vemula
Re: Axis 1.3 - Problem with Handler
hi, Hari I am working with Axis2 1.4.1 and don't know well about Axis 1.3. Sorry! but I also remain concerned about this issue. guo. - Original Message - From: Harikrishna Vemula To: axis-user@ws.apache.org Sent: Tuesday, December 16, 2008 2:05 PM Subject: Re: Axis 1.3 - Problem with Handler Hi guo, Thanks, But in Axis 1.3 we don't have InvocationResponse object itself. In 1.3 invoke method return type is void. So, as per my knowledge only way to stop the process and send back the response by throwing Fault. But is there any other way by which we can catch Fault and process the fault message and send back normal response to client? JAX-RPC is having methods with return type true for handleRequest method, how to use JAXRPC handlers in axis? Any idea? Thanks in advance... -Hari On Tue, Dec 16, 2008 at 6:56 AM, Guo Tianchong gu...@nec-as.nec.com.cn wrote: Hi, you can do something in the Handler's invoke() method and encapsulate a new SOAP body in the MessageContext object. Using AXIOM, that looks like : public InvocationResponse invoke(MessageContext msgContext) throws AxisFault { SOAPFactory fac = OMAbstractFactory.getSOAP12Factory(); OMNamespace soapNamespace = fac.createOMNamespace(Constants.URI_SOAP11_ENV, soap); // make envelope element SOAPEnvelope newEnvelope = fac.createSOAPEnvelope(soapNamespace); // make header element SOAPHeader header = fac.createSOAPHeader(newEnvelope); // add your header blocks here .. // make body element SOAPBody body = fac.createSOAPBody(newEnvelope); // add your body response here // body.addChild(.) msgContext.setEnvelope(newEnvelope); return InvocationResponse.CONTINUE; } Please have a try. guo - Original Message - From: Harikrishna Vemula To: axis-user@ws.apache.org Sent: Monday, December 15, 2008 10:36 PM Subject: Axis 1.3 - Problem with Handler Hi, I have a Webservice for that i implemented a Handler to validate input request with XSD. Whenever any exception occurs in invoke method i'm throwing AxisFault. But client doesn't want to have exception as return value even though any exception occurs. Client is expecting to recieve a normal SOAP response with ErrorCode ErrorMsg parameters in the response. How can i send response with ErrorCode ErrorMsg when any exception raised in Handlers? Please help me out, this is an urgent requirement. Thanks in advance... -- Hari Krishna Vemula -- Hari Krishna Vemula
Re: [Axis2] How to resolve the ...Must Understand check.. exception for Response SOAP message
Yesterday, I resolved the problem by myself. I added the following code snippet into my client before operationClient.execute(true); ... AxisConfiguration ac = outMsgCtx.getConfigurationContext().getAxisConfiguration(); ArrayList al = new ArrayList(); al.add(new MustUnderstandHandler()); ac.setInPhasesUptoAndIncludingPostDispatch(al); ... In the MustUnderstandHandler class, mustUnderstand headblock is set processed = true. Then the mustUnderstand exception didn't come out! Thanks. Guo - Original Message - From: Guo Tianchong [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Thursday, December 04, 2008 3:06 PM Subject: [Axis2] How to resolve the ...Must Understand check.. exception for Response SOAP message | Dear Axis's master: | | I'm a programer using Axis2 1.4.1 to develope a Web Service application. | Now, I have met a problem about the famous Must Understand check. | But my case is a litter special. | | The detail is that : | | I used org.apache.axis2.client.OperationClient API to construct a custom | SOAP message and send it to my Web Service like this: | | .. | MessageContext outMsgCtx = new MessageContext(); | outMsgCtx.setEnvelope(buildOutEnvelope()); | | Options opts = outMsgCtx.getOptions(); | opts.setTo(TARGET_EPR); | opts.setAction(urn:download); | | operationClient.addMessageContext(outMsgCtx); | operationClient.execute(true); | .. | | By the SOAP Monitor and server log, I could judged that the Web Service did work | and returned desired SOAP message. | One of my Response message header block included mustUnderstand | attributes, such as: | | ... | soap:Header |xxx:ID soap:mustUnderstand=142/xxx:ID | /soap:Header | ... | | # |Please NOTE: It's in Response Message. | | | And then the following exception came out: | .. | org.apache.axis2.AxisFault: Must Understand check failed for header .. |at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:102) |at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:166) |at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:363) |at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416) |at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) |at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) | .. | | | At the server side, I could create a custom Handler in a module | and engage it to the Service to resolve this problem. | But now, it's Client. So how can I resolve this problem using Client API or other method? | | Could you have any ideas? | Thank you | | - | 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]
[Axis2] How to resolve the ...Must Understand check.. exception for Response SOAP message
Dear Axis's master: I'm a programer using Axis2 1.4.1 to develope a Web Service application. Now, I have met a problem about the famous Must Understand check. But my case is a litter special. The detail is that : I used org.apache.axis2.client.OperationClient API to construct a custom SOAP message and send it to my Web Service like this: .. MessageContext outMsgCtx = new MessageContext(); outMsgCtx.setEnvelope(buildOutEnvelope()); Options opts = outMsgCtx.getOptions(); opts.setTo(TARGET_EPR); opts.setAction(urn:download); operationClient.addMessageContext(outMsgCtx); operationClient.execute(true); .. By the SOAP Monitor and server log, I could judged that the Web Service did work and returned desired SOAP message. One of my Response message header block included mustUnderstand attributes, such as: ... soap:Header xxx:ID soap:mustUnderstand=142/xxx:ID /soap:Header ... # Please NOTE: It's in Response Message. And then the following exception came out: .. org.apache.axis2.AxisFault: Must Understand check failed for header .. at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:102) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:166) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:363) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) .. At the server side, I could create a custom Handler in a module and engage it to the Service to resolve this problem. But now, it's Client. So how can I resolve this problem using Client API or other method? Could you have any ideas? Thank you Guo Tianchong 1rd Development Department Network Software Research and Development Division NEC Advanced Software Technology Co., Ltd. 20F, SHINING TOWER, No.35, XueYuan Road, HaiDian District, Beijing 100191, P.R.China E-MAIL: [EMAIL PROTECTED] TEL: 86-10-82334433-624 FAX: 86-10-82334434 TELNET: 8-0086-22-624 HP: www.nec-as.com.cn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]