Re: [Deploy in JBOSS] Address already in use Exception

2007-12-09 Thread Eman Ali al-Maktari [IT Department]
Hi All, 
I solved the problem by adding this code into destroy() method of the servlet 
that publishes my services 

public void destroy() { 
... 
JettyHTTPServerEngineFactory factory = new JettyHTTPServerEngineFactory(); 
JettyHTTPServerEngine jetty = factory.retrieveJettyHTTPServerEngine(9090); 
try { 
jetty.getServer().stop(); 
} catch (Exception e) { 
e.printStackTrace(); 
} 
... 
} 

Thanks for you cooperation, I wish this will help someone else, bye! 
- Original Message - 
From: Eman Ali al-Maktari [IT Department] [EMAIL PROTECTED] 
To: cxf-user@incubator.apache.org 
Sent: Saturday, December 8, 2007 5:20:01 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 

Hi All, it's me again 
Dear Saleh, I tried your solution but the endpoints were not published at all! 
thanks a lot for help. 
 
Dear CXF team, I think what I'm facing is a bug in the CXF itself, what made me 
say this, is that I made a very simple project with one service that returns 
hello world and tested it using altova [XMLSpy] it works fine, but the 
problem of unbinding exists, we can't deploy some thing that doesn't unbind in 
our production servers. 

So, if you don't think it's a bug please help me figure out where is the 
problem, I'll really appreciate it. 

thank you all in advanced. 
- Original Message - 
From: Eman Ali al-Maktari [IT Department] [EMAIL PROTECTED] 
To: cxf-user@incubator.apache.org 
Sent: Monday, November 26, 2007 7:10:24 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 


Dear Andrew, 
Thanks a lot for your cooperation you did your best, and you was helpful coz 
even if the problem wasn't solved but at least I could fined something to say 
to my Boss ;-) 

Dear Saleh, 
Thanks for your reply , I'll try it and feed you back.. 
- Original Message - 
From: Saleh Al-Ghashmi [EMAIL PROTECTED] 
To: cxf-user@incubator.apache.org 
Sent: Monday, November 26, 2007 6:44:27 PM (GMT+0300) Asia/Kuwait 
Subject: Re: [Deploy in JBOSS] Address already in use Exception 




