Hi Ruwan,

 

Thank you for the reply.

I am very new to Synapse and also Axis2.

 

I was on a vacation; I started trying my luck using Synapse as per your
suggestion. I am just adding some more questions to our previous
conversation.

 

Could you please make me understand about the whole solution you proposed?

 

As per your suggestion for proxy service & transformation given below:

 

<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="$ACTUAL_SERVICE_EPR"/>

            </endpoint>

            <outSequence>

                <send/>

            </outSequence>

        </target>

        <publishWSDL uri="file:repository/$WSDL_FILE_NAME"/>

    </proxy>

</definitions>

 

I tried to set up a proxy service as a first step. These are steps I
followed.

 

1) I started my service using JBOSS-Tomcat Server and it is working on the
port "8080". The wsdl is visible using
"http://localhost:8008/axis2/services/SAMPLEAPISvc?wsdl";

 

2) Then I made changes to synapse_sample_100.xml file as below:

 

<definitions xmlns="http://ws.apache.org/ns/synapse";>

    <proxy name="SAMPLEAPISvc">

        <target>

            <endpoint>

                <address
uri="http://localhost:8008/axis2/services/SAMPLEAPISvc"/>

            </endpoint>

                  <outSequence>

                        <send/>

                  </outSequence>

        </target>

        <publishWSDL
uri="file:repository/conf/sample/resources/proxy/SAMPLEAPISvc.wsdl"/>

    </proxy>

</definitions>

 

3) Then I tried starting Synapse using the command synapse.bat -sample 100

 

4) This is giving me an error in Synapse console as below:

 

C:\synapse-1.0\bin>synapse.bat -sample 100

 Using Bouncy castle JAR for Java 1.4

Starting Synapse/Java ...

Using SYNAPSE_HOME:    C:\SYNAPS~1.0\bin\..

Using JAVA_HOME:       C:\j2sdk1.4.2_13

Using SYNAPSE_XML:
-Dsynapse.xml="C:\SYNAPS~1.0\bin\..\repository\conf\sample\synapse_sample_10
0.xml"

[SynapseServer] Using the Axis2 Repository C:\SYNAPS~1.0\bin\..\repository

[main] INFO  SynapseModule - Initializing the Synapse configuration ...

[main] INFO  XMLConfigurationBuilder - Generating the Synapse configuration
model by parsing the XML configuration

[main] INFO  SynapseConfigurationBuilder - Loaded Synapse configuration from
: C:\SYNAPS~1.0\bin\..\repository\conf\sample\synapse_sample_100.xml

[main] INFO  SynapseModule - Deploying the Synapse service..

[main] INFO  SynapseModule - Initializing Sandesha 2...

[main] INFO  SynapseModule - Deploying Proxy services...

java.lang.NoSuchMethodError: java.net.URLConnection.setReadTimeout(I)V

        at org.apache.synapse.config.Util.getOMElementFromURL(Util.java:150)

        at
org.apache.synapse.core.axis2.ProxyService.buildAxisService(ProxyService.jav
a:199)

        at
org.apache.synapse.core.axis2.SynapseModule.init(SynapseModule.java:109)

        at
org.apache.axis2.context.ConfigurationContextFactory.initModules(Configurati
onContextFactory.java:209)

        at
org.apache.axis2.context.ConfigurationContextFactory.init(ConfigurationConte
xtFactory.java:189)

        at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationCont
ext(ConfigurationContextFactory.java:72)

        at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationCont
extFromFileSystem(ConfigurationContextFactory.java:174)

        at org.apache.synapse.SynapseServer.main(SynapseServer.java:60)

[SynapseServer] Startup failed...

 

 

Could you please guide me in solving this basic issue? I'm sure that I did
something terribly wrong.

 

 

Note: One Important question I should ask about proxy service is that, in my
case I cannot make change in code or the way it generated. Only thing I can
change is the uri to access the Service. Right now the URI that is accessing
by client is set to 

http://localhost: <http://localhost:8008/axis2/services/SAMPLEAPISvc>
8008/axis2/services/SAMPLEAPISvc , where 8008 is the port that is using by
Synpase. Is this the right way to make Synapse a mediator for service that
is been running in port 8080? Because in my case I cannot use
-Daddurl=<addressingEPR> -Dtrpurl=<synapse> for the client because the
client is a windows program and I have no way to control it. 

 

 

Thank you for reading this lengthy mail.

 

-Renjith

 

 

-----Original Message-----
From: Ruwan Linton [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 23, 2007 9:09 AM
To: [email protected]
Subject: Re: "Regarding Namespace Problem with an application"

 

Hi Renjith,

 

If your client is having a NS other than the NS of the actual service, then

you have to do a XSLT transformation as Paul described;

 

Here is the configuration for that;

 

<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="$ACTUAL_SERVICE_EPR"/>

            </endpoint>

            <outSequence>

                <send/>

            </outSequence>

        </target>

        <publishWSDL uri="file:repository/$WSDL_FILE_NAME"/>

    </proxy>

</definitions>

 

 

In the XSLT you have to transform the NS from one to another. If you

need any more guidance in writing the XSLT please let me know.

 

Thanks,

Ruwan.

 

 

 

On 6/21/07, Renjith <[EMAIL PROTECTED]> wrote:

> 

> Hi Paul,

> 

> Thanks for the reply.

> 

>         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 stop

> working and throws unexpected subelement strUserName. And all other client

> program starts running.

> 

>       So what I am trying to do is make all client works with code

> developed

> from same wsdl and having the namespace "http://sync.dtc.com/";.

> 

>   Could you please guide me, and correct me if I am wrong in my thoughts.

> 

> Thanks in Advance,

> Renjith

> 

> 

> 

> -----Original Message-----

> From: Paul Fremantle [mailto:[EMAIL PROTECTED]

> Sent: Thursday, June 21, 2007 4:50 AM

> To: [email protected]

> Subject: Re: "Regarding Namespace Problem with an application"

> 

> > OK.. if I am understanding your problem

> > correctly, this could be simplified to the requirement that you want to

> > expose your existing service under different WSDLs (using different

> > namespaces) to different clients? If so, this is trivial in Synapse. You

> > just create one or more proxy services with a publish WSDL specified to

> that

> > which the client expects, and then forward the messages to the actual

> > endpoint.

> 

> It seems like you might also need to write a mediator to change the

> namespace inside the SOAP messages in one case? In other words,

> presumably the namespace in the SOAP message matches in one case and

> doesn't in the other case.

> 

> You can do this lots of ways, but the easy way would either be in XSLT

> or in JavaScript/E4X. If you can post an example of both types of SOAP

> message then I can show a transform that fixes up one.

> 

> Unless I've completely misunderstood the problem in which case forgive me.

> 

> Paul

> 

> --

> Paul Fremantle

> Co-Founder and VP of Technical Sales, WSO2

> OASIS WS-RX TC Co-chair

> 

> blog: http://pzf.fremantle.org

> [EMAIL PROTECTED]

> 

> "Oxygenating the Web Service Platform", www.wso2.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]

> 

 

 

 

-- 

Ruwan Linton

http://www.wso2.org - "Oxygenating the Web Services Platform"

Reply via email to