You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-user@ws.apache.org by Jan Christian Bryne <ch...@ii.uib.no> on 2006/02/27 11:35:53 UTC

[Fwd: Re: Confusion regarding EndpointReferenceType and EndpointReference]

Hi Asif,

Yes, that's right. I have another implementation of WS Addressing. 
It's not included in the WSRF 1.1 download. If I knew in advance I'd let
you know..

Regarding your other issue of finding the Home class:
I'm also implementing the Factory design pattern, using one factory
service called NCBIBlastFactory and one instance service called
NCBIBlastInstance. 
To reach the home of the instance service from the factory service, I
use the following:

NCBIBlastInstanceHome blastHome = (NCBIBlastInstanceHome)
WsrfRuntime.getRuntime().getResourceHome("NCBI_BlastInstance"); 

To do that it is necessary to import org.apache.ws.resource.WsrfRuntime;
I'm not sure which way is best, this way or using JNDI.

I have one other issue with the factory design pattern. It's not really
necessary for the factory to require a Addressing header, since it
doesn't make use of the resource identifier. It just forwards it to the
client.

Is it possible to generate code with
org.apache.ws.resource.tool.Wsdl2Java for a service that doesn't require
the Addressing header? And if not: Is there any way to tweak the code to
make it so post generation?


- Christian 


On Sun, 2006-02-26 at 13:17 +0000, Java Helpline wrote:
> Hi Christian,
>     Thank you very much for your reply. It is also working for me with
> one small problem. I can't find the Constants class which should be in
> the package org.apache.axis.message.addressing. But from internet I
> saw the value of 
>  
> public static final String NS_URI_ADDRESSING_08 =
> public static final String NS_URI_ADDRESSING_2004_08 =
>            http://schemas.xmlsoap.org/ws/2004/08/addressing;
>  
> so have hard coded the String Value. One question do you have
> downloaded WS Addressing reference implementation seperately from
> Apollo, or it is part of Apollo Library. It seems to me that it is not
> included with Apollo WSRF implementation. 
>  
> Once again thank you for your help.
> It seems you are also using Factory Design Patt! ern for WSRF, have
> you tried to search for home of any WSRF Service through JNDI lookup
> (). I have done that for Globus WS Core and earlier versions of Apollo
> WSRF but is not working for current implementation. 
>  
> Regards 
> Asif
> 
> Jan Christian Bryne <ch...@ii.uib.no> wrote:
>         Hi,
>         
>         This seems to work for me:
>         
>         org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType epr =
>         ((XmlBeansEndpointReference) getEndpointReference
>         ()).getXmlObject
>         (Constants.NS_URI_ADDRESSING_08));
>         
>         The code is from my Resource class, and the
>         getEndpointReference()
>         method is defined in the AbstractResource class.
>         
>         - Christian
>         
>         
>         On Sat, 2006-02-25 at 13:36 +0000, Java Helpline wrote:
>         > Hi,
>         > When last year I started working with WSRF Apache
>         implementation
>         > there was nice examp! le of Printer which implements Factory
>         Pattern,
>         > but then they removed that example with UnixFileSystem.
>         UnixFileSystem
>         > is not even demonstrating all the functionalities what you
>         can expect
>         > from WSRF.
>         > 
>         > I am trying to implement Factory Design Pattern, where there
>         is create
>         > method which returns EndpointReferenceType after creating
>         the
>         > resource. Problem is when I create Resource I can get its
>         > EndpointReference and have no clue how EndpointReference can
>         be
>         > converted into EndpointReferenceType. In Globus
>         implementation they
>         > have 
>         > AddressingUtils.createEndpointReference(ResourceContext,
>         ResourceKey)
>         > to create EndpointReferenceType. 
>         > 
>         > Can anyone tell me any easy way to convert EndpointReference
>         into
>         > EndpointReferenceType.
>         > 
>         > Thankyou.
>         > Asif
>         > 
>         > 
>         >
>         ______________________________________________________________________
>         > 
>         &! gt; Yahoo! Photos – NEW, now offering a quality print
>         service from just 8p
>         > a photo.
>         -- 
>         Jan Christian Bryne 
>         
>         
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: wsrf-user-unsubscribe@ws.apache.org
>         For additional commands, e-mail: wsrf-user-help@ws.apache.org
>         
> 
> 
> 
> 
> ______________________________________________________________________
> 
> Yahoo! Messenger NEW - crystal clear PC to PC calling worldwide with
> voicemail 
-- 
Jan Christian Bryne <ch...@ii.uib.no>


---------------------------------------------------------------------
To unsubscribe, e-mail: wsrf-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsrf-user-help@ws.apache.org


Re: Confusion regarding EndpointReferenceType and EndpointReference]