Andrew Dinn wrote: 
 
 Hi Eman, 
 
 Your config files look ok. I'm afraid I don't really understand what is 
 going wrong in that case. 
 
 Regarding your destroy code I have two comments. Firstly, I was 
 suggesting you destroy the cxf *servlet*, not (just) the cxf bus. Also, 
 there is no guarantee that the default bus at the point where your 
 destroy code is run is the same bus as the one you installed at the 
 point where the create code was run. Maybe you should stash the cxf 
 servlet somewhere when you create e.g. attach it to the servlet which is 
 running the create code. Then you can pick it up later and call its 
 destroy method. 
 
 Hope this helps. If not then I am afraid I am stumped :-( 
 
 regards, 
 
 
 Andrew Dinn JBoss Transactions 
 -- 
 JBoss, a Division of Red Hat 
 Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod 
 Street, Windsor, Berkshire, 
 SI4 1TE, United Kingdom. 
 Registered in UK and Wales under Company Registration No. 3798903 
 Directors: Michael Cunningham (USA), Charlie Peters (USA) and David 
 Owens (Ireland) 
 
 Eman Ali al-Maktari [IT Department] wrote: 
 Hi Andrew, 
 I tried to stop the bus using: 
 public void destroy() { 
 Bus bus = CXFBusFactory.getDefaultBus(); 
 if (eCategories.isPublished()){ 
 System.out.println(I'll stop Categories!); 
 eCategories.stop(); 
 bus.shutdown(false); 
 System.out.println(I't was stopped); 
 } 
 super.destroy(); 
 } 
 
 but the problem still exist, I also tried removing 
 NOTE: this destroy() method is the servlet method. 
 I also tried to not explicitly create a CXFServlet(), and the problem 
 happened again and again :-( 
 
 These are my XML files: 
 CXF.XML=== 
 beans xmlns=http://www.springframework.org/schema/beans; 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
 xmlns:jaxws=http://cxf.apache.org/jaxws; 
 xsi:schemaLocation= 
 http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
 http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; 
 
 bean id=logInbound 
 class=org.apache.cxf.interceptor.LoggingInInterceptor/ 
 bean id=logOutbound 
 class=org.apache.cxf.interceptor.LoggingOutInterceptor/ 
 
 bean id=cxf class=org.apache.cxf.bus.CXFBusImpl 
 property name=inInterceptors 
 list 
 ref bean=logInbound/ 
 /list 
 /property 
 property name=outInterceptors 
 list 
 ref bean=logOutbound/ 
 /list 
 /property 
 property name=outFaultInterceptors 
 list 
 ref bean=logOutbound/ 
 /list 
 /property 
 /bean 
 /beans 
 CXF-SERVLET.XML 
 ?xml version=1.0 encoding=UTF-8? 
 beans xmlns=http://www.springframework.org/schema/beans; 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
 xmlns:jaxws=http://cxf.apache.org/jaxws; 
 

Re: Dynamic client basic auth

2007-12-09 Thread tog
Ok looking in the mailing list, it looks that this is not yet
implemented (I mean for retrieving the wsdl)
Dan,what would be the effort for adding this ? If you guide me,I might
consider working on this as I did for the proxy auth in XFire.
In order to avoit the problem,I retrieved the wsdl using wget.Once it
is local and the AuthorizationPolicy has been set up,the subsequent
calls are working fine

Guillaume

On Dec 9, 2007 5:22 PM, tog [EMAIL PROTECTED] wrote:
 Hum I can believe this ...
 What I am looking for is a way to set up the Authorization header in
 the HTTP request (prior to get the wsdl).
 I know how to set-up the Proxy-Authorization header and I found
 AuthorizationPolicy

 AuthorizationPolicy auth = conduit.getAuthorization();
 auth.setUserName(username);
 auth.setPassword(password);

 Will that do the job ?
 Then the problem is to do this prior to the creation of the client ...
 which is the first thing I do !

 Any thought ?

 Guillaume



 On Dec 9, 2007 3:34 AM, Glen Mazza [EMAIL PROTECTED] wrote:
  I'm not sure the Java artifacts would have a defined place for such
  information.
 
  Glen
 
  Am Sonntag, den 09.12.2007, 01:15 +0800 schrieb tog:
 
   the same question apply for the wsdl2java. I did not see anything for
   setting up username/passwd in the options
  
   On Dec 9, 2007 1:13 AM, tog [EMAIL PROTECTED] wrote:
Hi
   
I need basic auth to retrieve a wsdl.
I currently use the dynamic client. All the constructors take directly
a string for the wsdl url.
Is there a way to set username/passwd before actually calling the 
server ?
   
Thanks
   
--
   
Best Regards
Guillaume
http://cheztog.blogspot.com
   
  
  
  
 
 



 --


 Best Regards
 Guillaume
 http://cheztog.blogspot.com




-- 

Best Regards
Guillaume
http://cheztog.blogspot.com


Re: Dynamic client basic auth

2007-12-09 Thread Willem2

Hi Guillaume
 
The AuthorizationPolicy only works for HTTP Conduit of HTTP Destination. 
In your case , I don't think this policy will take effect, since CXF just
uses URL to get wsdl when create the service from wsdl.

Maybe you need to use JVM's proxy setting such as 
-DproxySet=true -DproxyHost=PROXYSERVER -DproxyPort=PORT 

Willem.


tog wrote:
 
 Hum I can believe this ...
 What I am looking for is a way to set up the Authorization header in
 the HTTP request (prior to get the wsdl).
 I know how to set-up the Proxy-Authorization header and I found
 AuthorizationPolicy
 
 AuthorizationPolicy auth = conduit.getAuthorization();
 auth.setUserName(username);
 auth.setPassword(password);
 
 Will that do the job ?
 Then the problem is to do this prior to the creation of the client ...
 which is the first thing I do !
 
 Any thought ?
 
 Guillaume
 
 
 On Dec 9, 2007 3:34 AM, Glen Mazza [EMAIL PROTECTED] wrote:
 I'm not sure the Java artifacts would have a defined place for such
 information.

 Glen

 Am Sonntag, den 09.12.2007, 01:15 +0800 schrieb tog:

  the same question apply for the wsdl2java. I did not see anything for
  setting up username/passwd in the options
 
  On Dec 9, 2007 1:13 AM, tog [EMAIL PROTECTED] wrote:
   Hi
  
   I need basic auth to retrieve a wsdl.
   I currently use the dynamic client. All the constructors take
 directly
   a string for the wsdl url.
   Is there a way to set username/passwd before actually calling the
 server ?
  
   Thanks
  
   --
  
   Best Regards
   Guillaume
   http://cheztog.blogspot.com
  
 
 
 


 
 
 
 -- 
 
 Best Regards
 Guillaume
 http://cheztog.blogspot.com
 
 

-- 
View this message in context: 
http://www.nabble.com/Dynamic-client---basic-auth-tp14230385p14238535.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Dynamic client basic auth

2007-12-09 Thread tog
Hi Willem,

Can you explain in details your sentence: The AuthorizationPolicy
only works for HTTP Conduit of HTTP Destination. as I am not familiar
with CXF internals.

In my case I am not using a proxy so the flag you are mentioning won't
help much. My server is waiting for the following http header:
Authorization: Basic ... and not Proxy-Authorization

I might need to dig a bit in order to see what is the effect on the
http request of setting the username and password of
AutorizationPolicy :-)

Cheers
Guillaume

On Dec 9, 2007 9:32 PM, Willem2 [EMAIL PROTECTED] wrote:

 Hi Guillaume

 The AuthorizationPolicy only works for HTTP Conduit of HTTP Destination.
 In your case , I don't think this policy will take effect, since CXF just
 uses URL to get wsdl when create the service from wsdl.

 Maybe you need to use JVM's proxy setting such as
 -DproxySet=true -DproxyHost=PROXYSERVER -DproxyPort=PORT

 Willem.



 tog wrote:
 
  Hum I can believe this ...
  What I am looking for is a way to set up the Authorization header in
  the HTTP request (prior to get the wsdl).
  I know how to set-up the Proxy-Authorization header and I found
  AuthorizationPolicy
 
  AuthorizationPolicy auth = conduit.getAuthorization();
  auth.setUserName(username);
  auth.setPassword(password);
 
  Will that do the job ?
  Then the problem is to do this prior to the creation of the client ...
  which is the first thing I do !
 
  Any thought ?
 
  Guillaume
 
 
  On Dec 9, 2007 3:34 AM, Glen Mazza [EMAIL PROTECTED] wrote:
  I'm not sure the Java artifacts would have a defined place for such
  information.
 
  Glen
 
  Am Sonntag, den 09.12.2007, 01:15 +0800 schrieb tog:
 
   the same question apply for the wsdl2java. I did not see anything for
   setting up username/passwd in the options
  
   On Dec 9, 2007 1:13 AM, tog [EMAIL PROTECTED] wrote:
Hi
   
I need basic auth to retrieve a wsdl.
I currently use the dynamic client. All the constructors take
  directly
a string for the wsdl url.
Is there a way to set username/passwd before actually calling the
  server ?
   
Thanks
   
--
   
Best Regards
Guillaume
http://cheztog.blogspot.com
   
  
  
  
 
 
 
 
 
  --
 
  Best Regards
  Guillaume
  http://cheztog.blogspot.com
 
 

 --
 View this message in context: 
 http://www.nabble.com/Dynamic-client---basic-auth-tp14230385p14238535.html
 Sent from the cxf-user mailing list archive at Nabble.com.





-- 

Best Regards
Guillaume
http://cheztog.blogspot.com


Re: dynamic client fails to create service

2007-12-09 Thread tog
Hi Benjamin,

Would help  if you can send the wsdl ;-)

Cheers
Guillaume

On Dec 9, 2007 1:42 PM, Benjamin Coiffe [EMAIL PROTECTED] wrote:



 Hi,

  The Dymamic client factory fails to create a client for the WSDL I have
 attached to this email.
  It is because of the complex type and the reference to a schema:

   s:element name=GetMaterialDataResponse
  s:complexType
s:sequence

  s:element minOccurs=0 maxOccurs=1
 name=GetMaterialDataResult
s:complexType
  s:sequence
s:element ref=s:schema /
s:any /
  /s:sequence
/s:complexType
  /s:element
/s:sequence
  /s:complexType
/s:element

  Although I am disappointed that it does not work, I an really wondering how
 the mapping rom this to JAVA could be done. Does the experts have any idea?
  For this wsdl to get compiled by the DynamicClientFactory, I change the
 previous type to:

  s:element name=GetMaterialDataResponse
   s:complexType
  s:sequence
s:element minOccurs=0 maxOccurs=1
 name=GetMaterialDataResult type=anyType/
  /s:sequence
   /s:complexType
  /s:element

  And I did not change the implementation of the web service. What do you
 guys think?

  Benjamin







-- 

Best Regards
Guillaume
http://cheztog.blogspot.com


How to make classes created from wsdl2java implements serializable?

2007-12-09 Thread daniel.mfreitas

Hello. I want to use wsdl2java to generate the client stubs to be used by my
client web application. I am using Spring Web Flow and it requires that
objects used in the flow are Serializable.

I successfully generated Serializable classes using the following bindings
file and Metro JAXWS RI implementation:

?xml version=1.0 encoding=UTF-8?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xmlns:jaxb=http://java.sun.com/xml/ns/jaxb;
xmlns:xjc=http://java.sun.com/xml/ns/jaxb/xjc;
elementFormDefault=qualified attributeFormDefault=unqualified
jaxb:extensionBindingPrefixes=xjc jaxb:version=1.0
xs:annotation
xs:appinfo
jaxb:globalBindings
xjc:serializable uid=-6026937020915831338/
/jaxb:globalBindings
/xs:appinfo
/xs:annotation
/xs:schema

But because of some limitations of Metro RI, we want to switch to CXF. When
calling wsdl2java from a maven build file and we try to supply the above
binding file, cfx throws

WSDLToJava Error : Unknown external binding files:

This is not a FileNotFoundError. wsdl2java does find the file, but it seems
it does not understand its contents. I wanted to use CXF for everything
including java2wsdl and wsdl2java. We have bad experiences to set up JAXWS
Metro RI and for some developers it is a pain to put it to work. 

So how can I make the entities stubs to implement serializable with
wsdl2java?
-- 
View this message in context: 
http://www.nabble.com/How-to-make-classes-created-from-wsdl2java-implements-serializable--tp14246207p14246207.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: How to make classes created from wsdl2java implements serializable?

2007-12-09 Thread Jim Ma

Hi ,
Add the wsdlLocation and Xpath express  to provide which schema you want 
to customize , try the following binding file

to see if it works for your wsdl:

jaxws:bindings wsdlLocation=${your.wsdl}
 xmlns:jaxws=http://java.sun.com/xml/ns/jaxws;
 xmlns:xs=http://www.w3.org/2001/XMLSchema;
 xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
 jaxws:bindings  node=wsdl:definitions/wsdl:types/xs:schema
  jaxb:globalBindings
   xjc:serializable 
uid=-6026937020915831338/

 /jaxb:globalBindings
 /jaxws:bindings
/jaxws:bindings

Regards
Jim


daniel.mfreitas wrote:

Hello. I want to use wsdl2java to generate the client stubs to be used by my
client web application. I am using Spring Web Flow and it requires that
objects used in the flow are Serializable.

I successfully generated Serializable classes using the following bindings
file and Metro JAXWS RI implementation:

?xml version=1.0 encoding=UTF-8?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xmlns:jaxb=http://java.sun.com/xml/ns/jaxb;
xmlns:xjc=http://java.sun.com/xml/ns/jaxb/xjc;
elementFormDefault=qualified attributeFormDefault=unqualified
jaxb:extensionBindingPrefixes=xjc jaxb:version=1.0
xs:annotation
xs:appinfo
jaxb:globalBindings
xjc:serializable uid=-6026937020915831338/
/jaxb:globalBindings
/xs:appinfo
/xs:annotation
/xs:schema

But because of some limitations of Metro RI, we want to switch to CXF. When
calling wsdl2java from a maven build file and we try to supply the above
binding file, cfx throws

WSDLToJava Error : Unknown external binding files:

This is not a FileNotFoundError. wsdl2java does find the file, but it seems
it does not understand its contents. I wanted to use CXF for everything
including java2wsdl and wsdl2java. We have bad experiences to set up JAXWS
Metro RI and for some developers it is a pain to put it to work. 


So how can I make the entities stubs to implement serializable with
wsdl2java?
  


Re: How to make classes created from wsdl2java implements serializable?

2007-12-09 Thread daniel.mfreitas

Well, the file you provided as an example throws

WSDLToJava Error : The binding file: file:/jaxb-bindings.xml references a
not well-formed xml document.

The file that I provided as an example and that works with JAXWS RI looks
quite different from the jaxws:bindings/ file I've seen around. For
example the root of the document is xs:schema/. Also in the file I
provided I do not have to specify my WSDL file, which makes sense for me
sisnce all I want to do is that the entity stubs implement Serializable. I
need them to be serializable so I can use them with other frameworks that
requires it.




Jim Ma-3 wrote:
 
 Hi ,
 Add the wsdlLocation and Xpath express  to provide which schema you want 
 to customize , try the following binding file
  to see if it works for your wsdl:
 
 jaxws:bindings wsdlLocation=${your.wsdl}
   xmlns:jaxws=http://java.sun.com/xml/ns/jaxws;
   xmlns:xs=http://www.w3.org/2001/XMLSchema;
   xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
   jaxws:bindings  node=wsdl:definitions/wsdl:types/xs:schema
jaxb:globalBindings
 xjc:serializable 
 uid=-6026937020915831338/
   /jaxb:globalBindings
   /jaxws:bindings
 /jaxws:bindings
 
 Regards
 Jim
 
 
 daniel.mfreitas wrote:
 Hello. I want to use wsdl2java to generate the client stubs to be used by
 my
 client web application. I am using Spring Web Flow and it requires that
 objects used in the flow are Serializable.

 I successfully generated Serializable classes using the following
 bindings
 file and Metro JAXWS RI implementation:

 ?xml version=1.0 encoding=UTF-8?
 xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
 xmlns:jaxb=http://java.sun.com/xml/ns/jaxb;
  xmlns:xjc=http://java.sun.com/xml/ns/jaxb/xjc;
 elementFormDefault=qualified attributeFormDefault=unqualified
  jaxb:extensionBindingPrefixes=xjc jaxb:version=1.0
  xs:annotation
  xs:appinfo
  jaxb:globalBindings
  xjc:serializable uid=-6026937020915831338/
  /jaxb:globalBindings
  /xs:appinfo
  /xs:annotation
 /xs:schema

 But because of some limitations of Metro RI, we want to switch to CXF.
 When
 calling wsdl2java from a maven build file and we try to supply the above
 binding file, cfx throws

 WSDLToJava Error : Unknown external binding files:

 This is not a FileNotFoundError. wsdl2java does find the file, but it
 seems
 it does not understand its contents. I wanted to use CXF for everything
 including java2wsdl and wsdl2java. We have bad experiences to set up
 JAXWS
 Metro RI and for some developers it is a pain to put it to work. 

 So how can I make the entities stubs to implement serializable with
 wsdl2java?
   
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-make-classes-created-from-wsdl2java-implements-serializable--tp14246207p14246608.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: jaxws_dispatch_provider demo

2007-12-09 Thread James Mao
Haven't looked it deeper, but firstly you should check if the modified 
xml still well-formed, you can check that with a browser.


Cheers,
James


I have playing with the jaxws_dispatch_provider demo sample after a
recent svn checkout

Then I tried to update the source files to try and understand how this works ;)

1 )  in wdsl/hello_world.wsdl

