Re: Override schemalocation when creating a client

2008-03-23 Thread Benson Margulies
The catalog manager might help, but, really, Glen's suggestion will lead to
much faster performance.

On Sun, Mar 23, 2008 at 1:47 AM, Glen Mazza [EMAIL PROTECTED] wrote:

 I'm not sure, but I think you're trying to create a dynamic client which
 is unfortunately not working for you.  Hopefully someone else can answer
 your specific question on this, but in the meantime, you might wish to
 try the more traditional route of getting the WSDL and XSD's on your
 machine locally, running wsdl2java and then coding your SOAP client
 using the wsdl2java artifacts generated, similar to here[1].  Once done,
 any missing XSD's from the server should no longer be a concern for you.

 HTH,
 Glen

 [1] http://www.jroller.com/gmazza/date/20070929


 Am Samstag, den 22.03.2008, 16:28 -0700 schrieb Kalle Korhonen:
  Hello cxfers,
 
  I'm trying to consume some web service with jaxws/cxf. I use
 Service.create(new
  URL(http://some.server/service?wsdl;), SERVICE_NAME). The service's
 wsdl
  imports xsd with a relative schemaLocation (e.g xsd:import
  namespace=servicens schemaLocation=servicens.xsd) , but the .xsds
 are
  not available through the server (from http://some.server/servicens.xsd),
 so
  constructing the service (client) fails with FileNotFoundException. I
 have
  the xsds but I don't know how to tell cxf's servicefactory where the
 xsds
  are located. I've seen quite a few other threads on the list related to
  resolving references to xsds but the service is not mine so I cannot
 change
  the references or make the xsds available on the server. If I point to a
  local wsdl, the service factory doesn't even try to resolve the schemas;
  probably because it's setting the validation off, but I don't know how
 to
  control that. Anybody able to help me?
 
  Kalle




WS-Security: please help.

2008-03-23 Thread [EMAIL PROTECTED]
Hi CXF-User-List,
I am new to this list and, to tell the truth, this is the first time I 
use a mailing list, so please be patient with me :) .

As you probably have understood from the subject, I need help with WS-
Security. Unfortunately even though I have read many posts as well as 
the cxf documentation (and XFire too!), I haven't been able to do as 
follow.
I would like to set up a very simple web service that should feature:
1) authentication
2) encryption
3) signing.
My constraints are: I don't really know much about  spring and ws-
security (a part from what it's capable to do).

So my webservice is really simple: I have a SEI (IHelloWorld that is 
annotated with @WebService) and its implementation (HelloWorldImpl 
annotated with @WebService(serviceName ...)).
My server is this: 

package com.hw.server;

public class Server {

public Server(String address, IHelloWorld implementor){
Endpoint.publish(address, implementor);
}   

public static void main(String[] args) throws Exception {

System.out.println(Starting server);
String address = http://localhost:9000/helloWorld;;
IHelloWorld implementor = new HelloWorldImpl();
new Server(address, implementor);
System.out.println(Server ready);

System.in.read();
}

}
My client is:

package com.hw.client;

public class Client {


public static void main(String[] args) throws Exception {

URL wsdlURL = new URL(http://localhost:9000/helloWorld?wsdl;);
QName SERVICE_NAME = new QName(http://server.hw.com/;, 
HelloWorld);
Service service = Service.create(wsdlURL, SERVICE_NAME);
IHelloWorld client = service.getPort(IHelloWorld.class);
String result = client.sayHi(to you all!);

System.out.println(result);

System.out.println(client.concat(Hello ,  world));
}

}

I would like to add ws-security so that only a selected numbers of 
clients can use my very valuable :) web service.
So here my doubts come!
First I would like not to use spring (as I said, I don't know what-
this-spring-thing-is), I would like not to use tomcat or other things 
(Axis): just pure java api (if it is possible).
So could you help me step-by-step?
I have read several books regarding SOA but none of them said how to 
implement WSS just using plain java 6 api.
If it is not possible using java 6 api, how can I implement such 
secure web service with cxf api (wss4jInInterceptor and so on...)?
I have read about interceptors, handlers but I haven't understood 
much.
Please CXF-User-List help me, you are my last hope!
Thanks in advance!

WhiteWolf







___
Tiscali.Fax: ricevi gratis sulla tua email e invii 
a 12 cent per pagina senza scatto alla risposta
http://vas.tiscali.it/fax//



Re: Override schemalocation when creating a client

2008-03-23 Thread Kalle Korhonen
On Sat, Mar 22, 2008 at 10:47 PM, Glen Mazza [EMAIL PROTECTED] wrote:

 I'm not sure, but I think you're trying to create a dynamic client which
 is unfortunately not working for you.  Hopefully someone else can answer
 your specific question on this, but in the meantime, you might wish to
 try the more traditional route of getting the WSDL and XSD's on your
 machine locally, running wsdl2java and then coding your SOAP client
 using the wsdl2java artifacts generated, similar to here[1].  Once done,
 any missing XSD's from the server should no longer be a concern for you.


But it is a concern. I have the generated service stubs, but if I create the
service by specifying the the server url (Service.create(new
URL(http://http://some.server/service?wsdl...),
it'll try to fetch the xsds and fails because of that. The same doesn't
happen if I point to a wsdl from classpath. I need to be able to specify the
service location in code, and obviously I can add a new service port
dynamically (Service.addPort) to make it work. But that's not the point; I
believe the spec says the schemaLocation is only a hint and furthermore, I
should be able to use the service without forced validation, don't you
think?

Kalle


Am Samstag, den 22.03.2008, 16:28 -0700 schrieb Kalle Korhonen:
  Hello cxfers,
 
  I'm trying to consume some web service with jaxws/cxf. I use
 Service.create(new
  URL(http://some.server/service?wsdl;), SERVICE_NAME). The service's
 wsdl
  imports xsd with a relative schemaLocation (e.g xsd:import
  namespace=servicens schemaLocation=servicens.xsd) , but the .xsds
 are
  not available through the server (from http://some.server/servicens.xsd),
 so
  constructing the service (client) fails with FileNotFoundException. I
 have
  the xsds but I don't know how to tell cxf's servicefactory where the
 xsds
  are located. I've seen quite a few other threads on the list related to
  resolving references to xsds but the service is not mine so I cannot
 change
  the references or make the xsds available on the server. If I point to a
  local wsdl, the service factory doesn't even try to resolve the schemas;
  probably because it's setting the validation off, but I don't know how
 to
  control that. Anybody able to help me?
 
  Kalle




Re: Override schemalocation when creating a client

2008-03-23 Thread Glen Mazza
I have not coded that way before, nor needed to.  Can you not just set
the ENDPOINT_ADDRESS_PROPERTY as done here[1], step #7?

Otherwise, the JAX WS 2.1 specification, in Section 5.2.5.4
(Application-Specified Service) seems to define the manner of making
web services calls as you do below.  For XSD resolution, it also
requires using either the catalog facility defined in Section 4.4 or
metadata documents.  I would guess you would want to create the former
for your SOAP client calls to work.

HTH,
Glen

[1] http://www.jroller.com/gmazza/entry/using_the_ebay_shopping_api1

Am Sonntag, den 23.03.2008, 14:39 -0700 schrieb Kalle Korhonen:
 On Sat, Mar 22, 2008 at 10:47 PM, Glen Mazza [EMAIL PROTECTED] wrote:
 
  I'm not sure, but I think you're trying to create a dynamic client which
  is unfortunately not working for you.  Hopefully someone else can answer
  your specific question on this, but in the meantime, you might wish to
  try the more traditional route of getting the WSDL and XSD's on your
  machine locally, running wsdl2java and then coding your SOAP client
  using the wsdl2java artifacts generated, similar to here[1].  Once done,
  any missing XSD's from the server should no longer be a concern for you.
 
 
 But it is a concern. I have the generated service stubs, but if I create the
 service by specifying the the server url (Service.create(new
 URL(http://http://some.server/service?wsdl...),
 it'll try to fetch the xsds and fails because of that. The same doesn't
 happen if I point to a wsdl from classpath. I need to be able to specify the
 service location in code, and obviously I can add a new service port
 dynamically (Service.addPort) to make it work. But that's not the point; I
 believe the spec says the schemaLocation is only a hint and furthermore, I
 should be able to use the service without forced validation, don't you
 think?
 
 Kalle
 
 
 Am Samstag, den 22.03.2008, 16:28 -0700 schrieb Kalle Korhonen:
   Hello cxfers,
  
   I'm trying to consume some web service with jaxws/cxf. I use
  Service.create(new
   URL(http://some.server/service?wsdl;), SERVICE_NAME). The service's
  wsdl
   imports xsd with a relative schemaLocation (e.g xsd:import
   namespace=servicens schemaLocation=servicens.xsd) , but the .xsds
  are
   not available through the server (from http://some.server/servicens.xsd),
  so
   constructing the service (client) fails with FileNotFoundException. I
  have
   the xsds but I don't know how to tell cxf's servicefactory where the
  xsds
   are located. I've seen quite a few other threads on the list related to
   resolving references to xsds but the service is not mine so I cannot
  change
   the references or make the xsds available on the server. If I point to a
   local wsdl, the service factory doesn't even try to resolve the schemas;
   probably because it's setting the validation off, but I don't know how
  to
   control that. Anybody able to help me?
  
   Kalle
 
 



Re: REST-JS

2008-03-23 Thread Jervis Liu
Hi Sergey, could you elaborate a bit more on the ?_js or ?_lang=js stuff
please. I thought what Benson and Arul were talking about is a pure client
stack that is implemented in Java script that can connect to JAX-RS
compatible RESTful services. As far as the JAX-RS  server side is concerned,
it does not matter the request is coming from a java script client or
anything else, does it?


Cheers,
Jervis

On Sat, Mar 22, 2008 at 1:27 AM, Sergey Beryozkin [EMAIL PROTECTED]
wrote:

 Hi Benson

 For current CXF JAX-RS impl, the idea is to treat queries starting from
 '_' as system ones, intended for the JAX-RS runtime, such
 that such queries can be distinguished from application-specific ones.
 We've added SystemQueryHandlers which are invoked before the
 actual target object, so one of such handlers can be created to handle
 '_js' extension to avoid a clash with ?js support in
 runtime/js...

 Cheers, Sergey

 
 IONA Technologies PLC (registered in Ireland)
 Registered Number: 171387
 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland



Re: Override schemalocation when creating a client

2008-03-23 Thread Jervis Liu
Hi Kalle, comment in-line.

Cheers,
Jervis

On Mon, Mar 24, 2008 at 5:39 AM, Kalle Korhonen [EMAIL PROTECTED]
wrote:

 On Sat, Mar 22, 2008 at 10:47 PM, Glen Mazza [EMAIL PROTECTED]
 wrote:

  I'm not sure, but I think you're trying to create a dynamic client which
  is unfortunately not working for you.  Hopefully someone else can answer
  your specific question on this, but in the meantime, you might wish to
  try the more traditional route of getting the WSDL and XSD's on your
  machine locally, running wsdl2java and then coding your SOAP client
  using the wsdl2java artifacts generated, similar to here[1].  Once done,
  any missing XSD's from the server should no longer be a concern for you.
 

 But it is a concern. I have the generated service stubs, but if I create
 the
 service by specifying the the server url (Service.create(new
 URL(http://http://some.server/service?wsdl...),
 it'll try to fetch the xsds and fails because of that. The same doesn't
 happen if I point to a wsdl from classpath. I need to be able to specify
 the
 service location in code,


You've got it almost right. You need to point your client to use a local
copy of wsdl file and xsds etc. But you do not need to hard code the wsdl
location in your client. Take a look into any CXF sample, for example,
samples\hello_world. You can see the WSDL location is passed in from command
line or from ant script as below:

public static void main(String args[]) throws Exception {

if (args.length == 0) {
System.out.println(please specify wsdl);
System.exit(1);
}

URL wsdlURL;
File wsdlFile = new File(args[0]);
if (wsdlFile.exists()) {
wsdlURL = wsdlFile.toURL();
} else {
wsdlURL = new URL(args[0]);
}

System.out.println(wsdlURL);
SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
Greeter port = ss.getSoapPort();

.
  }


 and obviously I can add a new service port
 dynamically (Service.addPort) to make it work. But that's not the point; I
 believe the spec says the schemaLocation is only a hint and furthermore, I
 should be able to use the service without forced validation, don't you
 think?

 Kalle


 Am Samstag, den 22.03.2008, 16:28 -0700 schrieb Kalle Korhonen:
   Hello cxfers,
  
   I'm trying to consume some web service with jaxws/cxf. I use
  Service.create(new
   URL(http://some.server/service?wsdl;), SERVICE_NAME). The service's
  wsdl
   imports xsd with a relative schemaLocation (e.g xsd:import
   namespace=servicens schemaLocation=servicens.xsd) , but the .xsds
  are
   not available through the server (from
 http://some.server/servicens.xsd),
  so
   constructing the service (client) fails with FileNotFoundException. I
  have
   the xsds but I don't know how to tell cxf's servicefactory where the
  xsds
   are located. I've seen quite a few other threads on the list related
 to
   resolving references to xsds but the service is not mine so I cannot
  change
   the references or make the xsds available on the server. If I point to
 a
   local wsdl, the service factory doesn't even try to resolve the
 schemas;
   probably because it's setting the validation off, but I don't know how
  to
   control that. Anybody able to help me?
  
   Kalle
 
 



Sending and receiving soap messages

2008-03-23 Thread tapratt

Hi,

Does any one have an example of how to send and receive a soap message
using CXF.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Sending-and-receiving-soap-messages-tp16245148p16245148.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Sending and receiving soap messages

2008-03-23 Thread Jervis Liu
Download a CXF kit from [1] then take a look into samples\hello_world demo.

Cheers,
Jervis

[1]. http://incubator.apache.org/cxf/download.html

On Mon, Mar 24, 2008 at 12:02 PM, tapratt [EMAIL PROTECTED] wrote:


 Hi,

 Does any one have an example of how to send and receive a soap message
 using CXF.

 Thanks!
 --
 View this message in context:
 http://www.nabble.com/Sending-and-receiving-soap-messages-tp16245148p16245148.html
 Sent from the cxf-user mailing list archive at Nabble.com.




Re: Override schemalocation when creating a client

2008-03-23 Thread Kalle Korhonen
On Sun, Mar 23, 2008 at 4:50 PM, Glen Mazza [EMAIL PROTECTED] wrote:

 I have not coded that way before, nor needed to.  Can you not just set
 the ENDPOINT_ADDRESS_PROPERTY as done here[1], step #7?


That would work, but I don't think it's any easier or more correct than:
QName newServicePort = new QName(urn:some:service, newport);
service.addPort(newServicePort,
javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING,http://newserver/service
);
servicePort = service.getPort(newServicePort, ServiceInterface.class
);

Otherwise, the JAX WS 2.1 specification, in Section 5.2.5.4
 (Application-Specified Service) seems to define the manner of making
 web services calls as you do below.  For XSD resolution, it also
 requires using either the catalog facility defined in Section 4.4 or
 metadata documents.  I would guess you would want to create the former
 for your SOAP client calls to work.


Thanks for pointing out section 4.4. I didn't really feel like configuring
the default XML catalog for the xml parser and didn't see any way of
providing custom entity resolvers. Hadn't noticed META-INF/jax-
ws-catalog.xml, that looks exactly like what I was looking for.

Kalle



 Am Sonntag, den 23.03.2008, 14:39 -0700 schrieb Kalle Korhonen:
  On Sat, Mar 22, 2008 at 10:47 PM, Glen Mazza [EMAIL PROTECTED]
 wrote:
 
   I'm not sure, but I think you're trying to create a dynamic client
 which
   is unfortunately not working for you.  Hopefully someone else can
 answer
   your specific question on this, but in the meantime, you might wish to
   try the more traditional route of getting the WSDL and XSD's on your
   machine locally, running wsdl2java and then coding your SOAP client
   using the wsdl2java artifacts generated, similar to here[1].  Once
 done,
   any missing XSD's from the server should no longer be a concern for
 you.
  
 
  But it is a concern. I have the generated service stubs, but if I create
 the
  service by specifying the the server url (Service.create(new
  URL(http://http://some.server/service?wsdl...),
  it'll try to fetch the xsds and fails because of that. The same doesn't
  happen if I point to a wsdl from classpath. I need to be able to specify
 the
  service location in code, and obviously I can add a new service port
  dynamically (Service.addPort) to make it work. But that's not the point;
 I
  believe the spec says the schemaLocation is only a hint and furthermore,
 I
  should be able to use the service without forced validation, don't you
  think?
 
  Kalle
 
 
  Am Samstag, den 22.03.2008, 16:28 -0700 schrieb Kalle Korhonen:
Hello cxfers,
   
I'm trying to consume some web service with jaxws/cxf. I use
   Service.create(new
URL(http://some.server/service?wsdl;), SERVICE_NAME). The service's
   wsdl
imports xsd with a relative schemaLocation (e.g xsd:import
namespace=servicens schemaLocation=servicens.xsd) , but the
 .xsds
   are
not available through the server (from
 http://some.server/servicens.xsd),
   so
constructing the service (client) fails with FileNotFoundException.
 I
   have
the xsds but I don't know how to tell cxf's servicefactory where the
   xsds
are located. I've seen quite a few other threads on the list related
 to
resolving references to xsds but the service is not mine so I cannot
   change
the references or make the xsds available on the server. If I point
 to a
local wsdl, the service factory doesn't even try to resolve the
 schemas;
probably because it's setting the validation off, but I don't know
 how
   to
control that. Anybody able to help me?
   
Kalle
  
  




Re: Override schemalocation when creating a client

2008-03-23 Thread Kalle Korhonen
On Sun, Mar 23, 2008 at 7:57 PM, Jervis Liu [EMAIL PROTECTED] wrote:

 On Mon, Mar 24, 2008 at 5:39 AM, Kalle Korhonen 
 [EMAIL PROTECTED]
  On Sat, Mar 22, 2008 at 10:47 PM, Glen Mazza [EMAIL PROTECTED]
   machine locally, running wsdl2java and then coding your SOAP client
   using the wsdl2java artifacts generated, similar to here[1].  Once
 done,
   any missing XSD's from the server should no longer be a concern for
 you.
  But it is a concern. I have the generated service stubs, but if I create
  service by specifying the the server url (Service.create(new
  URL(http://http://some.server/service?wsdl...),
  it'll try to fetch the xsds and fails because of that. The same doesn't
  happen if I point to a wsdl from classpath. I need to be able to specify
  the
  service location in code,

 You've got it almost right. You need to point your client to use a local
 copy of wsdl file and xsds etc. But you do not need to hard code the wsdl
 location in your client. Take a look into any CXF sample, for example,
 samples\hello_world. You can see the WSDL location is passed in from
 command
 line or from ant script as below:


I think you misunderstood what we are talking about here; not the the wsdl
location but the location of the service (port) (and originally, how
references to imported resources can and should be resolved).

Kalle