Posted by Java Helpline <he...@yahoo.co.uk>.
Hi Christian,
    It seems in my last reply my message has been lost, so I am resending the reply.
  This is true that Factory Design Pattern doesn’t have resources attached to itself, thus doesn’t need WS Addressing Headers in the request. In other words Factory Service is Singleton, which is same for all clients. In order to achieve this behaviour you have to make two changes in the generated code i.e. Post Generation modifications:
   
  1.        In the generated source code along with the java classes there is XXXX_wsrf-config.xml. Open this file and comment or delete the property with name  “resourceIdentifierReferenceParameterName” as shown below:
  <!--
      <property name="resourceIdentifierReferenceParameterName">
  <value>{http://tutorial.wsrf.dl.ac.uk/helloworld}ResourceIdentifier</value>
      </property>
   --> 
  In WSRF Documentation the recommended way is to change wsrf-config.xml which is in Tomcat\webapps\wsrf\WEB-INF\classes directory. The change is once again the same i.e. comment or delete the property with name  resourceIdentifierReferenceParameterName for your Factory Service. 
   
  I personally like to make changes before deploying as XXXX_wsrf-config.xml is small file related to only specific WSRF Service on the other hand wsrf-config.xml is large fiel with the information about all deployed WSRF Services.
   
    
   The second change is to modify the Home Class of your Factory Service bu creating the instance with null id: 
  XXXXResource instance1 = (XXXXResource) createInstance( null );
  add( instance1 );
   
   
  These two changes provide enough information to WSRF 1.1 to either doesn’t look for WS Addressing Headers in the Request or if there is any then ignore it.
   
   
  I will try your way of looking for the Home for other Service rather than JNDI, myself not sure which is the best way.
   
  Thank you for your help and replies.
  Asif
  

Jan Christian Bryne <ch...@ii.uib.no> wrote:
  Hi Asif,

Yes, that's right. I have another implementation of WS Addressing. 
It's not included in the WSRF 1.1 download. If I knew in advance I'd let
you know..

Regarding your other issue of finding the Home class:
I'm also implementing the Factory design pattern, using one factory
service called NCBIBlastFactory and one instance service called
NCBIBlastInstance. 
To reach the home of the instance service from the factory service, I
use the following:

NCBIBlastInstanceHome blastHome = (NCBIBlastInstanceHome)
WsrfRuntime.getRuntime().getResourceHome("NCBI_BlastInstance"); 

To do that it is necessary to import org.apache.ws.resource.WsrfRuntime;
I'm not sure which way is best, this way or using JNDI.

I have one other issue with the factory design pattern. It's not really
necessary for the factory to require a Addressing header, since it
doesn't make use of the resource identifier. It just forwards it to the
client.

Is it possible to generate code with
org.apache.ws.resource.tool.Wsdl2Java for a service that doesn't require
the Addressing header? And if not: Is there any way to tweak the code to
make it so post generation?


- Christian 


On Sun, 2006-02-26 at 13:17 +0000, Java Helpline wrote:
> Hi Christian,
> Thank you very much for your reply. It is also working for me with
> one small problem. I can't find the Constants class which should be in
> the package org.apache.axis.message.addressing. But from internet I
> saw the value of 
> 
> public static final String NS_URI_ADDRESSING_08 =
> public static final String NS_URI_ADDRESSING_2004_08 =
> http://schemas.xmlsoap.org/ws/2004/08/addressing;
> 
> so have hard coded the String Value. One question do you have
> downloaded WS Addressing reference implementation seperately from
> Apollo, or it is part of Apollo Library. It seems to me that it is not
> included with Apollo WSRF implementation. 
> 
> Once again thank you for your help.
> It seems you are also using Factory Design Patt! ern for WSRF, have
> you tried to search for home of any WSRF Service through JNDI lookup
> (). I have done that for Globus WS Core and earlier versions of Apollo
> WSRF but is not working for current implementation. 
> 
> Regards 
> Asif
> 
> Jan Christian Bryne wrote:
> Hi,
> 
> This seems to work for me:
> 
> org.xmlsoap.schemas.ws.x2004.x08.addressing.EndpointReferenceType epr =
> ((XmlBeansEndpointReference) getEndpointReference
> ()).getXmlObject
> (Constants.NS_URI_ADDRESSING_08));
> 
> The code is from my Resource class, and the
> getEndpointReference()
> method is defined in the AbstractResource class.
> 
> - Christian
> 
> 
> On Sat, 2006-02-25 at 13:36 +0000, Java Helpline wrote:
> > Hi,
> > When last year I started working with WSRF Apache
> implementation
> > there was nice examp! le of Printer which implements Factory
> Pattern,
> > but then they removed that example with UnixFileSystem.
> UnixFileSystem
> > is not even demonstrating all the functionalities what you
> can expect
> > from WSRF.
> > 
> > I am trying to implement Factory Design Pattern, where there
> is create
> > method which returns EndpointReferenceType after creating
> the
> > resource. Problem is when I create Resource I can get its
> > EndpointReference and have no clue how EndpointReference can
> be
> > converted into EndpointReferenceType. In Globus
> implementation they
> > have 
> > AddressingUtils.createEndpointReference(ResourceContext,
> ResourceKey)
> > to create EndpointReferenceType. 
> > 
> > Can anyone tell me any easy way to convert EndpointReference
> into
> > EndpointReferenceType.
> > 
> > Thankyou.
> > Asif
> > 
> > 
> >
> ______________________________________________________________________
> > 
> &! gt; Yahoo! Photos – NEW, now offering a quality print
> service from just 8p
> > a photo.
> -- 
> Jan Christian Bryne 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wsrf-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: wsrf-user-help@ws.apache.org
> 
> 
> 
> 
> 
> ______________________________________________________________________
> 
> Yahoo! Messenger NEW - crystal clear PC to PC calling worldwide with
> voicemail 
-- 
Jan Christian Bryne 


---------------------------------------------------------------------
To unsubscribe, e-mail: wsrf-user-unsubscribe@ws.apache.org
For additional commands, e-mail: wsrf-user-help@ws.apache.org



		
---------------------------------
Yahoo! Messenger  NEW - crystal clear PC to PC calling worldwide with voicemail