I replaced every occurence of
http://apache.org/hello_world_soap_http;
to
http://foobar.com/my_soap_http;


2) In Client.java

I replaced the
import org.java.hello_world_http.*;
to
import com.foobar.my_soap_http.*;


3) In each GreetMeDocLiteral*.xml  (server  client)
I replaced every namespace occurence of
http://apache.org/hello_world_soap_http;
to
http://foobar.com/my_soap_http;

4) In GreeterSoapProvider
I updated the targetNamespace to http://foobar.com/my_soap_http;





Now I am certainly missing something because I get an Exception... I
know I am a bad guy, and I should not have touched the nice demo ;)
, but I am puzzled with the stack trace :


[java] INFO: Interceptor has thrown exception, unwinding now
 [java] org.apache.cxf.interceptor.Fault: Unable to create
envelope from given source:
 [java] at
org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor$PostDispatchSOAPHandlerInterceptor.handleMessage(DispatchInDatabindingInterceptor.java:225)
 [java] at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
 [java] at
org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:312)
 [java] at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1948)
 [java] at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
 [java] at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
 [java] at
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
[...]
java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable
to create envelope from given source:
 [java] at
com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:114)
 [java] at
com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:71)

[...]
   [java] Caused by: javax.xml.transform.TransformerException:
org.xml.sax.SAXParseException: Premature end of file.
 [java] at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:673)
 [java] at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
 [java] at
