Hi Renjith,
Cool, nice to here that you got it working... See the comments in line;
On 7/14/07, Renjith <[EMAIL PROTECTED]> wrote:
Hi Ruwan,
Thanks for the information.
With the information provided by you, I am able to get proxy service
worked.
Let me repeat my original question and your proposed solution so that I
can get some help with XSLT:
*ORIGINAL QUESTION:*
"Let me explain how I developed the WebServices. I started
developing the code from the WSDL the ERP client provides. And it is
as shown in attached ERPAPISvc.wsdl (Namespace is
"*http://developer.intuit.com*"). And when I deployed the service it
worked fine with the client (Let say Client1).
But we have 2 or more client program that can use the same
service.
But that client exists in our System in different Namespace. As
described in MySvc.wsdl (Namespace is "*http://sync.dtc.com/*").
So when I tried to change the existing Namespace
"http://developer.intuit.com" to "*http://sync.dtc.com/*" the Client1
(build using ERPAPISvc.wsdl)
stop working and throws unexpected subelement strUserName. And all
other client program (build using MySvc.wsdl) starts running.
So what I am trying to do is make all client works with code
developed from same wsdl (MySvc.wsdl) and having the namespace
"*http://sync.dtc.com/*"."
* AND THE SOLUTION PROPOSED BY YOU WAS*:(I modified 2 values as per my
understading)
<definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="$NAME_OF_THE_PROXY">
<target>
<inSequence>
<xslt key*="$XSLT_FILE_REGISTRY_KEY*"/>
</inSequence>
<endpoint>
<address uri=" *http://localhost:8080/axis2/services/MySvc
*"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/*ERPAPISvc.wsdl*"/>
</proxy>
</definitions>
In the XSLT you have to transform the NS from one to another.
Note : I have modified the address URI to
http://localhost:8080/axis2/services/MySvc (It is been running in
JBOSS-TOMCAT server where *MySvc.wsdl* is been published)
And I am supposed to keep *ERPAPI.wsdl* in publishWSDL-uri rt? Please
correct me if I am wrong.
You are absolutely correct.
Could you please guide me in creating the XSLT & configure the same in
definitions file OR using WSO2 ESB.
Yes sure.
Now you need to create a XSLT which will transform the name space from "
http://sync.dtc.com/" to "http://developer.intuit.com" and put that in the
repository of synapse (will say $XSLT_FILE_REGISTRY_KEY).
Since you need to transform the NS of the request you could specify the
element which contains the NS declaration in the request to the XSLT
mediator using the attribute "source" as an XPATH (to do this you need to
know the exact request that is coming to synapse)
Now your configuration for the XSLT mediator will be something like this
<xslt key="$XSLT_FILE_REGISTRY_KEY" source="&XPATH_TO_THE_NS_DECLARATION" />
Your xslt file should looks something like the following
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="
1.0">
<xsl:template match="*">
<xsl:text>http://developer.intuit.com</xsl:text>
</xsl:template>
</xsl:stylesheet>
I assume that you can get the XPATH expression to get the NS declaration,
you can refer to the followings on XSLT and XPATH.
[1] - http://www.w3schools.com/xpath/xpath_examples.asp
[2] - http://www.cafeconleche.org/books/xmljava/chapters/ch16.html
[3] - http://www.w3schools.com/xsl/default.asp
If you are having any issues with this feel free to go for any more
clarifications...
Thanks,
Ruwan** <http://sync.dtc.com/>
--
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"