You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Andreas Bobek <an...@uni-rostock.de> on 2006/01/13 00:58:27 UTC

[Axis2-0.94] application scope for ServiceClass missing

Hi,

in Axis2 0.93 follow configuration in a services.xml was possible:

<parameter name="ServiceClass" locked="false">com.MyService</parameter>
<parameter name="scope">application</parameter>

The AbstractMessageReceiver class in Axis2 0.94 takes no care about the 
scope parameter anymore.
How can I force Axis to create only one instance of my service 
implementation class for the whole runtime?

Thanks and good night,
Andreas Bobek.
---------------------
http://www.andreas-bobek.de
http://www-md.e-technik.uni-rostock.de/~ab113/index.html

AW: [Axis2-0.94] application scope for ServiceClass missing

Posted by Andreas Bobek <an...@uni-rostock.de>.
Done,

Andreas.

> -----Ursprüngliche Nachricht-----
> Von: Davanum Srinivas [mailto:davanum@gmail.com] 
> Gesendet: Freitag, 13. Januar 2006 03:17
> An: axis-user@ws.apache.org
> Betreff: Re: [Axis2-0.94] application scope for ServiceClass missing
> 
> could u please log a bug in jira? http://issues.apache.org/jira/
> 
> thanks,
> dims
> 
> On 1/12/06, Andreas Bobek <an...@uni-rostock.de> wrote:
> > Hi,
> >
> > in Axis2 0.93 follow configuration in a services.xml was possible:
> >
> > <parameter name="ServiceClass" 
> > locked="false">com.MyService</parameter>
> > <parameter name="scope">application</parameter>
> >
> > The AbstractMessageReceiver class in Axis2 0.94 takes no care about 
> > the scope parameter anymore.
> > How can I force Axis to create only one instance of my service 
> > implementation class for the whole runtime?
> >
> > Thanks and good night,
> > Andreas Bobek.
> > ---------------------
> > http://www.andreas-bobek.de
> > http://www-md.e-technik.uni-rostock.de/~ab113/index.html
> >
> 
> 
> --
> Davanum Srinivas : http://wso2.com/blogs/


Re: [Axis2-0.94] application scope for ServiceClass missing

Posted by Davanum Srinivas <da...@gmail.com>.
could u please log a bug in jira? http://issues.apache.org/jira/

thanks,
dims

On 1/12/06, Andreas Bobek <an...@uni-rostock.de> wrote:
> Hi,
>
> in Axis2 0.93 follow configuration in a services.xml was possible:
>
> <parameter name="ServiceClass" locked="false">com.MyService</parameter>
> <parameter name="scope">application</parameter>
>
> The AbstractMessageReceiver class in Axis2 0.94 takes no care about the
> scope parameter anymore.
> How can I force Axis to create only one instance of my service
> implementation class for the whole runtime?
>
> Thanks and good night,
> Andreas Bobek.
> ---------------------
> http://www.andreas-bobek.de
> http://www-md.e-technik.uni-rostock.de/~ab113/index.html
>


--
Davanum Srinivas : http://wso2.com/blogs/

AW: [Axis2-0.94] application scope for ServiceClass missing

Posted by Andreas Bobek <an...@uni-rostock.de>.
Thank you Deepal,
this is a compensation for me :-)

Andreas.
 