com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.transform(EfficientStreamingTransformer.java:390)
 [java] at
com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:102)
 [java] ... 15 more
 [java] Caused by: org.xml.sax.SAXParseException: Premature end of file.
 [java] at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1269)
 [java] at 
org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
 [java] at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:607)
 [java] at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
 [java] ... 18 more


This premature end of file is very strange to me. I guess I forgot
to update another piece of code to make it run from an updated
hello_world.wsdl file.

Any help to understand would be appreciated



  




Re: SOAPAction

2007-12-09 Thread James Mao
I don't think that we have such an option, you can file a jira, patches 
are always welcome ;)


Regards,
James


Hi,

Is there a way to force CXF to generate WSDL having the SOAPAction set
with the name of the Operation i.e.
change
wsdl:operation name=sayHi
 soap:operation soapAction= style=document /

to be
wsdl:operation name=sayHi
 soap:operation soapAction=sayHi style=document /

Thanks
Guillaume


  




RE: jaxws_dispatch_provider demo

2007-12-09 Thread Liu, Jervis
Hi Eric, it looks like your client did not sent out an valid request to the 
server. A quick way to verify this is using sth like tcpmon to sniff the 
message you send on wire. In your client code, did you change the service and 
port QName to reflect your own namespaces? I.e., following lines:

