Thank you Hiranya.

As I delineated before, I have a client which can be used to invoke my
service remotely.
With my client I can use one of these three stubs obtaining the same correct
result:

// It refers to the service deployed in Axis2 in TomCat
 stub = new SumCalculatorStub("*
http://localhost:8080/axis2/services/SumCalculator*";);

// It refers to the service deployed in Axis2 within Synapse
 stub = new SumCalculatorStub("*http://localhost:9000/soap/SumCalculator*";);

// It refers to the service visible through transport URL of Synapse
 stub = new SumCalculatorStub("*http://localhost:8280/soap/SumCalculator*";);

Now:

*1)* how can I try some modifications to it, so that instead of directly
invoking the
Axis2 service, it sends the request to Synapse?
Is there a relation with the transport URL of Synapse http://localhost:8280?

*2)* if I resolve the question 1) what will I see in the Synapse prompt?
The SOAP request-response, or a simple notification of the flow?

*3)* running the sample 150 I saw a reference at some WSDL files in
%SYNAPSE_HOME%\repository\conf\sample\resources\proxy.
What are this files? How can I generate them?


Thank you.

Pasquale


Some files:
*
[C:\Programmi\Apache Software
Foundation\synapse-1.2\repository\conf\synapse.xml]*

<!--
  ~  Licensed to the Apache Software Foundation (ASF) under one
  ~  or more contributor license agreements.  See the NOTICE file
  ~  distributed with this work for additional information
  ~  regarding copyright ownership.  The ASF licenses this file
  ~  to you under the Apache License, Version 2.0 (the
  ~  "License"); you may not use this file except in compliance
  ~  with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~  Unless required by applicable law or agreed to in writing,
  ~  software distributed under the License is distributed on an
  ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~  KIND, either express or implied.  See the License for the
  ~  specific language governing permissions and limitations
  ~  under the License.
  -->
<!-- A simple Synapse configuration -->
<definitions xmlns="http://ws.apache.org/ns/synapse";>

    <in>
        <!-- Log all messages passing through -->
        <log level="full"/>

        <!-- ensure that the default configuration only sends if it is one
of samples -->
        <!-- Otherwise Synapse would be an open proxy by default
(BAD!)               -->
        <filter source="get-property('To')" regex="http://localhost:9000.*";>
            <!-- Send the messages where they have been sent (i.e. implicit
"To" EPR) -->
            <send/>
        </filter>
    </in>
    <out>
        <send/>
    </out>
</definitions>


*[The SumCalculator web service]*

public class SumCalculator
{
     public double getSum(double num1, double num2)
     {
         return num1 + num2;
     }
}


*[The client SumCalculatorServiceClient in my Eclipse workspace]*

package ws.example;