> -----Ursprüngliche Nachricht-----
> Von: Deepal Jayasinghe [mailto:deepal@opensource.lk] 
> Gesendet: Dienstag, 17. Januar 2006 18:04
> An: axis-user@ws.apache.org
> Betreff: Re: [Axis2-0.94] application scope for ServiceClass missing
> 
> Hi Andreas;
> 
> In 0.94 release we improved our session and scope management 
> as we think right . And there service author can deploy his 
> service in four different scope
>   1. Request Scope
>   2. Transport Scope
>   3. SOAP Session Scope
>   4. Application scope
> 
> and user can configure the scope by adding scope attribute in 
> his service element as follows
>   <service name="foo" scope="application">
> 
> then the service instance will be created and stored in the 
> ServiceContext. 
> And the important thing is that the serviceContext will be 
> stored in different location depending on scope
>   1. if it is request scope it wont store
>   2. if it is Transport scope then it stores in SessionContext
>   3. If it is SOAP Session scope that it will store in 
> configuration context and will be time-out after some times 
> if the services does not touch  4. If the scope is 
> application then the servicecontext will store in 
> configuration context and it will there forever (until server 
> shutdown)
> 
> 
> Thanks,
>  Deepal
> ...............................................................
> ~Future is Open~
> 
> ----- Original Message -----
> From: "Andreas Bobek" <an...@uni-rostock.de>
> To: <ax...@ws.apache.org>
> Sent: Friday, January 13, 2006 5:58 AM
> Subject: [Axis2-0.94] application scope for ServiceClass missing
> 
> 
> > Hi,
> >
> > in Axis2 0.93 follow configuration in a services.xml was possible:
> >
> > <parameter name="ServiceClass" 
> locked="false">com.MyService</parameter>
> > <parameter name="scope">application</parameter>
> >
> > The AbstractMessageReceiver class in Axis2 0.94 takes no 
> care about the
> > scope parameter anymore.
> > How can I force Axis to create only one instance of my service
> > implementation class for the whole runtime?
> >
> > Thanks and good night,
> > Andreas Bobek.
> > ---------------------
> > http://www.andreas-bobek.de
> > http://www-md.e-technik.uni-rostock.de/~ab113/index.html
> > 
> 
> 


Re: [Axis2-0.94] application scope for ServiceClass missing

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Andreas;

In 0.94 release we improved our session and scope management as we think 
right . And there service author can deploy his service in four different 
scope
  1. Request Scope
  2. Transport Scope
  3. SOAP Session Scope
  4. Application scope

and user can configure the scope by adding scope attribute in his service 
element as follows
  <service name="foo" scope="application">

then the service instance will be created and stored in the ServiceContext. 
And the important thing is that the serviceContext will be stored in 
different location depending on scope
  1. if it is request scope it wont store
  2. if it is Transport scope then it stores in SessionContext
  3. If it is SOAP Session scope that it will store in configuration context 
and will be time-out after some times if the services does not touch
 4. If the scope is application then the servicecontext will store in 
configuration context and it will there forever (until server shutdown)


Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: "Andreas Bobek" <an...@uni-rostock.de>
To: <ax...@ws.apache.org>
Sent: Friday, January 13, 2006 5:58 AM
Subject: [Axis2-0.94] application scope for ServiceClass missing


> Hi,
>
> in Axis2 0.93 follow configuration in a services.xml was possible:
>
> <parameter name="ServiceClass" locked="false">com.MyService</parameter>
> <parameter name="scope">application</parameter>
>
> The AbstractMessageReceiver class in Axis2 0.94 takes no care about the
> scope parameter anymore.
> How can I force Axis to create only one instance of my service
> implementation class for the whole runtime?
>
> Thanks and good night,
> Andreas Bobek.
> ---------------------
> http://www.andreas-bobek.de
> http://www-md.e-technik.uni-rostock.de/~ab113/index.html
> 



RE: Question about importing XSD files

Posted by "Shelli D. Orton" <sh...@wmode.com>.
Thanks Dies and Anne.  Things are much clearer now, and I think I can move
forward now.

Shelli
  -----Original Message-----
  From: Anne Thomas Manes [mailto:atmanes@gmail.com]
  Sent: Friday, January 13, 2006 7:47 AM
  To: axis-user@ws.apache.org
  Subject: Re: Question about importing XSD files


  Dies is correct. The first example is invalid. You should follow the
second example.

  In answer to your specific questions:


  In the first example, the xsd file is being imported in the definition
  section, and I'm assuming is available throughout the rest of the wsdl
