Re: Local transport is both up and down at the same time, sort of.

2008-04-10 Thread Willem Jiang

Hi Benson,

I am confused about the Webapp#2's log.

[java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.transport.local.LocalTransportFactory createDestination
[java] INFO: Creating destination for address
local://RosetteTextAnalyzer

It looks you create the same local transport destination in Webapp#2.

AFAIK , if your two application are in the same JVM , the local transport 
should work :)


Willem



Benson Margulies wrote:

Webapp #1 sets up a service, with an endpoint on the local transport.

  [java] INFO: Creating Service {urn:basistech.com:rta}RosetteTextAnalyzer
from class com.basistech.rta.ws.RosetteTextAnalyzer
 [java] Apr 9, 2008 9:10:55 PM org.apache.cxf.endpoint.ServerImpl
initDestination
 [java] INFO: Setting the server's publish address to be
local://RosetteTextAnalyzer

Webapp #2 sets up a client proxy, trying to talk to the same endpoint.
Unhappiness results. First, some diagnostic complaints from the RSFB while
creating the proxy (this is all JAXWS+JAXB) then we get the complaint that
no-one and nothing is listening. Will the local transport in fact work
across webapps? For that matter, are the complaints because all I've given
the proxy factory to work on is an interface, and it doesn't have param
names? I've been working inside CXF for so long that I'm pretty lost when I
just try to use it.

  [java] Apr 9, 2008 9:11:34 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
 [java] INFO: Creating Service
{urn:basistech.com:rta}RosetteTextAnalyzerService
from class com.basistech.rta.RosetteTextAnalyzer
 [java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
 [java] INFO: {urn:basistech.com:rta:v1.0}tokenResults part type QName
null.
 [java] {urn:basistech.com:rta:v1.0}languages part type QName null.
 [java] {urn:basistech.com:rta:v1.0}matches part type QName null.
 [java] {urn:basistech.com:rta:v1.0}glossaries part type QName null.
 [java]
 [java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.transport.local.LocalTransportFactory createDestination
 [java] INFO: Creating destination for address
local://RosetteTextAnalyzer
 [java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
 [java] INFO: Interceptor has thrown exception, unwinding now
 [java] java.lang.IllegalStateException: Local destination does not have
a MessageObserver on address local://RosetteTextAnalyzer

  




Transfer-encoding chunked

2008-04-10 Thread gbuys

Hi All,

I'm having an issue calling a webservice on MS IIS from JBoss 4.2.2 with
Apache CXF 2.0.4 client deployed in a Spring application.

The deployed service doesn't seem to support client calls from JBoss with
Transfer-encoding chunked in the request header.  Sometimes the service
system gives a response but most of the time it hangs or returns an error
message.  I've deployed exactly the same client code (generated with soapUI
using CXF 2.0.4.-incubator) in a stand alone program in Eclipse.  This
program sends requests to the service with a content-length specified in the
request header.  This works perfectly well, the IIS server quickly responds
and remains stable.

So it appears to me that JBoss is actually responsible for putting the
'Transfer-encoding chunked' in the header.  How can I reconfigure my JBoss
to send requests with fixed content length.  As a matter of fact, I think I
should configure that only the web service requests have content-length
specified.  All other requests/responses should remain chunked.

Or do I have to configure CXF or change my service client code to force the
requests having a content-length header?  I did some experiments with a
cxf-servlet.xml in my WEB-INF without succes (ip address replaced with x's):

beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:http-conf=http://cxf.apache.org/transports/http/configuration;
  
xsi:schemaLocation=http://cxf.apache.org/transports/http/configuration
   http://cxf.apache.org/schemas/configuration/http-conf.xsd
   http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans.xsd;

  http-conf:conduit 
  
name={http://xx.xx.xx.xx/Webservice_Server/}Webservice_Server.http-conduit;   
  http-conf:client AllowChunking=false/
  /http-conf:conduit
  http-conf:conduit 
  
name={http://localhost:8080/axis2/services/}Version.http-conduit;
  http-conf:client AllowChunking=false/
  /http-conf:conduit
  
/beans


Any help is greatly appreciated! 
(Of course, the guys on the web service side should find out why their IIS
becomes unstable, but i'd like to find out what i can change on the client
side as well...)


-- 
View this message in context: 
http://www.nabble.com/Transfer-encoding-chunked-tp16606556p16606556.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Local transport is both up and down at the same time, sort of.

2008-04-10 Thread Benson Margulies
I see your point. Maybe I made a cut-and-paste error and set up the service
factory instead of the proxy factory.

On Thu, Apr 10, 2008 at 4:14 AM, Willem Jiang [EMAIL PROTECTED]
wrote:

 Hi Benson,

 I am confused about the Webapp#2's log.

[java] Apr 9, 2008 9:11:35 PM
 org.apache.cxf.transport.local.LocalTransportFactory createDestination
[java] INFO: Creating destination for address
 local://RosetteTextAnalyzer

 It looks you create the same local transport destination in Webapp#2.

 AFAIK , if your two application are in the same JVM , the local transport
 should work :)


 Willem




 Benson Margulies wrote:

  Webapp #1 sets up a service, with an endpoint on the local transport.
 
   [java] INFO: Creating Service {urn:basistech.com:
  rta}RosetteTextAnalyzer
  from class com.basistech.rta.ws.RosetteTextAnalyzer
  [java] Apr 9, 2008 9:10:55 PM org.apache.cxf.endpoint.ServerImpl
  initDestination
  [java] INFO: Setting the server's publish address to be
  local://RosetteTextAnalyzer
 
  Webapp #2 sets up a client proxy, trying to talk to the same endpoint.
  Unhappiness results. First, some diagnostic complaints from the RSFB
  while
  creating the proxy (this is all JAXWS+JAXB) then we get the complaint
  that
  no-one and nothing is listening. Will the local transport in fact work
  across webapps? For that matter, are the complaints because all I've
  given
  the proxy factory to work on is an interface, and it doesn't have param
  names? I've been working inside CXF for so long that I'm pretty lost
  when I
  just try to use it.
 
   [java] Apr 9, 2008 9:11:34 PM
  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
  buildServiceFromClass
  [java] INFO: Creating Service
  {urn:basistech.com:rta}RosetteTextAnalyzerService
  from class com.basistech.rta.RosetteTextAnalyzer
  [java] Apr 9, 2008 9:11:35 PM
  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
  buildServiceFromClass
  [java] INFO: {urn:basistech.com:rta:v1.0}tokenResults part type
  QName
  null.
  [java] {urn:basistech.com:rta:v1.0}languages part type QName null.
  [java] {urn:basistech.com:rta:v1.0}matches part type QName null.
  [java] {urn:basistech.com:rta:v1.0}glossaries part type QName null.
  [java]
  [java] Apr 9, 2008 9:11:35 PM
  org.apache.cxf.transport.local.LocalTransportFactory createDestination
  [java] INFO: Creating destination for address
  local://RosetteTextAnalyzer
  [java] Apr 9, 2008 9:11:35 PM
  org.apache.cxf.phase.PhaseInterceptorChain doIntercept
  [java] INFO: Interceptor has thrown exception, unwinding now
  [java] java.lang.IllegalStateException: Local destination does not
  have
  a MessageObserver on address local://RosetteTextAnalyzer
 
 
 




Re: Transfer-encoding chunked

2008-04-10 Thread Glen Mazza
You seem to have done what I did[1, Step #8], but it is apparently not
working for you.  Perhaps the name field of the http-conf:conduit is
incorrect and hence CXF is not picking up the command.  Using
name=*.http-conduit as shown near the top here[2] might fix your
problem. 

HTH,
Glen

[1] http://www.jroller.com/gmazza/date/20070817
[2]
http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html

Am Donnerstag, den 10.04.2008, 03:03 -0700 schrieb gbuys: 
 Hi All,
 
 I'm having an issue calling a webservice on MS IIS from JBoss 4.2.2 with
 Apache CXF 2.0.4 client deployed in a Spring application.
 
 The deployed service doesn't seem to support client calls from JBoss with
 Transfer-encoding chunked in the request header.  Sometimes the service
 system gives a response but most of the time it hangs or returns an error
 message.  I've deployed exactly the same client code (generated with soapUI
 using CXF 2.0.4.-incubator) in a stand alone program in Eclipse.  This
 program sends requests to the service with a content-length specified in the
 request header.  This works perfectly well, the IIS server quickly responds
 and remains stable.
 
 So it appears to me that JBoss is actually responsible for putting the
 'Transfer-encoding chunked' in the header.  How can I reconfigure my JBoss
 to send requests with fixed content length.  As a matter of fact, I think I
 should configure that only the web service requests have content-length
 specified.  All other requests/responses should remain chunked.
 
 Or do I have to configure CXF or change my service client code to force the
 requests having a content-length header?  I did some experiments with a
 cxf-servlet.xml in my WEB-INF without succes (ip address replaced with x's):
 
 beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:http-conf=http://cxf.apache.org/transports/http/configuration;
   
 xsi:schemaLocation=http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd;
 
   http-conf:conduit 
   
 name={http://xx.xx.xx.xx/Webservice_Server/}Webservice_Server.http-conduit; 
   
   http-conf:client AllowChunking=false/
   /http-conf:conduit
   http-conf:conduit 
   
 name={http://localhost:8080/axis2/services/}Version.http-conduit;
   http-conf:client AllowChunking=false/
   /http-conf:conduit
   
 /beans
 
 
 Any help is greatly appreciated! 
 (Of course, the guys on the web service side should find out why their IIS
 becomes unstable, but i'd like to find out what i can change on the client
 side as well...)
 
 



Re: Transfer-encoding chunked

2008-04-10 Thread gbuys

OK, using wildcard *.http-conduit as the conduit name did the trick.   

I still don't see why the specified name doesn't work though...



gbuys wrote:
 
 Hi All,
 
 I'm having an issue calling a webservice on MS IIS from JBoss 4.2.2 with
 Apache CXF 2.0.4 client deployed in a Spring application.
 
 The deployed service doesn't seem to support client calls from JBoss with
 Transfer-encoding chunked in the request header.  Sometimes the service
 system gives a response but most of the time it hangs or returns an error
 message.  I've deployed exactly the same client code (generated with
 soapUI using CXF 2.0.4.-incubator) in a stand alone program in Eclipse. 
 This program sends requests to the service with a content-length specified
 in the request header.  This works perfectly well, the IIS server quickly
 responds and remains stable.
 
 So it appears to me that JBoss is actually responsible for putting the
 'Transfer-encoding chunked' in the header.  How can I reconfigure my JBoss
 to send requests with fixed content length.  As a matter of fact, I think
 I should configure that only the web service requests have content-length
 specified.  All other requests/responses should remain chunked.
 
 Or do I have to configure CXF or change my service client code to force
 the requests having a content-length header?  I did some experiments with
 a cxf.xml in my classpath without succes (ip address replaced with x's):
 
 beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   
 xmlns:http-conf=http://cxf.apache.org/transports/http/configuration;
   
 xsi:schemaLocation=http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd;
 
   http-conf:conduit 
   
 name={http://xx.xx.xx.xx/Webservice_Server/}Webservice_Server.http-conduit; 
   
   http-conf:client AllowChunking=false/
   /http-conf:conduit
   http-conf:conduit 
   
 name={http://localhost:8080/axis2/services/}Version.http-conduit;
   http-conf:client AllowChunking=false/
   /http-conf:conduit
   
 /beans
 
 
 Any help is greatly appreciated! 
 (Of course, the guys on the web service side should find out why their IIS
 becomes unstable, but i'd like to find out what i can change on the client
 side as well...)
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Transfer-encoding-chunked-tp16606556p16608370.html
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Local transport is both up and down at the same time, sort of.

2008-04-10 Thread Daniel Kulp
On Thursday 10 April 2008, Benson Margulies wrote:
 Willem,

 The log messages from RSFB are a bit confusing. Notice that the first
 set ends with a publish address and the second with a destination
 address.

 I'll go read the code, but now that I'm awake I can't imagine how the
 local transport would sneak across webapp class loader boundaries if
 no code is loaded into the system class loader.

Yea.  That probably won't work.   More over, I think the two need to 
share the same bus which makes it even harder to setup in different 
classloaders.

Dan



 --benson


 On Thu, Apr 10, 2008 at 7:34 AM, Benson Margulies
 [EMAIL PROTECTED]

 wrote:
  I see your point. Maybe I made a cut-and-paste error and set up the
  service factory instead of the proxy factory.
 
 
  On Thu, Apr 10, 2008 at 4:14 AM, Willem Jiang
  [EMAIL PROTECTED]
 
  wrote:
   Hi Benson,
  
   I am confused about the Webapp#2's log.
  
  [java] Apr 9, 2008 9:11:35 PM
   org.apache.cxf.transport.local.LocalTransportFactory
   createDestination [java] INFO: Creating destination for address
   local://RosetteTextAnalyzer
  
   It looks you create the same local transport destination in
   Webapp#2.
  
   AFAIK , if your two application are in the same JVM , the local
   transport should work :)
  
  
   Willem
  
   Benson Margulies wrote:
Webapp #1 sets up a service, with an endpoint on the local
transport.
   
 [java] INFO: Creating Service {urn:basistech.com:
rta}RosetteTextAnalyzer
from class com.basistech.rta.ws.RosetteTextAnalyzer
[java] Apr 9, 2008 9:10:55 PM
org.apache.cxf.endpoint.ServerImpl initDestination
[java] INFO: Setting the server's publish address to be
local://RosetteTextAnalyzer
   
Webapp #2 sets up a client proxy, trying to talk to the same
endpoint. Unhappiness results. First, some diagnostic complaints
from the RSFB while
creating the proxy (this is all JAXWS+JAXB) then we get the
complaint that
no-one and nothing is listening. Will the local transport in
fact work across webapps? For that matter, are the complaints
because all I've given
the proxy factory to work on is an interface, and it doesn't
have param
names? I've been working inside CXF for so long that I'm pretty
lost when I
just try to use it.
   
 [java] Apr 9, 2008 9:11:34 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
[java] INFO: Creating Service
{urn:basistech.com:rta}RosetteTextAnalyzerService
from class com.basistech.rta.RosetteTextAnalyzer
[java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
[java] INFO: {urn:basistech.com:rta:v1.0}tokenResults part
type QName
null.
[java] {urn:basistech.com:rta:v1.0}languages part type QName
null. [java] {urn:basistech.com:rta:v1.0}matches part type QName
null. [java] {urn:basistech.com:rta:v1.0}glossaries part type
QName null.
[java]
[java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.transport.local.LocalTransportFactory
createDestination [java] INFO: Creating destination for address
local://RosetteTextAnalyzer
[java] Apr 9, 2008 9:11:35 PM
org.apache.cxf.phase.PhaseInterceptorChain doIntercept
[java] INFO: Interceptor has thrown exception, unwinding now
[java] java.lang.IllegalStateException: Local destination
does not have
a MessageObserver on address local://RosetteTextAnalyzer



-- 
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog


xmlns problem

2008-04-10 Thread mmansoor

My SOAP message has an object Foo, which has a body type as anyType. I am
using JAXB to generate that anyType body.

Now when i look at the Message that is being generated, there is one extra
tag as :

ns4:Body xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:ns6=http://my.a.b.c.com/v1; xmlns= xsi:type=FooInner

Any idea how can i remove this extra [xmlns=] attribute ?.

Thanks
-- 
View this message in context: 
http://www.nabble.com/xmlns-problem-tp16617506p16617506.html
Sent from the cxf-user mailing list archive at Nabble.com.



JiBX and CXF

2008-04-10 Thread ron_honeyman

I noticed on the CXF Roadmap
(http://cwiki.apache.org/confluence/display/CXF/Roadmap) page it references
JiBX and the possiblility that it may be in version 2.1 or may slip to
version 2.2. I was curious if anyone could tell me if it has been included
with 2.1 or not? If it has is there any documentation I could look at for
integrating with it.

Thanks

Ron Honeyman

-- 
View this message in context: 
http://www.nabble.com/JiBX-and-CXF-tp16618817p16618817.html
Sent from the cxf-user mailing list archive at Nabble.com.



bi-directional relationships

2008-04-10 Thread Christopher . Mathrusse
I'm using CXF 2.0.5. My Web Service is as follows:
@WebService(endpointInterface = com.sybase.it.quoting.QuoteBroker, 
portName = QuoteBroker, targetNamespace = 
http://quoting.it.sybase.com;, name = QuoteBroker)
@SOAPBinding(parameterStyle = ParameterStyle.WRAPPED, style = 
Style.DOCUMENT, use = Use.LITERAL)
@Service(quoteBroker)
public abstract class QuoteBrokerImpl implements QuoteBroker ...


I am returning DTO's from my web service that are populated with data from 
my Hibernate objects. The problem that I am running into now is the 
following exception:

INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: A cycle is detected 
in the object graph. This will cause infinitely deep XML: 
[EMAIL PROTECTED] - 
[EMAIL PROTECTED] - 
[EMAIL PROTECTED]

This is due to the relationship that is defined.  Quote - QuoteLineItem 
- Quote
Because the relationship is bi-directional I am seeing this exception 
occurring. The Web Service is a replacement of an old Axis 1.0 RPC/Encoded 
web service. Now that I have it running with CXF using 
Document/Literal/Wrapped I am seeing this issue. 

How have others resolved/worked around this issue?

Thanks...

Chris Mathrusse
[EMAIL PROTECTED]
Sybase, Inc
One Sybase Drive
Dublin, CA 94568
(925) 236-5553

Re: bi-directional relationships

2008-04-10 Thread Glen Mazza
Here you go:
https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html

Glen

Am Donnerstag, den 10.04.2008, 16:12 -0700 schrieb
[EMAIL PROTECTED]:
 I'm using CXF 2.0.5. My Web Service is as follows:
 @WebService(endpointInterface = com.sybase.it.quoting.QuoteBroker, 
 portName = QuoteBroker, targetNamespace = 
 http://quoting.it.sybase.com;, name = QuoteBroker)
 @SOAPBinding(parameterStyle = ParameterStyle.WRAPPED, style = 
 Style.DOCUMENT, use = Use.LITERAL)
 @Service(quoteBroker)
 public abstract class QuoteBrokerImpl implements QuoteBroker ...
 
 
 I am returning DTO's from my web service that are populated with data from 
 my Hibernate objects. The problem that I am running into now is the 
 following exception:
 
 INFO: Interceptor has thrown exception, unwinding now
 org.apache.cxf.interceptor.Fault: Marshalling Error: A cycle is detected 
 in the object graph. This will cause infinitely deep XML: 
 [EMAIL PROTECTED] - 
 [EMAIL PROTECTED] - 
 [EMAIL PROTECTED]
 
 This is due to the relationship that is defined.  Quote - QuoteLineItem 
 - Quote
 Because the relationship is bi-directional I am seeing this exception 
 occurring. The Web Service is a replacement of an old Axis 1.0 RPC/Encoded 
 web service. Now that I have it running with CXF using 
 Document/Literal/Wrapped I am seeing this issue. 
 
 How have others resolved/worked around this issue?
 
 Thanks...
 
 Chris Mathrusse
 [EMAIL PROTECTED]
 Sybase, Inc
 One Sybase Drive
 Dublin, CA 94568
 (925) 236-5553



Re: JiBX and CXF

2008-04-10 Thread Glen Mazza
I wouldn't say it looks very good for JiBX support--I have not heard
much demand for it lately on this list.  Axis2 has it I believe, and
Spring Web Services may be another option for you.

Glen

Am Donnerstag, den 10.04.2008, 14:46 -0700 schrieb ron_honeyman:
 I noticed on the CXF Roadmap
 (http://cwiki.apache.org/confluence/display/CXF/Roadmap) page it references
 JiBX and the possiblility that it may be in version 2.1 or may slip to
 version 2.2. I was curious if anyone could tell me if it has been included
 with 2.1 or not? If it has is there any documentation I could look at for
 integrating with it.
 
 Thanks
 
 Ron Honeyman
 



Re: Problems resolving schemas using http, when wsdl is in a jar

2008-04-10 Thread Glen Mazza
Am Donnerstag, den 10.04.2008, 23:08 +0200 schrieb
[EMAIL PROTECTED]:

 It works just fine until I realize that I want to import XSD schemas
 in my
 WSDLs to allow validation of the SOAP requests.
 Now, I have several webservices sharing XSDs (one entity model for
 several
 services and so on) so I don't want to package the XSDs in the JAR
 that
 contains the implementation code and the WSDL for the actual service.

I would reconsider.  Just because the XSDs are there does not mean that
you have to maintain them in separate places, only that they need to get
copied there when you create the WAR file.  It would certainly speed
things up and reduce network traffic, no?  Since it's on localhost
(i.e., your Tomcat server) already, perhaps you can make a file system
or JAR reference anyway.

JSR-109[1] recommends placing the WSDLs and XSDs in the WEB-INF/wsdl
directory, in Section 8.2.5, Publishing the Deployed WSDL:  The
recommended practice is to place WSDL files referenced by a wsdlLocation
element in the Web service annotations or wsdl-
file element and their relative imported documents under the
[WEB-INF/]wsdl directory.

Further, section 4.2.12 of JSR-109 also suggests that you should be
using OASIS XML Catalogs for XSDs URI resolution.  They refer you to
Section 4.4 of the JAX-WS specification[2], which AFAICT mandates that
JAX-WS implementations like CXF send URI resolution first through the
catalog if present.

[1] http://jcp.org/aboutJava/communityprocess/mrel/jsr109/index.html
[2] http://jcp.org/en/jsr/detail?id=224



 This method totally ignores that my URI starts with 'http' it just
 assumes a
 JAR, CLASSPATH or FILESYSTEM path. This seems kind of silly? Any URL should
 be possible to resolve? 

You can check if Metro performs more to your liking in this regard:
http://www.jroller.com/gmazza/date/20071019 (I don't know personally,
I've never tested this.)

Keep in mind, a direct http:// resolution might be burdensome to
external servers not related to your company.  If I have an
EmployeeData.xsd that I have downloadable from my site, I would want you
to download it *once* and place it on your machine, not hit my machine
everytime someone requests your WSDL.  A server can't rely on everyone
properly using caching.

Regards,
Glen




Re: bi-directional relationships

2008-04-10 Thread Christopher . Mathrusse
Glen, 

Thanks ever so much! This is exactly what I needed to further my 
understanding. 

You Da Man!!!

Chris Mathrusse
[EMAIL PROTECTED]
Sybase, Inc
One Sybase Drive
Dublin, CA 94568
(925) 236-5553



Glen Mazza [EMAIL PROTECTED] 
04/10/2008 06:13 PM
Please respond to
cxf-user@incubator.apache.org


To
cxf-user@incubator.apache.org
cc

Subject
Re: bi-directional relationships






Here you go:
https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html

Glen

Am Donnerstag, den 10.04.2008, 16:12 -0700 schrieb
[EMAIL PROTECTED]:
 I'm using CXF 2.0.5. My Web Service is as follows:
 @WebService(endpointInterface = com.sybase.it.quoting.QuoteBroker, 
 portName = QuoteBroker, targetNamespace = 
 http://quoting.it.sybase.com;, name = QuoteBroker)
 @SOAPBinding(parameterStyle = ParameterStyle.WRAPPED, style = 
 Style.DOCUMENT, use = Use.LITERAL)
 @Service(quoteBroker)
 public abstract class QuoteBrokerImpl implements QuoteBroker ...
 
 
 I am returning DTO's from my web service that are populated with data 
from 
 my Hibernate objects. The problem that I am running into now is the 
 following exception:
 
 INFO: Interceptor has thrown exception, unwinding now
 org.apache.cxf.interceptor.Fault: Marshalling Error: A cycle is detected 

 in the object graph. This will cause infinitely deep XML: 
 [EMAIL PROTECTED] - 
 [EMAIL PROTECTED] - 
 [EMAIL PROTECTED]
 
 This is due to the relationship that is defined.  Quote - QuoteLineItem 

 - Quote
 Because the relationship is bi-directional I am seeing this exception 
 occurring. The Web Service is a replacement of an old Axis 1.0 
RPC/Encoded 
 web service. Now that I have it running with CXF using 
 Document/Literal/Wrapped I am seeing this issue. 
 
 How have others resolved/worked around this issue?
 
 Thanks...
 
 Chris Mathrusse
 [EMAIL PROTECTED]
 Sybase, Inc
 One Sybase Drive
 Dublin, CA 94568
 (925) 236-5553





Problems resolving schemas using http, when wsdl is in a jar

2008-04-10 Thread Peter.Liljenberg
Hi,

I'm writing some code that will allow me to deploy webservices that has been
setup as ServicePoints in Hivemind. This way I can build components (JARs)
with the webservice that I want to deploy and just add them to the classpath
of my WAR project and they will deployed. No need to configure everything in
one xml file, distributed configuration (maybe something to commit back to
CXF when I'm done?).
It works just fine until I realize that I want to import XSD schemas in my
WSDLs to allow validation of the SOAP requests.
Now, I have several webservices sharing XSDs (one entity model for several
services and so on) so I don't want to package the XSDs in the JAR that
contains the implementation code and the WSDL for the actual service. I add
an import for a external resource in my test.wsdl:

xsd:import . schemaLocation=http://localhost/entities/user.xsd; /

Generating Java code with WSDL2JAVA works fine, and I set the @Webservice
annotation accordingly (wsdlLocation=schemas/service/test.wsdl), the WSDL
will reside in the JAR file that is built with the service code, the XSDs
are NOT, they reside on a server (in this case localhost).
Now, when I deploy my WAR file containing the JAR I get an error (removing
the wsdlLocation from the Webservice annotation - thus building service from
SEI instead of WSDL - will work just fine, but then I lose the validation!)
like this:

...XMLSchemaException: Unable to locate imported document at
'http://localhost/entities/user.xsd', relative to
'jar:file://.../warfile.war/WEB-INF/lib/test.jar!/schemas/services/test.
wsdl'.
at
org.apache.cxf.catalog.CatalogXMLSchemaURIResolver.resolveEntity(CatalogXMLS
chemaURIResolver.java:71).

Digging down in the code we end up in the ExtendedURIResolver.resolve (line
42) that makes a call to resolve in
org.apache.cxf.resource.URIResolver.resolve.
This method totally ignores that my URI starts with 'http' it just assumes a
JAR, CLASSPATH or FILESYSTEM path. This seems kind of silly? Any URL should
be possible to resolve? If I change the baseUriStr (jar:file://) -
removing the 'jar:' when debugging I can get it to work since then I end up
in the tryFileSystem method which actually can resolve a HTTP URL, I'm
thinking that this should be tried if JAR resolving fails? Or maybe even
before JAR resolving?
What do you think? Should I file this as an JIRA issues? I feel it's a bug,
easy to fix as well, and would to get it fixed in the next release of CXF.


Regards,
Peter

 


smime.p7s
Description: S/MIME cryptographic signature