QName serviceName1 = new 
QName(http://apache.org/hello_world_soap_http;, SOAPService1);
QName portName1 = new QName(http://apache.org/hello_world_soap_http;, 
SoapPort1);

SOAPService1 service1 = new SOAPService1(wsdlURL, serviceName1);

Cheers,
Jervis


 -Original Message-
 From: Eric Le Goff [mailto:[EMAIL PROTECTED]
 Sent: 2007年12月7日 23:47
 To: cxf-user@incubator.apache.org
 Subject: jaxws_dispatch_provider demo
 
 I have playing with the jaxws_dispatch_provider demo sample after a
 recent svn checkout
 
 Then I tried to update the source files to try and understand how this
 works ;)
 
 1 )  in wdsl/hello_world.wsdl
 
 I replaced every occurence of
 http://apache.org/hello_world_soap_http;
 to
 http://foobar.com/my_soap_http;
 
 
 2) In Client.java
 
 I replaced the
 import org.java.hello_world_http.*;
 to
 import com.foobar.my_soap_http.*;
 
 
 3) In each GreetMeDocLiteral*.xml  (server  client)
 I replaced every namespace occurence of
 http://apache.org/hello_world_soap_http;
 to
 http://foobar.com/my_soap_http;
 
 4) In GreeterSoapProvider
 I updated the targetNamespace to http://foobar.com/my_soap_http;
 
 
 
 
 
 Now I am certainly missing something because I get an Exception... I
 know I am a bad guy, and I should not have touched the nice demo ;)
 , but I am puzzled with the stack trace :
 
 
 [java] INFO: Interceptor has thrown exception, unwinding now
  [java] org.apache.cxf.interceptor.Fault: Unable to create
 envelope from given source:
  [java]   at
 org.apache.cxf.jaxws.interceptors.DispatchInDatabindingInterceptor$PostDi
 spatchSOAPHandlerInterceptor.handleMessage(DispatchInDatabindingInterc
 eptor.java:225)
  [java]   at
 org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
 hain.java:207)
  [java]   at
 org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:312)
  [java]   at
 org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleR
 esponse(HTTPConduit.java:1948)
  [java]   at
 org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(H
 TTPConduit.java:1791)
  [java]   at
 org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
  [java]   at
 org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
 [...]
 java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable
 to create envelope from given source:
  [java]   at
 com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
 eFactory.java:114)
  [java]   at
 com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelope
 FromSource(SOAPPart1_1Impl.java:71)
 
 [...]
