Simple Rampart 1.3 example for Axis2-1.3.
Hi List, I have being trying out some simple examples with Axis2-1.3 and Rampart 1.3 with out any luck. I have taken an example from the Rampart 1.3 samples and I have been trying to invoke the service from SOAPUI (as this is what we use for testing). When I try this I get the following error: org.apache.axis2.AxisFault: WSDoAllReceiver: Incoming message does not contain required Security header Does anyone have any ideas why? I have included my rampart config from the services.xml and soap message below which does have a security header. The WSDoAllReceiver class is distributed with rampart I and can't find the source to download so I can't debug it. The service I'm using has the following configuration in the services.xml file: ... module ref=rampart / parameter name=InflowSecurity action itemsUsernameToken Timestamp/items passwordCallbackClassgss.webservice.samples.GSSLoginHandler/passwordC allbackClass /action /parameter-- ... The Soap message I'm trying from SOAP UI is: soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope; xmlns:xsd=http://samples.webservice.gss/xsd; xmlns:wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse curity-secext-1.0.xsd soap:Header wsse:Security soap:mustUnderstand=1 wsse:UsernameToken wsse:Usernameuser1/wsse:Username wsse:Passwordtest/wsse:Password /wsse:UsernameToken /wsse:Security /soap:Header soap:Body ... thanks in advance Adam.
RE: retrieving MTOM in a client
Hi, The server I'm running on is JBOSS 4.0.3SP1. Here is the complete HTTP response. Adam HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-Powered-By: Servlet 2.4; JBoss-4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231054)/Tomcat-5.5 Content-Type: application/xml;charset=UTF-8 Transfer-Encoding: chunked Date: Mon, 18 Feb 2008 11:37:15 GMT 494 --MIMEBoundaryurn_uuid_4DDAF973E789AF02831203334635830 Content-Type: application/xop+xml; charset=UTF-8; type=application/soap+xml Content-Transfer-Encoding: binary Content-ID: 0.urn:uuid:[EMAIL PROTECTED] ns:mapResponse xmlns:ns=http://samples.webservice.gss/xsd;ns:returnns:mapns:map_return_typens:display_style_nameAuto/ns:display_style_name ns:crsuk_british_national_grid_mm/ns:crsns:centre283355000.00,542605000.00/ns:centrens:image_layers{sw_map=com.gesmallworld.gss.ser [EMAIL PROTECTED]/ns:image_layersns:unitsmm/ns:unitsns:style_groupdefault/ns:style_groupns:options{}/ns:optionsns:view _scale9846153.846153846/ns:view_scalens:rotation0.0/ns:rotationns:map_element_keyswrefVdisplay_styleVidZ0Q1/ns:map_element_keyns:worldswr efVworldVdatasetZgisVuniverseZ0VworldZ0/ns:worldns:ace_namedefault/ns:ace_namens:namesw_default/ns:namens:map_imagexop:Include href=cid: 1.urn:uuid:[EMAIL PROTECTED] xmlns:xop=http://www.w3.org/2004/08/xop/include; //ns:map_image/ns:map_return_type/ns:ma p/ns:return/ns:mapResponse 38 --MIMEBoundaryurn_uuid_4DDAF973E789AF02831203334635830 59d Content-Type: image/jpeg Content-Transfer-Encoding: binary Content-ID: 1.urn:uuid:[EMAIL PROTECTED] ►JFIFC ♠ ↔§▬#▼%$▼!+7/)4)!0A149;%.DICH7=;C☺ .REMOVED REST OF BINARY FILE... -Original Message- From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: 19 February 2008 02:54 To: axis-user@ws.apache.org Subject: Re: retrieving MTOM in a client Hi, the content type should be as follows.. Content-Type: Multipart/Related;boundary=your_MIME_boundary; type=application/xop+xml;start=... Looks like Axis2 does not recognize your message as a MTOM message..It should print the binary payload in base64 encoding if it does, not the xop:Include element.. What is your server.. Can you post the full HTTP Headers... thanks, Thilina On Feb 18, 2008 10:50 AM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Hi, The http headers have the content-type set to application/xop+xml, this seems incorrect should it be multipart? Below is the system print of the mapImage element: ns:map_image xmlns:ns=http://samples.webservice.gss/xsd;xop:Include xmlns:xop=http://www.w3.org/2004/08/xop/include; href=cid:1.urn:uuid:[EMAIL PROTECTED] //ns:map_image thanks for the help. Adam From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: 16 February 2008 13:49 To: axis-user@ws.apache.org Subject: Re: retrieving MTOM in a client Hi, The SOAP Message looks fine... Can you also look at the HTTPHeaders.. Specially the content-type header and see whether it has multipart/related and type=application/xop+xml I doubt whether something is wrong in the content type and Axis2 cannot recognize it as a MTOM message.. Also try printing the content of the mapImage element using mapImage.toString()... thanks, Thilina On Feb 13, 2008 11:31 AM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Thanks Thilina, the SOAP message is below: I'm sure the client worked once but then stopped? The client code extract is: OMText binaryNode = (OMText) mapImage.getFirstOMChild(); DataHandler actualDH = (DataHandler) binaryNode.getDataHandler(); soapenv:Envelope xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope; soapenv:Body ns:mapResponse xmlns:ns=http://samples.webservice.gss/xsd; ns:return ns:map ns:map_return_type ns:display_style_nameRegion/ns:display_style_name ns:crsuk_british_national_grid_mm/ns:crs ns:centre546307392.00,258873636.00/ns:centre ns:image_layers{sw_map=com.gesmallworld.gss.services.map.MapLayerR espo [EMAIL PROTECTED]/ns:image_layers ns:unitsmm/ns:units ns:style_groupdefault/ns:style_group ns:options{}/ns:options ns:view_scale127020.02565384615/ns:view_scale ns:rotation0.0/ns:rotation ns:map_element_keyswrefVdisplay_styleVidZ0Q6/ns:map_element_key ns:worldswrefVworldVdatasetZgisVuniverseZ0VworldZ0/ns:world ns:ace_namedefault/ns:ace_name ns:nametest/ns:name ns:map_image xop:Include href=cid:1.urn:uuid:[EMAIL PROTECTED] xmlns:xop=http://www.w3.org/2004/08/xop/include/ /ns:map_image /ns:map_return_type /ns:map /ns:return /ns:mapResponse /soapenv:Body
RE: retrieving MTOM in a client
Thanks, Any ideas where this is configured or set up? Adam -Original Message- From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: 19 February 2008 12:29 To: axis-user@ws.apache.org Subject: Re: retrieving MTOM in a client Hi, As I expected, the content-type http header is incorrect.. See here[1] for an example from the spec.. Content-Type: application/xml;charset=UTF-8 This should be as follows, Content-Type: Multipart/Related; boundary=MIMEBoundaryurn_uuid_4DDAF973E789AF02831203334635830;type=application/xop+xml;start=...; What surprises me is the fact that, Axis2 extracted the SOAP message without knowing the Mime Boundary :). thanks, Thilina [1] http://www.w3.org/TR/2004/PR-xop10-20041116/#xop_package_svg_sample Transfer-Encoding: chunked Date: Mon, 18 Feb 2008 11:37:15 GMT 494 --MIMEBoundaryurn_uuid_4DDAF973E789AF02831203334635830 Content-Type: application/xop+xml; charset=UTF-8; type=application/soap+xml Content-Transfer-Encoding: binary Content-ID: 0.urn:uuid:[EMAIL PROTECTED] ns:mapResponse xmlns:ns=http://samples.webservice.gss/xsd;ns:returnns:mapns:ma p_return_typens:display_style_nameAuto/ns:display_style_name ns:crsuk_british_national_grid_mm/ns:crsns:centre283355000. 00,542605000.00/ns:centrens:image_layers{sw_map=com.gesmallwo rld.gss.ser [EMAIL PROTECTED]/ns:image_layersns:unitsmm/ns:u nitsns:style_groupdefault/ns:style_groupns:options{}/ns:option sns:view _scale9846153.846153846/ns:view_scalens:rotation0.0/ns:rotation ns:map_element_keyswrefVdisplay_styleVidZ0Q1/ns:map_element_keyns :worldswr efVworldVdatasetZgisVuniverseZ0VworldZ0/ns:worldns:ace_namedefault/ns:ace_namens:namesw_default/ns:namens:map_imagexop:Include href=cid: 1.urn:uuid:[EMAIL PROTECTED] xmlns:xop=http://www.w3.org/2004/08/xop/include; //ns:map_image/ns:map_return_type/ns:ma p/ns:return/ns:mapResponse 38 --MIMEBoundaryurn_uuid_4DDAF973E789AF02831203334635830 59d Content-Type: image/jpeg Content-Transfer-Encoding: binary Content-ID: 1.urn:uuid:[EMAIL PROTECTED] ►JFIFC ♠ ↔§▬#▼%$▼!+7/)4)!0A149;%.DICH7=;C☺ .REMOVED REST OF BINARY FILE... -Original Message- From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: 19 February 2008 02:54 To: axis-user@ws.apache.org Subject: Re: retrieving MTOM in a client Hi, the content type should be as follows.. Content-Type: Multipart/Related;boundary=your_MIME_boundary; type=application/xop+xml;start=... Looks like Axis2 does not recognize your message as a MTOM message..It should print the binary payload in base64 encoding if it does, not the xop:Include element.. What is your server.. Can you post the full HTTP Headers... thanks, Thilina On Feb 18, 2008 10:50 AM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Hi, The http headers have the content-type set to application/xop+xml, this seems incorrect should it be multipart? Below is the system print of the mapImage element: ns:map_image xmlns:ns=http://samples.webservice.gss/xsd;xop:Include xmlns:xop=http://www.w3.org/2004/08/xop/include; href=cid:1.urn:uuid:[EMAIL PROTECTED] //ns:map_image thanks for the help. Adam From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: 16 February 2008 13:49 To: axis-user@ws.apache.org Subject: Re: retrieving MTOM in a client Hi, The SOAP Message looks fine... Can you also look at the HTTPHeaders.. Specially the content-type header and see whether it has multipart/related and type=application/xop+xml I doubt whether something is wrong in the content type and Axis2 cannot recognize it as a MTOM message.. Also try printing the content of the mapImage element using mapImage.toString()... thanks, Thilina On Feb 13, 2008 11:31 AM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Thanks Thilina, the SOAP message is below: I'm sure the client worked once but then stopped? The client code extract is: OMText binaryNode = (OMText) mapImage.getFirstOMChild(); DataHandler actualDH = (DataHandler) binaryNode.getDataHandler(); soapenv:Envelope xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope; soapenv:Body ns:mapResponse xmlns:ns=http://samples.webservice.gss/xsd; ns:return ns:map ns:map_return_type ns:display_style_nameRegion/ns:display_style_name ns:crsuk_british_national_grid_mm/ns:crs ns:centre546307392.00,258873636.00/ns:centre ns:image_layers{sw_map=com.gesmallworld.gss.services.map.MapLaye rR espo [EMAIL PROTECTED]/ns:image_layers ns:unitsmm/ns:units ns:style_groupdefault/ns:style_group ns:options{}/ns:options
RE: retrieving MTOM in a client
Hi, The http headers have the content-type set to application/xop+xml, this seems incorrect should it be multipart? Below is the system print of the mapImage element: ns:map_image xmlns:ns=http://samples.webservice.gss/xsd;xop:Include xmlns:xop=http://www.w3.org/2004/08/xop/include; href=cid:1.urn:uuid:[EMAIL PROTECTED] //ns:map_image thanks for the help. Adam _ From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: 16 February 2008 13:49 To: axis-user@ws.apache.org Subject: Re: retrieving MTOM in a client Hi, The SOAP Message looks fine... Can you also look at the HTTPHeaders.. Specially the content-type header and see whether it has multipart/related and type=application/xop+xml I doubt whether something is wrong in the content type and Axis2 cannot recognize it as a MTOM message.. Also try printing the content of the mapImage element using mapImage.toString()... thanks, Thilina On Feb 13, 2008 11:31 AM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Thanks Thilina, the SOAP message is below: I'm sure the client worked once but then stopped? The client code extract is: OMText binaryNode = (OMText) mapImage.getFirstOMChild(); DataHandler actualDH = (DataHandler) binaryNode.getDataHandler(); soapenv:Envelope xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope; soapenv:Body ns:mapResponse xmlns:ns=http://samples.webservice.gss/xsd; ns:return ns:map ns:map_return_type ns:display_style_nameRegion/ns:display_style_name ns:crsuk_british_national_grid_mm/ns:crs ns:centre546307392.00,258873636.00/ns:centre ns:image_layers{sw_map=com.gesmallworld.gss.services.map.MapLayerRespo [EMAIL PROTECTED]/ns:image_layers ns:unitsmm/ns:units ns:style_groupdefault/ns:style_group ns:options{}/ns:options ns:view_scale127020.02565384615/ns:view_scale ns:rotation0.0/ns:rotation ns:map_element_keyswrefVdisplay_styleVidZ0Q6/ns:map_element_key ns:worldswrefVworldVdatasetZgisVuniverseZ0VworldZ0/ns:world ns:ace_namedefault/ns:ace_name ns:nametest/ns:name ns:map_image xop:Include href=cid:1.urn:uuid:[EMAIL PROTECTED] xmlns:xop=http://www.w3.org/2004/08/xop/include/ /ns:map_image /ns:map_return_type /ns:map /ns:return /ns:mapResponse /soapenv:Body /soapenv:Envelope -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 13 February 2008 14:48 To: axis-user@ws.apache.org Subject: Re: retrieving MTOM in a client Hi Adam, It would be helpfull if you post the SOAP message... Thilina On 2/12/08, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: I'm using MTOM in a java client but when I try to retrieve the OMText at the client side i.e.: OMText binaryNode = (OMText) mapImage.getFirstOMChild(); I get a class cast exception, since the response is returning an OMElement and not OMText anyone come across this before? I've checked the soap message and it does actually include the binary data. Thanks in advance Adam -- Thilina Gunarathne - http://thilinag.blogspot.com - 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] -- Thilina Gunarathne - http://thilinag.blogspot.com
RE: retrieving MTOM in a client
Thanks Thilina, the SOAP message is below: I'm sure the client worked once but then stopped? The client code extract is: OMText binaryNode = (OMText) mapImage.getFirstOMChild(); DataHandler actualDH = (DataHandler) binaryNode.getDataHandler(); soapenv:Envelope xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope; soapenv:Body ns:mapResponse xmlns:ns=http://samples.webservice.gss/xsd; ns:return ns:map ns:map_return_type ns:display_style_nameRegion/ns:display_style_name ns:crsuk_british_national_grid_mm/ns:crs ns:centre546307392.00,258873636.00/ns:centre ns:image_layers{sw_map=com.gesmallworld.gss.services.map.MapLayerRespo [EMAIL PROTECTED]/ns:image_layers ns:unitsmm/ns:units ns:style_groupdefault/ns:style_group ns:options{}/ns:options ns:view_scale127020.02565384615/ns:view_scale ns:rotation0.0/ns:rotation ns:map_element_keyswrefVdisplay_styleVidZ0Q6/ns:map_element_key ns:worldswrefVworldVdatasetZgisVuniverseZ0VworldZ0/ns:world ns:ace_namedefault/ns:ace_name ns:nametest/ns:name ns:map_image xop:Include href=cid:1.urn:uuid:[EMAIL PROTECTED] xmlns:xop=http://www.w3.org/2004/08/xop/include/ /ns:map_image /ns:map_return_type /ns:map /ns:return /ns:mapResponse /soapenv:Body /soapenv:Envelope -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 13 February 2008 14:48 To: axis-user@ws.apache.org Subject: Re: retrieving MTOM in a client Hi Adam, It would be helpfull if you post the SOAP message... Thilina On 2/12/08, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: I'm using MTOM in a java client but when I try to retrieve the OMText at the client side i.e.: OMText binaryNode = (OMText) mapImage.getFirstOMChild(); I get a class cast exception, since the response is returning an OMElement and not OMText anyone come across this before? I've checked the soap message and it does actually include the binary data. Thanks in advance Adam -- Thilina Gunarathne - http://thilinag.blogspot.com - 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]
retrieving MTOM in a client
I'm using MTOM in a java client but when I try to retrieve the OMText at the client side i.e.: OMText binaryNode = (OMText) mapImage.getFirstOMChild(); I get a class cast exception, since the response is returning an OMElement and not OMText anyone come across this before? I've checked the soap message and it does actually include the binary data. Thanks in advance Adam
RE: getCurrentMessageContext() returns null when invoked from an EJB?
Thanks for the advice. I can see the problem now and it's the EJB pooling which will force a different thread. What I need to do is to use the messageContext to access the HHTP headers so I can dig out a sessionid to do some state tracking with in the current application. I guess I can force the client to supply a session id as a param. Adam _ From: Afkham Azeez [mailto:[EMAIL PROTECTED] Sent: 22 January 2008 18:19 To: axis-user@ws.apache.org Subject: Re: getCurrentMessageContext() returns null when invoked from an EJB? The problem is that the current MessageContext is store in a ThreadLocal of the thread that received the Web service request. It is possible that this is not the same thread that is running within the EJB. The EJB is within the control of the AppServer. The AppServer maintains a pool of bean instances and handles thread allocation. Therefore, the thread that received the Web service request, and the EJB thread that runs you bean are two different threads. So MessageContext.getCurrentMessageContext() will return null within the EJB implementation object. May I ask, why are you trying to access the MessageContext within an EJB? MessageContext is an Axis2 level concept. Why are you burning that into your EJB, which should be independent from the Axis2 Web service framework. HTH Azeez On Jan 22, 2008 8:29 PM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Hi, The Axis jars are in the lib directory of the axis2 project and the ejb jar definition has a class path property in the manifest.mf to load them from axis2_home/lib directory. The call to the ejb is from the same JVM as the web service so the calls are all 'ejb local'. I have followed the steps documented in the guide http://ws.apache.org/axis2/1_2/ejb-provider.html and I have reproduced the problem on this example. All I did was to add the messagecontext call to the HelloBean.java sayHello method : MessageContext msgCtx = MessageContext.getCurrentMessageContext(); System.err.print(msgCtx); Then I modified the HelloBean's ejb manifest.mf to include a class path for axis2-kernel-1.3.jar and axiom-api-1.2.5.jar and deployed this bean in JBOSS. When I execute this service the print from STDOUT reports the msgCtx as null. It's getting a bit frustrating now. Adam _ From: Andreas Veithen [mailto:[EMAIL PROTECTED] Sent: 21 January 2008 21:49 To: axis-user@ws.apache.org Subject: Re: getCurrentMessageContext() returns null when invoked from an EJB? Hi, MessageContext stores the current message context in a ThreadLocal. To be able to retrieve it, two conditions must be met: 1) The Axis JARs must be loaded from the same class loader. 2) MessageContext#getCurrentMessageContext must be called from within the thread that received the request. For point 1: Where did you put the Axis JARs? For point 2: I'm not very familiar with EJBs, but it might be that this is the case only if the EJB is called through its local interface. Regards, Andreas On 21 Jan 2008, at 15:39, Etches, Adam (GE Infra, Energy) wrote: Hi all first time posting... I have been looking at implementing web services in axis2-1.3 with EJB 2.1. I need to get a handle on the message from with in the service implementation. I believe the correct approach for this is to invoke the method getCurrentMessageContext() on MessageContext from with in the service. I have tried this in a test pojo service which correctly returns the message context but when called *BUT* when invoking this method from an EJB null is returned. Does anyone know why the getCurrentMessageContext() returns null when invoked from an EJB? thanks Adam -- Thanks Afkham Azeez http://www.wso2.org GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760
RE: getCurrentMessageContext() returns null when invoked from an EJB?
I'm invoking a web service which implementation is an EJB. _ From: Afkham Azeez [mailto:[EMAIL PROTECTED] Sent: 22 January 2008 05:51 To: axis-user@ws.apache.org Subject: Re: getCurrentMessageContext() returns null when invoked from an EJB? Are you trying to invoke a Web service from within an EJB or are you trying to invoke an EJB from within a Web service? Azeez On Jan 21, 2008 8:09 PM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Hi all first time posting... I have been looking at implementing web services in axis2-1.3 with EJB 2.1. I need to get a handle on the message from with in the service implementation. I believe the correct approach for this is to invoke the method getCurrentMessageContext() on MessageContext from with in the service. I have tried this in a test pojo service which correctly returns the message context but when called *BUT* when invoking this method from an EJB null is returned. Does anyone know why the getCurrentMessageContext() returns null when invoked from an EJB? thanks Adam -- Thanks Afkham Azeez http://www.wso2.org GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760
RE: getCurrentMessageContext() returns null when invoked from an EJB?
Hi, The Axis jars are in the lib directory of the axis2 project and the ejb jar definition has a class path property in the manifest.mf to load them from axis2_home/lib directory. The call to the ejb is from the same JVM as the web service so the calls are all 'ejb local'. I have followed the steps documented in the guide http://ws.apache.org/axis2/1_2/ejb-provider.html and I have reproduced the problem on this example. All I did was to add the messagecontext call to the HelloBean.java sayHello method : MessageContext msgCtx = MessageContext.getCurrentMessageContext(); System.err.print(msgCtx); Then I modified the HelloBean's ejb manifest.mf to include a class path for axis2-kernel-1.3.jar and axiom-api-1.2.5.jar and deployed this bean in JBOSS. When I execute this service the print from STDOUT reports the msgCtx as null. It's getting a bit frustrating now. Adam _ From: Andreas Veithen [mailto:[EMAIL PROTECTED] Sent: 21 January 2008 21:49 To: axis-user@ws.apache.org Subject: Re: getCurrentMessageContext() returns null when invoked from an EJB? Hi, MessageContext stores the current message context in a ThreadLocal. To be able to retrieve it, two conditions must be met: 1) The Axis JARs must be loaded from the same class loader. 2) MessageContext#getCurrentMessageContext must be called from within the thread that received the request. For point 1: Where did you put the Axis JARs? For point 2: I'm not very familiar with EJBs, but it might be that this is the case only if the EJB is called through its local interface. Regards, Andreas On 21 Jan 2008, at 15:39, Etches, Adam (GE Infra, Energy) wrote: Hi all first time posting... I have been looking at implementing web services in axis2-1.3 with EJB 2.1. I need to get a handle on the message from with in the service implementation. I believe the correct approach for this is to invoke the method getCurrentMessageContext() on MessageContext from with in the service. I have tried this in a test pojo service which correctly returns the message context but when called *BUT* when invoking this method from an EJB null is returned. Does anyone know why the getCurrentMessageContext() returns null when invoked from an EJB? thanks Adam
getCurrentMessageContext() returns null when invoked from an EJB?
Hi all first time posting... I have been looking at implementing web services in axis2-1.3 with EJB 2.1. I need to get a handle on the message from with in the service implementation. I believe the correct approach for this is to invoke the method getCurrentMessageContext() on MessageContext from with in the service. I have tried this in a test pojo service which correctly returns the message context but when called *BUT* when invoking this method from an EJB null is returned. Does anyone know why the getCurrentMessageContext() returns null when invoked from an EJB? thanks Adam
RE: getCurrentMessageContext() returns null when invoked from an EJB?
The service is called from Axis2 processing the request so I would expect the message Context to be populated. Adam _ From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: 21 January 2008 19:18 To: axis-user@ws.apache.org Subject: Re: getCurrentMessageContext() returns null when invoked from an EJB? Hi, What do you mean by invoking from an EJB.. Are you invoking the service method directly without going through Axis2 (not doing an service invocation). If that's the case it should return a NULL as there does not exist an Axis2 created MessageContext.. ~Thilina On Jan 21, 2008 9:39 AM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Hi all first time posting... I have been looking at implementing web services in axis2-1.3 with EJB 2.1. I need to get a handle on the message from with in the service implementation. I believe the correct approach for this is to invoke the method getCurrentMessageContext() on MessageContext from with in the service. I have tried this in a test pojo service which correctly returns the message context but when called *BUT* when invoking this method from an EJB null is returned. Does anyone know why the getCurrentMessageContext() returns null when invoked from an EJB? thanks Adam -- Thilina Gunarathne - http://thilinag.blogspot.com
RE: getCurrentMessageContext() returns null when invoked from an EJB?
A took a look at the document and it doesn't reference getCurrentMessageContext() so no help there. Adam _ From: Afkham Azeez [mailto:[EMAIL PROTECTED] Sent: 21 January 2008 21:10 To: axis-user@ws.apache.org Subject: Re: getCurrentMessageContext() returns null when invoked from an EJB? Did you take a look at http://ws.apache.org/axis2/1_2/ejb-provider.html ? Azeez On Jan 21, 2008 8:09 PM, Etches, Adam (GE Infra, Energy) [EMAIL PROTECTED] wrote: Hi all first time posting... I have been looking at implementing web services in axis2-1.3 with EJB 2.1. I need to get a handle on the message from with in the service implementation. I believe the correct approach for this is to invoke the method getCurrentMessageContext() on MessageContext from with in the service. I have tried this in a test pojo service which correctly returns the message context but when called *BUT* when invoking this method from an EJB null is returned. Does anyone know why the getCurrentMessageContext() returns null when invoked from an EJB? thanks Adam -- Thanks Afkham Azeez http://www.wso2.org GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760