Re: Axis2 Sockets
AFAIK it's the default behavior in case of request/response interaction, unless the incoming message had a ws-addressing reply-to EPR pointing to another listener.. May be I'm missing something.. Can you explain your issue more.. thanks, Thilina On Fri, Mar 7, 2008 at 5:44 AM, Daniel Silva <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > I have a web service based on axis2. > > > > I need to send the response over the same socket of the request. It seems > this is not happening using newMsgContext.setEnvelope(envelope) method. > > However the Service_MessageReceiverInOut class extends > AbstractInOutSyncMessageReceiver. Shouldn't this be synchronized over the > same socket? > > Is there any Option/Property/Configuration to set this? > > > > Thanks in advance. > > > > Best regards, > > > > Daniel Silva > > Software Developer > > > > [EMAIL PROTECTED] > > www.alert-online.com > > > > ALERT Life Sciences Computing, S.A. > > Edifício Lake Towers > > Rua Daciano Baptista Marques, n.º 245, Bloco D > > 4400-617 Vila Nova de Gaia > > > > Tel.: +351 22 832 89 80/1 > > Fax: +351 22 832 89 82 > > [EMAIL PROTECTED] > > This e-mail is privileged, confidential and contains private information. > Any reading, retention, distribution or copying of this communication by any > person other than its intended recipient is prohibited. -- Thilina Gunarathne - http://thilinag.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis2 Sockets
Why? If the MEP is in/out with no complications (i.e. synchronous and with no redirections) you should be able to use the same socket. Michele On 7 Mar 2008, at 16:11, Thilina Gunarathne wrote: AFAIK it's the default behavior in case of request/response interaction - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Axis2 Sockets
Hi, I will explain what I'm doing. I'm developing a web service (server side) based on a predefined standard wsdl. I used wsdl2java to generate server side web service skeleton. I have the generated classes for types defined on schemas, the Skeleton (and Skeleton interface) and MessageReceiverInOut class. As I just need the received data in XML format, I will apply xsl tranformation to compose the response. I don't need to parse the XML to objects. So, I don't want that invokeBusinessLogic method calls fromOM method and I don't want an object from skeleton implementation. I implemented a myToEnvelope method to compose the XML response based on the received MessageContext. Having the response XML according to the defined return type I put it in a SOAPEnvelope and then set and send it by newMsgContext.setEnvelope(envelope). So, my MessageReceiverInOut class is something like this: (...) public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext) throws org.apache.axis2.AxisFault{ try { // get the implementation class for the Web Service Object obj = getTheImplementationObject(msgContext); PIXManager_ServiceSkeletonInterface skel = (PIXManager_ServiceSkeletonInterface)obj; //Out Envelop org.apache.axiom.soap.SOAPEnvelope envelope = null; //Find the axisOperation that has been set by the Dispatch phase. org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation(); if (op == null) { throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider"); } java.lang.String methodName; if((op.getName() != null) && ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName().getLocalPart())) != null)){ if("PIXManager_PRPA_IN201301UV".equals(methodName)){ envelope = myToEnvelope(msgContext); (...) newMsgContext.setEnvelope(envelope); (...) I can run this successfully with a client generated with wsdl2java, but when the request is made by other application the response is not sent (I'm tracing this with wireshark). I can handle both requests but the response is not sent in second case. In this moment I'm not sure what the cause for this. I attached the request messages: from our application client (that works) our.xml; and otherClient.xml that fails. Thank you in advance. Best regards, Daniel Silva -Original Message- From: Michele Mazzucco [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 7 de Março de 2008 16:34 To: axis-user@ws.apache.org Subject: Re: Axis2 Sockets Why? If the MEP is in/out with no complications (i.e. synchronous and with no redirections) you should be able to use the same socket. Michele On 7 Mar 2008, at 16:11, Thilina Gunarathne wrote: > AFAIK it's the default behavior in case of request/response > interaction - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://www.w3.org/2003/05/soap-envelope"; xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing";> http://192.168.230.1:8080/axis2/services/PIXManager_Service?wsdl urn:hl7-org:v3:PRPA_IN201301UV uuid:1.2.3.4.5.10512N1 http://localhost:8080/mesa/test tested device MESA Device ELLIE EPSILON 1 PINETREE WEBSTER MO 63119 http://www.w3.org/2003/05/soap-envelope";> http://www.w3.org/2001/XMLSchema-instance"; xsi:type="ns1:PRPA_IN201301UV" ITSVersion="XML_1.0"> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis2 Sockets
Just to give my 2 cents on this You can generate classes with no databinding (-d none option) so you get access to your raw xml message inside the skeleton Ajith 2008/3/7 Daniel Silva <[EMAIL PROTECTED]>: > Hi, > > I will explain what I'm doing. > I'm developing a web service (server side) based on a predefined standard > wsdl. > I used wsdl2java to generate server side web service skeleton. > I have the generated classes for types defined on schemas, the Skeleton (and > Skeleton interface) and MessageReceiverInOut class. > As I just need the received data in XML format, I will apply xsl > tranformation to compose the response. I don't need to parse the XML to > objects. > So, I don't want that invokeBusinessLogic method calls fromOM method and I > don't want an object from skeleton implementation. > I implemented a myToEnvelope method to compose the XML response based on the > received MessageContext. Having the response XML according to the defined > return type I put it in a SOAPEnvelope and then set and send it by > newMsgContext.setEnvelope(envelope). > > So, my MessageReceiverInOut class is something like this: > > (...) > public void invokeBusinessLogic(org.apache.axis2.context.MessageContext > msgContext, org.apache.axis2.context.MessageContext newMsgContext) > throws org.apache.axis2.AxisFault{ > > > try { > > // get the implementation class for the Web Service > Object obj = getTheImplementationObject(msgContext); > > PIXManager_ServiceSkeletonInterface skel = > (PIXManager_ServiceSkeletonInterface)obj; > //Out Envelop > org.apache.axiom.soap.SOAPEnvelope envelope = null; > //Find the axisOperation that has been set by the Dispatch phase. > org.apache.axis2.description.AxisOperation op = > msgContext.getOperationContext().getAxisOperation(); > > if (op == null) { > throw new org.apache.axis2.AxisFault("Operation is not located, if > this is doclit style the SOAP-ACTION should specified via the SOAP Action to > use the RawXMLProvider"); > } > > java.lang.String methodName; > if((op.getName() != null) && ((methodName = > org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName().getLocalPart())) > != null)){ > > > if("PIXManager_PRPA_IN201301UV".equals(methodName)){ > envelope = myToEnvelope(msgContext); > (...) > newMsgContext.setEnvelope(envelope); > (...) > > > I can run this successfully with a client generated with wsdl2java, but when > the request is made by other application the response is not sent (I'm > tracing this with wireshark). I can handle both requests but the response is > not sent in second case. > In this moment I'm not sure what the cause for this. > I attached the request messages: from our application client (that works) > our.xml; and otherClient.xml that fails. > > Thank you in advance. > > Best regards, > Daniel Silva > > > > > -Original Message- > From: Michele Mazzucco [mailto:[EMAIL PROTECTED] > Sent: sexta-feira, 7 de Março de 2008 16:34 > To: axis-user@ws.apache.org > Subject: Re: Axis2 Sockets > > Why? If the MEP is in/out with no complications (i.e. synchronous and > with no redirections) you should be able to use the same socket. > > Michele > > > On 7 Mar 2008, at 16:11, Thilina Gunarathne wrote: > > > AFAIK it's the default behavior in case of request/response > > interaction > > > - > 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] > -- Ajith Ranabahu Reading, after a certain age, diverts the mind too much from its creative pursuits. Any man who reads too much and uses his own brain too little falls into lazy habits of thinking - Albert Einstein - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis2 Sockets
oh.. Sorry for the confusion.. That's exactly what I meant. .Using the same socket is the default.. ~Thilina On Fri, Mar 7, 2008 at 11:34 AM, Michele Mazzucco <[EMAIL PROTECTED]> wrote: > Why? If the MEP is in/out with no complications (i.e. synchronous and > with no redirections) you should be able to use the same socket. > > Michele > > > > On 7 Mar 2008, at 16:11, Thilina Gunarathne wrote: > > > AFAIK it's the default behavior in case of request/response > > interaction > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Thilina Gunarathne - http://thilinag.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Axis2 Sockets
Hi, Thank you all for the provided help. In fact, the incoming message has a ws-addressing "reply-to" EPR pointing to another listener. This is the problem. When the response MessageContext is created, this values are automatically fielded. If I set "To" as: "newMsgContext.setTo(new EndpointReference("http://www.w3.org/2005/08/addressing/anonymous";));" it works. Thank you. Best regards, Daniel Silva Software Developer [EMAIL PROTECTED] www.alert-online.com ALERT Life Sciences Computing, S.A. Edifício Lake Towers Rua Daciano Baptista Marques, n.º 245, Bloco D 4400-617 Vila Nova de Gaia Tel.: +351 22 832 89 80/1 Fax: +351 22 832 89 82 This e-mail is privileged, confidential and contains private information. Any reading, retention, distribution or copying of this communication by any person other than its intended recipient is prohibited. -Original Message- From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: domingo, 9 de Março de 2008 20:33 To: axis-user@ws.apache.org Subject: Re: Axis2 Sockets oh.. Sorry for the confusion.. That's exactly what I meant. .Using the same socket is the default.. ~Thilina On Fri, Mar 7, 2008 at 11:34 AM, Michele Mazzucco <[EMAIL PROTECTED]> wrote: > Why? If the MEP is in/out with no complications (i.e. synchronous and > with no redirections) you should be able to use the same socket. > > Michele > > > > On 7 Mar 2008, at 16:11, Thilina Gunarathne wrote: > > > AFAIK it's the default behavior in case of request/response > > interaction > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- 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]
Re: Axis2 Sockets
Daniel, this sounds wrong to me. Can you post your client code please? Michele On 10 Mar 2008, at 19:13, Daniel Silva wrote: Hi, Thank you all for the provided help. In fact, the incoming message has a ws-addressing "reply-to" EPR pointing to another listener. This is the problem. When the response MessageContext is created, this values are automatically fielded. If I set "To" as: "newMsgContext.setTo(new EndpointReference ("http://www.w3.org/2005/08/addressing/anonymous";));" it works. Thank you. Best regards, Daniel Silva Software Developer [EMAIL PROTECTED] www.alert-online.com ALERT Life Sciences Computing, S.A. Edifício Lake Towers Rua Daciano Baptista Marques, n.º 245, Bloco D 4400-617 Vila Nova de Gaia Tel.: +351 22 832 89 80/1 Fax: +351 22 832 89 82 This e-mail is privileged, confidential and contains private information. Any reading, retention, distribution or copying of this communication by any person other than its intended recipient is prohibited. -Original Message- From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: domingo, 9 de Março de 2008 20:33 To: axis-user@ws.apache.org Subject: Re: Axis2 Sockets oh.. Sorry for the confusion.. That's exactly what I meant. .Using the same socket is the default.. ~Thilina On Fri, Mar 7, 2008 at 11:34 AM, Michele Mazzucco <[EMAIL PROTECTED]> wrote: Why? If the MEP is in/out with no complications (i.e. synchronous and with no redirections) you should be able to use the same socket. Michele On 7 Mar 2008, at 16:11, Thilina Gunarathne wrote: AFAIK it's the default behavior in case of request/response interaction - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]