after
  that.  In the second, the xsd is being imported in a schema within the
types
  section and is therefore only available in that schema.  Is this correct?


  This example is incorrect because it uses <wsdl:import> to import an xsd
file. You must use <xsd:import> to import a schema. As long as the xsd file
is imported into a schema in the types section, you can reference the schema
entities (elements, attributes, and types) throughout the WSDL.


  I don't understand the significance/difference between the first example
  using "location" and the second using "schemaLocation".  I also don't
  understand how to reference the file's location.  Does it have to be made
  available on the internet as example 1 suggests, or is the xsd files
  co-located with wsdl good enough?

  <wsdl:import> and <xsd:import> are different elements. The location
attribute in <wsdl:import> is "location". The location attribute in
<xsd:import> is "schemaLocation". The URI specified in either location
attribute can be an absolute or relative URL.

  Anne



  On 1/12/06, Dies Koper <di...@jp.fujitsu.com> wrote:
    Hello Shelli,

    The first example looks like the ones in the WSDL1.1 spec.
    However, according to the WS-I spec it is wrong.
    It says that you should not use wsdl:import to import xsd files. Use
    wsdl:import to import wsdl files, xsd:import to import xsd files.
    The second example seems to correct this.

    I think both would work fine with Axis. To prevent problems in the
    future, I'd go with the second example.

    The file location is a URI. A URL is fine, but a relative path to the
    file is fine too.

    Regards,
    Dies


    Shelli D. Orton wrote:
    > Hi All,
    >
    > My practical problem is this: I have been given a wsdl file and 2 xsd
files
    > to generate a client app against.  The wsdl does not import the xsd
files,
    > so I'm trying to fix it so that it does and I can run wsdl2java
against it.
    > So, I am trying to understand how to import schema files (.xsd) into a
