-
15. Re: Problem invoking SOAPProxy Service from ServiceInvoker Client
h.wolffenbuttel Sep 21, 2011 5:27 AM (in response to clsimone)Hi Laura,
You can set your soapAction on your message like this:
;;;
public final
Message checkSOAPAction(Message message) {String currentSOAPAction = (String) message.getProperties().getProperty(MESSAGE_PROPERTY_SOAPACTION);
)) {message.getProperties().setProperty(
MESSAGE_PROPERTY_SOAPACTION, "\"" + preDefinedSOAPAction + "\"" );message.getProperties().remove(
MESSAGE_PROPERTY_HTTP_REQUEST );}
}
The preDefinedSOAPAction is your soapaction that is needed for SOAPProxy to work correctly. Be aware of the remove of the http-request, this is necessary to let the SOAPProxy use the SOAPAction message property.
I hope this helps.
Regards,
Hans
-
16. Re: Problem invoking SOAPProxy Service from ServiceInvoker Client
clsimone Sep 21, 2011 6:55 AM (in response to h.wolffenbuttel)Hi Hans,
Thank you for the response. So the solution would be to have an esb action after the xslt transformation and before routing. Or do you have any idea if there is any way that I could do this in a xsl transformation. In my xsl I have simple template for replacing the operation name like the following:
<xsl:template match="tns:ChangeInstancePowerState">
<ChangeVMInstancePowerState>
<xsl:apply-templates select="@*|node()" />
</ChangeVMInstancePowerState>
</xsl:template>
Thank you again,
Laura
-
17. Re: Problem invoking SOAPProxy Service from ServiceInvoker Client
clsimone Sep 21, 2011 6:02 PM (in response to clsimone)Hi Hans again,
I have implemented a custom esb action that adds the soapaction and it's ok. But now I have one more issue: I do the change for several operations, therefore I would need a way to retrieve the soapaction name from the WSDL in a dynamic way. Do you think would be possible or it's stupid what I'm asking?
Thank you,
Laura
-
18. Re: Problem invoking SOAPProxy Service from ServiceInvoker Client
dward Sep 22, 2011 12:32 AM (in response to clsimone)Hi Laura,
It's late where I am, so please bear with me.
Since you are the one that provided the WSDL URL to the SOAPProxy as a property, can't you provide the same WSDL URL as a property to your custom ESB action? That way you could "retrieve the soapaction name from the WSDL in a dynamic way" from inside your custom ESB action.
Maybe I'm misunderstanding what you're trying to do...
David
-
19. Re: Problem invoking SOAPProxy Service from ServiceInvoker Client
h.wolffenbuttel Sep 26, 2011 11:57 AM (in response to clsimone)Hi Laura,
The soapproxy is meant to dynamicaly fix this for you, as long as the sender gives you a proper soapaction. However this does not seem to be the case, so you need to do some similar mapping like the SOAPProxy does. This means determen the right soapaction from some unique element in your message. If the message itself is unique (per soapaction), you can do what David suggests, and use the WDSL to create the mapping.
An other option might be to make a service per soapaction and use a stacic router to send the message based on its contents to the right service to add the soapaction.
Regards,
Hans
-
20. Re: Problem invoking SOAPProxy Service from ServiceInvoker Client
clsimone Sep 28, 2011 5:06 AM (in response to h.wolffenbuttel)Hello everybody,
Thank you for your suggestions. As a fast, but not clean solution, I had in my custom action the body message parsed and based on the operation I set the soapaction in a static way.
I like better Hans's approach, to have a service per soapaction, but how can I make the difference between the services so that for a certain operation a certain service is used?
Thank you,
Laura
-
21. Re: Problem invoking SOAPProxy Service from ServiceInvoker Client
h.wolffenbuttel Sep 29, 2011 4:43 AM (in response to clsimone)Hi Laura,
Actually its not much different then what you are doing now, the static router which I suggested can also be a custom router which parses the message and uses the operation to route the message to the diferent services. You can also just pass the operation as a seperate value in your message attributes so you don't have to customize your router.
Regards,
Hans