public class SumCalculatorServiceClient
{
    public static void main(String[] args)
    {
        SumCalculatorStub stub;

        try
        {
            //stub = new SumCalculatorStub("
http://localhost:8080/axis2/services/SumCalculator";);
            stub = new SumCalculatorStub("
http://localhost:9000/soap/SumCalculator";);
            //stub = new SumCalculatorStub("
http://localhost:8280/soap/SumCalculator";);
            double num1_value = 32;
            double num2_value = -19;

            SumCalculatorStub.GetSum somma = new SumCalculatorStub.GetSum();
            somma.setNum1(num1_value);
            somma.setNum2(num2_value);

            SumCalculatorStub.GetSumResponse res = stub.getSum(somma);
            System.out.println("num1 + num2 = " + num1_value + " + " +
num2_value + " = " + res.get_return());

        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}





2009/1/9 Hiranya Jayathilaka <[email protected]>

> Hi Pasquale,
>
> Please see my comments in-line.
>
> On Fri, Jan 9, 2009 at 6:38 AM, Pasquale Campitiello <
> [email protected]> wrote:
>
> > Thank you very much for your links.
> >
> > I followed the detailed tutorial http://wso2.org/library/1719, I created
> > the
> > a simple web service to sum two numbers.
>
>
> > I generated, with the Axis2 Server Archiver plugin for Eclipse, the file
> *
> > SumCalculator.aar*, I put it in the directory
> > %SYNAPSE_HOME%\samples\axis2Server\repository\services  in order to have
> it
> > available to the internal Synapse Axis2.
> > In fact running  %SYNAPSE_HOME%\samples\*axis2Serveraxis2server.bat*  I
> get
> > the service at
> >
> > http://localhost:9000/soap/SumCalculator
> >
> > so when I wrote the SumCalculatorServiceClient I create the stub in this
> > way:
> >
> > *stub = new SumCalculatorStub("http://localhost:9000/soap/SumCalculator
> > ");*
> >
> > [ and NOT referring to TomCat       stub = new SumCalculatorStub("
> > http://localhost:8080/axis2/services/SumCalculator";); ].
> >
> > I can run the client normally (within Eclipse or in a console with a JAR
> of
> > the entire project including the client):
> > it establishes the connection with the service endpoint and then it
> returns
> > the correct result.
> >
> > Now my questions are:
> >
> > *1)* when I run my project it is necessary that axis2server.bat is
> running,
> > but Synapse can be down. How can I see
> > the request-response flow through Synapse?
> > (like SimpleStockQuoteService showed in
> > http://synapse.apache.org/Synapse_QuickStart.html)
>
>
> Please note that Synapse is simply an ESB and not a Web services engine. It
> does not 'host' your Web service. Axis2 is the Web services engine which
> hosts your service. Synapse only routes the requests it receive to the
> correct service endpoint as defined in the Synapse configuration. So in
> order to invoke your Web service remotely it is necessary and sufficient to
> have only Axis2 server running.
>
> Also we would like to have a look at the Synapse configuration
> (synapse.xml)
> you are using to start Synapse. That will enable us better help you.
>
> >
> >
> > *2)* I controlled the structure of SimpleStockQuoteService: the project
> of
> > the service is in %SYNAPSE_HOME%\samples\axis2Server\src,
> > the client of this service is the complete directory
> > %SYNAPSE_HOME%\samples\axis2Client?
> > How can I generate a client like this for my simple service?
> > (in order to run my service like a normale service in one ESB like
> > SimpleStockQuote)
>
>
> As I mentioned before services do not run in the ESB. They run at  your
> Axis2 server. ESB simply routes the traffic back and forth. If you already
> have a client which can be used to invoke your service remotely you can try
> doing some modifications to it so that instead of directly invoking the
> Axis2 service it sends the request to Synapse.
>
>
> >
> > *3)* I considered also the link by asankha
> >
> >
> http://adroitlogic.org/knowledge-base-axis2/10-soap-over-jms-with-apache-axis2.html
> > .
> > I generated a correct client from my WSDL, but I don't understand how to
> > execute this client whit Ant and the command "[java]".
> > How can I use Ant to build and execute the my SumCalculatorServiceClient?
> > (like the sample TestClient showed in the link)
>
>
> Well for this you'll have to read Apache Ant documentation and learn how to
> write  Ant build scripts.  Ant is a neat little tool which can be used to
> automate building projects and running applications. You can get some idea
> about how we use Ant to run sample clients by having a look at the
> build.xml
> file in the axis2Client directory.
>
> Thanks
>
> Best Regards,
> Hiranya
>
>
> >
> >
> > Thanks
> >
> > *Pasquale*
> >
> >
> >
> > 2009/1/3 Hiranya Jayathilaka <[email protected]>
> >
> > > Hi Pasquale,
> > > FYI, you can learn more about developing Axis2 Web Services with
> Eclipse
> > > from [1] and [2]. As Asanka has pointed out you cannot just develop a
> > > service using the Eclipse WS framework and deploy it into Axis2. You
> need
> > > to
> > > use the correct set of plug-ins and libraries when developing the
> > service.
> > > You can learn all about it by going though [1] and [2].
> > >
> > > Hope this helps. Have a great 2009!
> > >
> > > Thanks
> > >
> > > Best Regards,
> > > Hiranya
> > >
> > > [1] -
> > >
> > >
> >
> http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html
> > > [2] - http://wso2.org/library/1719
> > >
> > >
> > >
> > > On Fri, Jan 2, 2009 at 11:48 PM, Asankha C. Perera <[email protected]
> > > >wrote:
> > >
> > > > Hi Pasquale
> > > >
> > > >> I created within Eclipse a fast and simple web service, it sums two
> > > >> numbers.
> > > >> I followed and adapted this instructions:
> > > >>
> > > >>
> > > >>
> > >
> >
> http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/BottomUpWebService/BottomUpWebService.html
> > > >> [
> > > >>
> > >
> >
> http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/index.html
> > > >> ].
> > > >>
> > > >> I deployed that web service using TomCat 5.5 within Eclipse. Now I
> > have
> > > >> the
> > > >> client with JSP files at http://localhost:8080/SumWSClient.
> > > >>
> > > >>
> > > > I am not familiar with Eclipse web services/tools.. however, if this
> is
> > a
> > > > standard web service it might have a WSDL. You could use Apache Axis2
> > to
> > > > generate a client for your service using this WSDL. See standard
> Axis2
> > > > client documentation or the 'Generating a sample client' in [1] to
> see
> > > how
> > > > you could do this
> > > >
> > > >> SimpleStockQuoteService is a web service called by a client
> > > >> in the way I see in Synapse QuickStart
> > > >> http://synapse.apache.org/Synapse_QuickStart.html [?]
> > > >>
> > > >> In the same way, how can I call and use my simple web service with
> Ant
> > > and
> > > >> Synapse?
> > > >> I tried to copy my project in <synapse_home>\samples\axis2Server\src
> > and
> > > >> modify configuration files, but I got nothing.
> > > >>
> > > >> Can you give me some explanation?
> > > >>
> > > >>
> > > > I do not think Eclipse WS stuff is based on Apache Axis2.. so that
> > > probably
> > > > explains why you see nothing.. the SimpleStockQuoteService and the
> > client
> > > > are pure Apache Axis2 sample service/client used to show the
> operation
> > of
> > > > Synapse with web services
> > > >
> > > > cheers
> > > > asankha
> > > >
> > > > [1]
> > > >
> > >
> >
> http://adroitlogic.org/knowledge-base-axis2/10-soap-over-jms-with-apache-axis2.html
> > > >
> > > > --
> > > > Asankha C. Perera
> > > > http://adroitlogic.org
> > > >
> > > > http://esbmagic.blogspot.com
> > > >
> > > >
> > >
> >
>

Reply via email to