wsdl
    > document.  I have found two examples on how to do this (actually more,
but
    > these were fairly clean examples).
    >
    > The example from the w3 (http://www.w3.org/TR/wsdl) site is:
    >
    > <?xml version="1.0"?>
    > <definitions name="StockQuote"
    >
    > targetNamespace="http://example.com/stockquote/definitions"
    >           xmlns:tns=" http://example.com/stockquote/definitions"
    >           xmlns:xsd1="http://example.com/stockquote/schemas"
    >           xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/"
    >           xmlns="http://schemas.xmlsoap.org/wsdl/">
    >
    >    <import namespace=" http://example.com/stockquote/schemas"
    >            location="http://example.com/stockquote/stockquote.xsd"/>
    >
    >     <message name="GetLastTradePriceInput">
    >         <part name="body" element="xsd1:TradePriceRequest"/>
    >     </message>
    >
    >     <message name="GetLastTradePriceOutput">
    >         <part name="body" element="xsd1:TradePrice"/>
    >     </message>
    >
    >     <portType name="StockQuotePortType">
    >         <operation name="GetLastTradePrice">
    >            <input message="tns:GetLastTradePriceInput"/>
    >            <output message="tns:GetLastTradePriceOutput"/>
    >         </operation>
    >     </portType>
    > </definitions>
    >
    > Another example I found is (from
    >
http://www-128.ibm.com/developerworks/xml/library/ws-tip-imports.html):
    >
    > <wsdl:types>
    >     <xsd:schema targetNamespace="urn:listing2"
    >                 xmlns:listing3="urn:listing3"
    >                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    >
    >       <xsd:import namespace="urn:listing3"
schemaLocation="listing3.xsd"/>
    >
    >       <xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
    >       <xsd:complexType name="Address">
    >         <xsd:sequence>
    >           <xsd:element name="streetNum" type="xsd:int"/>
    >           <xsd:element name="streetName" type="xsd:string"/>
    >           <xsd:element name="city" type="xsd:string"/>
    >           <xsd:element name="state" type="xsd:string"/>
    >           <xsd:element name="phone" type="listing3:Phone"/>
    >         </xsd:sequence>
    >       </xsd:complexType>
    >     </xsd:schema>
    >   </wsdl:types>
    >
    > In the first example, the xsd file is being imported in the definition
    > section, and I'm assuming is available throughout the rest of the wsdl
after
    > that.  In the second, the xsd is being imported in a schema within the
types
    > section and is therefore only available in that schema.  Is this
correct?
    >
    > I don't understand the significance/difference between the first
example
    > using "location" and the second using "schemaLocation".  I also don't
    > understand how to reference the file's location.  Does it have to be
made
    > available on the internet as example 1 suggests, or is the xsd files
    > co-located with wsdl good enough?
    >
    > Any help is greatly appreciated.
    >
    > Shelli
    >
    >




Re: Question about importing XSD files

Posted by Anne Thomas Manes <at...@gmail.com>.
Dies is correct. The first example is invalid. You should follow the second
example.

In answer to your specific questions:

In the first example, the xsd file is being imported in the definition
section, and I'm assuming is available throughout the rest of the wsdl after
that.  In the second, the xsd is being imported in a schema within the types
section and is therefore only available in that schema.  Is this correct?

 This example is incorrect because it uses <wsdl:import> to import an xsd
file. You must use <xsd:import> to import a schema. As long as the xsd file
is imported into a schema in the types section, you can reference the schema
entities (elements, attributes, and types) throughout the WSDL.

I don't understand the significance/difference between the first example
using "location" and the second using "schemaLocation".  I also don't
understand how to reference the file's location.  Does it have to be made
available on the internet as example 1 suggests, or is the xsd files
co-located with wsdl good enough?

<wsdl:import> and <xsd:import> are different elements. The location
attribute in <wsdl:import> is "location". The location attribute in
<xsd:import> is "schemaLocation". The URI specified in either location
attribute can be an absolute or relative URL.

Anne


On 1/12/06, Dies Koper <di...@jp.fujitsu.com> wrote:
>
> Hello Shelli,
>
> The first example looks like the ones in the WSDL1.1 spec.
> However, according to the WS-I spec it is wrong.
> It says that you should not use wsdl:import to import xsd files. Use
> wsdl:import to import wsdl files, xsd:import to import xsd files.
> The second example seems to correct this.
>
> I think both would work fine with Axis. To prevent problems in the
> future, I'd go with the second example.
>
> The file location is a URI. A URL is fine, but a relative path to the
> file is fine too.
>
> Regards,
> Dies
>
>
> Shelli D. Orton wrote:
> > Hi All,
> >
> > My practical problem is this: I have been given a wsdl file and 2 xsd
> files
> > to generate a client app against.  The wsdl does not import the xsd
> files,
> > so I'm trying to fix it so that it does and I can run wsdl2java against
> it.
> > So, I am trying to understand how to import schema files (.xsd) into a
> wsdl
> > document.  I have found two examples on how to do this (actually more,
> but
> > these were fairly clean examples).
> >
> > The example from the w3 (http://www.w3.org/TR/wsdl) site is:
> >
> > <?xml version="1.0"?>
> > <definitions name="StockQuote"
> >
> > targetNamespace="http://example.com/stockquote/definitions"
> >           xmlns:tns="http://example.com/stockquote/definitions"
> >           xmlns:xsd1="http://example.com/stockquote/schemas"
> >           xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >           xmlns="http://schemas.xmlsoap.org/wsdl/">
> >
> >    <import namespace="http://example.com/stockquote/schemas"
> >            location="http://example.com/stockquote/stockquote.xsd"/>
> >
> >     <message name="GetLastTradePriceInput">
> >         <part name="body" element="xsd1:TradePriceRequest"/>
> >     </message>
> >
> >     <message name="GetLastTradePriceOutput">
> >         <part name="body" element="xsd1:TradePrice"/>
> >     </message>
> >
> >     <portType name="StockQuotePortType">
> >         <operation name="GetLastTradePrice">
> >            <input message="tns:GetLastTradePriceInput"/>
> >            <output message="tns:GetLastTradePriceOutput"/>
> >         </operation>
> >     </portType>
> > </definitions>
> >
> > Another example I found is (from
> > http://www-128.ibm.com/developerworks/xml/library/ws-tip-imports.html):
> >
> > <wsdl:types>
> >     <xsd:schema targetNamespace="urn:listing2"
> >                 xmlns:listing3="urn:listing3"
> >                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> >       <xsd:import namespace="urn:listing3" schemaLocation="listing3.xsd
> "/>
> >
> >       <xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
> >       <xsd:complexType name="Address">
> >         <xsd:sequence>
> >           <xsd:element name="streetNum" type="xsd:int"/>
> >           <xsd:element name="streetName" type="xsd:string"/>
> >           <xsd:element name="city" type="xsd:string"/>
> >           <xsd:element name="state" type="xsd:string"/>
> >           <xsd:element name="phone" type="listing3:Phone"/>
> >         </xsd:sequence>
> >       </xsd:complexType>
> >     </xsd:schema>
> >   </wsdl:types>
> >
> > In the first example, the xsd file is being imported in the definition
> > section, and I'm assuming is available throughout the rest of the wsdl
> after
> > that.  In the second, the xsd is being imported in a schema within the
> types
> > section and is therefore only available in that schema.  Is this
> correct?
> >
> > I don't understand the significance/difference between the first example
> > using "location" and the second using "schemaLocation".  I also don't
> > understand how to reference the file's location.  Does it have to be
> made
> > available on the internet as example 1 suggests, or is the xsd files
> > co-located with wsdl good enough?
> >
> > Any help is greatly appreciated.
> >
> > Shelli
> >
> >
>
>

Re: Question about importing XSD files

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hello Shelli,

The first example looks like the ones in the WSDL1.1 spec.
However, according to the WS-I spec it is wrong.
It says that you should not use wsdl:import to import xsd files. Use 
wsdl:import to import wsdl files, xsd:import to import xsd files.
The second example seems to correct this.

I think both would work fine with Axis. To prevent problems in the 
future, I'd go with the second example.

The file location is a URI. A URL is fine, but a relative path to the 
file is fine too.

Regards,
Dies


Shelli D. Orton wrote:
> Hi All,
> 
> My practical problem is this: I have been given a wsdl file and 2 xsd files
> to generate a client app against.  The wsdl does not import the xsd files,
> so I'm trying to fix it so that it does and I can run wsdl2java against it.
> So, I am trying to understand how to import schema files (.xsd) into a wsdl
> document.  I have found two examples on how to do this (actually more, but
> these were fairly clean examples).  
> 
> The example from the w3 (http://www.w3.org/TR/wsdl) site is:
> 
> <?xml version="1.0"?>
> <definitions name="StockQuote"
> 
> targetNamespace="http://example.com/stockquote/definitions"
>           xmlns:tns="http://example.com/stockquote/definitions"
>           xmlns:xsd1="http://example.com/stockquote/schemas"
>           xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>           xmlns="http://schemas.xmlsoap.org/wsdl/">
> 
>    <import namespace="http://example.com/stockquote/schemas"
>            location="http://example.com/stockquote/stockquote.xsd"/>
> 
>     <message name="GetLastTradePriceInput">
>         <part name="body" element="xsd1:TradePriceRequest"/>
>     </message>
> 
>     <message name="GetLastTradePriceOutput">
>         <part name="body" element="xsd1:TradePrice"/>
>     </message>
> 
>     <portType name="StockQuotePortType">
>         <operation name="GetLastTradePrice">
>            <input message="tns:GetLastTradePriceInput"/>
>            <output message="tns:GetLastTradePriceOutput"/>
>         </operation>
>     </portType>
> </definitions>
> 
> Another example I found is (from
> http://www-128.ibm.com/developerworks/xml/library/ws-tip-imports.html):
> 
> <wsdl:types>
>     <xsd:schema targetNamespace="urn:listing2"
>                 xmlns:listing3="urn:listing3"
>                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 
>       <xsd:import namespace="urn:listing3" schemaLocation="listing3.xsd"/>
> 
>       <xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
>       <xsd:complexType name="Address">
>         <xsd:sequence>
>           <xsd:element name="streetNum" type="xsd:int"/>
>           <xsd:element name="streetName" type="xsd:string"/>
>           <xsd:element name="city" type="xsd:string"/>
>           <xsd:element name="state" type="xsd:string"/>
>           <xsd:element name="phone" type="listing3:Phone"/>
>         </xsd:sequence>
>       </xsd:complexType>
>     </xsd:schema>
>   </wsdl:types>
> 
> In the first example, the xsd file is being imported in the definition
> section, and I'm assuming is available throughout the rest of the wsdl after
> that.  In the second, the xsd is being imported in a schema within the types
> section and is therefore only available in that schema.  Is this correct?
> 
> I don't understand the significance/difference between the first example
> using "location" and the second using "schemaLocation".  I also don't
> understand how to reference the file's location.  Does it have to be made
> available on the internet as example 1 suggests, or is the xsd files
> co-located with wsdl good enough?
> 
> Any help is greatly appreciated.
> 
> Shelli
> 
> 


Question about importing XSD files

Posted by "Shelli D. Orton" <sh...@wmode.com>.
Hi All,

My practical problem is this: I have been given a wsdl file and 2 xsd files
to generate a client app against.  The wsdl does not import the xsd files,
so I'm trying to fix it so that it does and I can run wsdl2java against it.
So, I am trying to understand how to import schema files (.xsd) into a wsdl
document.  I have found two examples on how to do this (actually more, but
these were fairly clean examples).  

The example from the w3 (http://www.w3.org/TR/wsdl) site is:

<?xml version="1.0"?>
<definitions name="StockQuote"

targetNamespace="http://example.com/stockquote/definitions"
          xmlns:tns="http://example.com/stockquote/definitions"
          xmlns:xsd1="http://example.com/stockquote/schemas"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns="http://schemas.xmlsoap.org/wsdl/">

   <import namespace="http://example.com/stockquote/schemas"
           location="http://example.com/stockquote/stockquote.xsd"/>

    <message name="GetLastTradePriceInput">
        <part name="body" element="xsd1:TradePriceRequest"/>
    </message>

    <message name="GetLastTradePriceOutput">
        <part name="body" element="xsd1:TradePrice"/>
    </message>

    <portType name="StockQuotePortType">
        <operation name="GetLastTradePrice">
           <input message="tns:GetLastTradePriceInput"/>
           <output message="tns:GetLastTradePriceOutput"/>
        </operation>
    </portType>
</definitions>

Another example I found is (from
http://www-128.ibm.com/developerworks/xml/library/ws-tip-imports.html):

<wsdl:types>
    <xsd:schema targetNamespace="urn:listing2"
                xmlns:listing3="urn:listing3"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      <xsd:import namespace="urn:listing3" schemaLocation="listing3.xsd"/>

      <xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
      <xsd:complexType name="Address">
        <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          <xsd:element name="phone" type="listing3:Phone"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>
  </wsdl:types>

In the first example, the xsd file is being imported in the definition
section, and I'm assuming is available throughout the rest of the wsdl after
that.  In the second, the xsd is being imported in a schema within the types
section and is therefore only available in that schema.  Is this correct?

I don't understand the significance/difference between the first example
using "location" and the second using "schemaLocation".  I also don't
understand how to reference the file's location.  Does it have to be made
available on the internet as example 1 suggests, or is the xsd files
co-located with wsdl good enough?

Any help is greatly appreciated.

Shelli