[java] Caused by: javax.xml.transform.TransformerException:
 org.xml.sax.SAXParseException: Premature end of file.
  [java]   at
 com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
 nsformerImpl.java:673)
  [java]   at
 com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
 nsformerImpl.java:300)
  [java]   at
 com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransformer.tr
 ansform(EfficientStreamingTransformer.java:390)
  [java]   at
 com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
 eFactory.java:102)
  [java]   ... 15 more
  [java] Caused by: org.xml.sax.SAXParseException: Premature end of
 file.
  [java]   at
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abstra
 ctSAXParser.java:1269)
  [java]   at
 org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333)
  [java]   at
 com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIde
 ntity(TransformerImpl.java:607)
  [java]   at
 com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Tra
 nsformerImpl.java:661)
  [java]   ... 18 more
 
 
 This premature end of file is very strange to me. I guess I forgot
 to update another piece of code to make it run from an updated
 hello_world.wsdl file.
 
 Any help to understand would be appreciated
 
 
 
 --
 Eric Le Goff


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


Re: Dynamic client basic auth

2007-12-09 Thread Willem Jiang

Hi Guillaume,

Please see my comments in the mail.
tog wrote:

Hi Willem,

Can you explain in details your sentence: The AuthorizationPolicy
only works for HTTP Conduit of HTTP Destination. as I am not familiar
with CXF internals.

  
CXF http transport is implemented by two component HTTP Conduit (client 
side) and

HTTP Destination (server side).
But in the Service creation phase these two component are not involved , 
because CXF

just use the URL connection to  get the WSDL file.

CXF delegate the WSDL creation to WSDL4J and it use the blow code to 
create the WSDL

definition.
URL contextURL = (contextURI != null)
  ? StringUtils.getURL(null, contextURI)
  : null;
 URL url = StringUtils.getURL(contextURL, wsdlURI);
 InputStream inputStream = StringUtils.getContentAsInputStream(url);
 InputSource inputSource = new InputSource(inputStream);
 inputSource.setSystemId(url.toString());
 Document doc = getDocument(inputSource, url.toString());

I don't know if there is a way to set the basic authorization for the 
url by using system properties.

In my case I am not using a proxy so the flag you are mentioning won't
help much. My server is waiting for the following http header:
Authorization: Basic ... and not Proxy-Authorization
  
OK, this is my mistake. I think you can write codes to get the WSDL from 
the service which need use
HTTP basic authorization, and store this WSDL in the temp directory , 
then pass the temp WSDL file's URL

to the service.

I might need to dig a bit in order to see what is the effect on the
http request of setting the username and password of
AutorizationPolicy :-)

Cheers
Guillaume
  


Willem.

On Dec 9, 2007 9:32 PM, Willem2 [EMAIL PROTECTED] wrote:
  

Hi Guillaume

The AuthorizationPolicy only works for HTTP Conduit of HTTP Destination.
In your case , I don't think this policy will take effect, since CXF just
uses URL to get wsdl when create the service from wsdl.

Maybe you need to use JVM's proxy setting such as
-DproxySet=true -DproxyHost=PROXYSERVER -DproxyPort=PORT

Willem.



tog wrote:


Hum I can believe this ...
What I am looking for is a way to set up the Authorization header in
the HTTP request (prior to get the wsdl).
I know how to set-up the Proxy-Authorization header and I found
AuthorizationPolicy

AuthorizationPolicy auth = conduit.getAuthorization();
auth.setUserName(username);
auth.setPassword(password);

Will that do the job ?
Then the problem is to do this prior to the creation of the client ...
which is the first thing I do !

Any thought ?

Guillaume


On Dec 9, 2007 3:34 AM, Glen Mazza [EMAIL PROTECTED] wrote:
  

I'm not sure the Java artifacts would have a defined place for such
information.

Glen

Am Sonntag, den 09.12.2007, 01:15 +0800 schrieb tog:



the same question apply for the wsdl2java. I did not see anything for
setting up username/passwd in the options

On Dec 9, 2007 1:13 AM, tog [EMAIL PROTECTED] wrote:
  

Hi

I need basic auth to retrieve a wsdl.
I currently use the dynamic client. All the constructors take


directly


a string for the wsdl url.
Is there a way to set username/passwd before actually calling the


server ?


Thanks

--

Best Regards
Guillaume
http://cheztog.blogspot.com




  



--

Best Regards
Guillaume
http://cheztog.blogspot.com


  

--
View this message in context: 
http://www.nabble.com/Dynamic-client---basic-auth-tp14230385p14238535.html
Sent from the cxf-user mailing list archive at Nabble.com.







  


Re: How to make classes created from wsdl2java implements serializable?

2007-12-09 Thread Jim Ma


serializable element is in wrong namespace , you need to change it  
to  jaxb:serializable uid=-6026937020915831338 /.


daniel.mfreitas wrote:

Well, the file that worked for me is this:

?xml version=1.0 encoding=UTF-8?
jaxws:bindings wsdlLocation=mywsdl.wsdl
xmlns:jaxws=http://java.sun.com/xml/ns/jaxws;
xmlns:xs=http://www.w3.org/2001/XMLSchema;
xmlns:jaxb=http://java.sun.com/xml/ns/jaxb;
xmlns:xjc=http://java.sun.com/xml/ns/jaxb/xjc;
xs:annotation
xs:appinfo
jaxb:globalBindings
xjc:serializable uid=-6026937020915831338 /
/jaxb:globalBindings
/xs:appinfo
/xs:annotation
/jaxws:bindings

Problem is the classes are still not Serializable. I think jaxws:bindings
dot not recognize xs:appinfo or xjc:serializable.

Ok let's forget about binding files for a moment. Let's get to the basic
problem. I want the generated stubs to implement Serializable. That's all I
need. How can I make this happen?


James Mao wrote:
  
You have to make sure all your xmls are well-formed, probably caused by 
a missing closing tag, or such

You can check it with your browser

James



Well, the file you provided as an example throws

WSDLToJava Error : The binding file: file:/jaxb-bindings.xml references a
not well-formed xml document.

The file that I provided as an example and that works with JAXWS RI looks
quite different from the jaxws:bindings/ file I've seen around. For
example the root of the document is xs:schema/. Also in the file I
provided I do not have to specify my WSDL file, which makes sense for me
sisnce all I want to do is that the entity stubs implement Serializable.
I
need them to be serializable so I can use them with other frameworks that
requires it.




Jim Ma-3 wrote:
  
  

Hi ,
Add the wsdlLocation and Xpath express  to provide which schema you want 
to customize , try the following binding file

 to see if it works for your wsdl:

jaxws:bindings wsdlLocation=${your.wsdl}
  xmlns:jaxws=http://java.sun.com/xml/ns/jaxws;
  xmlns:xs=http://www.w3.org/2001/XMLSchema;
  xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
  jaxws:bindings  node=wsdl:definitions/wsdl:types/xs:schema
   jaxb:globalBindings
xjc:serializable 
uid=-6026937020915831338/

  /jaxb:globalBindings
  /jaxws:bindings
/jaxws:bindings

Regards
Jim


daniel.mfreitas wrote:



Hello. I want to use wsdl2java to generate the client stubs to be used
by
my
client web application. I am using Spring Web Flow and it requires that
objects used in the flow are Serializable.

I successfully generated Serializable classes using the following
bindings
file and Metro JAXWS RI implementation:

?xml version=1.0 encoding=UTF-8?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xmlns:jaxb=http://java.sun.com/xml/ns/jaxb;
xmlns:xjc=http://java.sun.com/xml/ns/jaxb/xjc;
elementFormDefault=qualified attributeFormDefault=unqualified
jaxb:extensionBindingPrefixes=xjc jaxb:version=1.0
xs:annotation
xs:appinfo
jaxb:globalBindings
xjc:serializable uid=-6026937020915831338/
/jaxb:globalBindings
/xs:appinfo
/xs:annotation
/xs:schema

But because of some limitations of Metro RI, we want to switch to CXF.
When
calling wsdl2java from a maven build file and we try to supply the
above
binding file, cfx throws

WSDLToJava Error : Unknown external binding files:

This is not a FileNotFoundError. wsdl2java does find the file, but it
seems
it does not understand its contents. I wanted to use CXF for everything
including java2wsdl and wsdl2java. We have bad experiences to set up
JAXWS
Metro RI and for some developers it is a pain to put it to work. 


So how can I make the entities stubs to implement serializable with
wsdl2java?