You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by yannick <ya...@gmail.com> on 2011/09/07 23:46:53 UTC

java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Hi, I receive the following the exception and tried several Xmlschema
versions and always receive this errors. I tried version 1.3.1, 1.4.2,
1.4.5. 

java.lang.NoSuchMethodError:
org.apache.ws.commons.schema.XmlSchemaForm.getValue()Ljava/lang/String;
	at org.apache.cxf.service.model.SchemaInfo.setSchema(SchemaInfo.java:146)
	at org.apache.cxf.wsdl11.SchemaUtil.extractSchema(SchemaUtil.java:136)
	at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:73)
	at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:65)
	at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:60)
	at
org.apache.cxf.wsdl11.WSDLServiceBuilder.getSchemas(WSDLServiceBuilder.java:357)
	at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:324)
	at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:188)
	at
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:129)
	at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:408)
	at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:521)
	at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:271)
	at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:177)
	at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
	at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
	at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
	at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
	at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:439)
	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:316)
	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:303)
	at javax.xml.ws.Service.getPort(Service.java:92)

Someone any ideas? 

Thanks in advance.

Yannick

--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-commons-schema-XmlSchemaForm-tp4780240p4780240.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday, September 08, 2011 1:21:46 AM yannick wrote:
> I'm using cxf 2.2.5. I debugged it and I noticed that he goes in the
> cxf-api-2.2.5 jar and not in the xmlschema-core 2.0 jar. Is cxf-api necssary
> as jar?

With that old of a version of CXF, you would need XmlSchema 1.4.x, not the 2.0 
version.   I would strongly suggest updating to CXF 2.4.2 as CXF 2.2.x is no 
longer supported or maintained.


Dan

> 
> 
> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-c
> ommons-schema-XmlSchemaForm-tp4780240p4781679.html Sent from the cxf-user
> mailing list archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by yannick <ya...@gmail.com>.
Everyone thanks for the help my client works :)

--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-commons-schema-XmlSchemaForm-tp4780240p4782897.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by yannick <ya...@gmail.com>.
Dan, I updated to 2.4.2 like you recommended and it solved the problem. Know
I'm on the next error: 
No signature username found. 

--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-commons-schema-XmlSchemaForm-tp4780240p4782590.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday, September 08, 2011 6:07:15 AM yannick wrote:
> Can someone tell me where I can find the WHICH_JARS file?

In the lib directory of the CXF kit download.

Dan


> 
> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-c
> ommons-schema-XmlSchemaForm-tp4780240p4782341.html Sent from the cxf-user
> mailing list archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by yannick <ya...@gmail.com>.
I'm using cxf 2.2.5. I debugged it and I noticed that he goes in the
cxf-api-2.2.5 jar and not in the xmlschema-core 2.0 jar. Is cxf-api necssary
as jar?




--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-commons-schema-XmlSchemaForm-tp4780240p4781679.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by yannick <ya...@gmail.com>.
Can someone tell me where I can find the WHICH_JARS file?



--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-commons-schema-XmlSchemaForm-tp4780240p4782341.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by Benson Margulies <bi...@gmail.com>.
Yes, that's what I meant. What version of CXF? Have you looked at the
WHICH_JARS file? Are you sure you only have one xmlschema jar?

On Wed, Sep 7, 2011 at 6:34 PM, yannick <ya...@gmail.com> wrote:
> Thank you for your reply.
>
> I looked for the xmlschema 2.0 and didn't find it. Do you mean
> xmlschema-core 2.0? I already tried and I received the same result.
>
> The SchemaInfo.class fails on this line:
> isElementQualified =
> schema.getElementFormDefault().getValue().equals(XmlSchemaForm.QUALIFIED);
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-commons-schema-XmlSchemaForm-tp4780240p4780372.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

jaxws Dispatch doesn't allow override of outbound ws addressing headers

Posted by Jesse Pangburn <Je...@us.lawson.com>.
Similar to the recent problem with jaxws Provider, the jaxws Dispatch doesn't allow override of outbound ws addressing headers either.  I tried setting with the following code:
AddressingProperties wsaClient = new AddressingPropertiesImpl();
// snipped out properties setting
// attach these properties to the outbound message object
disp.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, wsaClient);

The problem appears to be in the ContextUtils file again with these lines:
String mapProperty =
    ContextUtils.getMAPProperty(isProviderContext, 
                                isRequestor,
                                isOutbound);
LOG.log(Level.FINE,
        "retrieving MAPs from context property {0}",
        mapProperty);
AddressingPropertiesImpl maps =
    (AddressingPropertiesImpl)message.get(mapProperty);

The first time through this method we have isProviderContext==true, isRequestor==true, and isOutbound==true.  So mapProperty gets set to "javax.xml.ws.addressing.context" but the override data is stored in "javax.xml.ws.addressing.context.outbound" (because of the way I called it).  This is due to the following lookup code (also in ContextUtils):
public static String getMAPProperty(boolean isRequestor, 
                                boolean isProviderContext,
                                boolean isOutbound) {
return isRequestor
        ? isProviderContext
         ? CLIENT_ADDRESSING_PROPERTIES
         : isOutbound
           ? CLIENT_ADDRESSING_PROPERTIES_OUTBOUND
           : CLIENT_ADDRESSING_PROPERTIES_INBOUND
       : isOutbound
         ? SERVER_ADDRESSING_PROPERTIES_OUTBOUND
         : SERVER_ADDRESSING_PROPERTIES_INBOUND;
}

In this case isRequest and isProviderContext are true, so we end up with CLIENT_ADDRESSING_PROPERTIES instead of CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.

Perhaps the problem is my understanding as this will work fine if I change my code to:
disp.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, wsaClient);

It just seems inconsistent to me to override the server side addressing properties by setting JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND but then for the client to have CLIENT_ADDRESSING_PROPERTIES_OUTBOUND be wrong and instead require CLIENT_ADDRESSING_PROPERTIES.  Am I just misunderstanding, or is this actually implemented wrong?  If it's wrong, is the fix to change getMAPProperty to:
return isRequestor
        ? isOutbound
         ? CLIENT_ADDRESSING_PROPERTIES_OUTBOUND
         : isProviderContext
         ? CLIENT_ADDRESSING_PROPERTIES
         : CLIENT_ADDRESSING_PROPERTIES_INBOUND
       : isOutbound
         ? SERVER_ADDRESSING_PROPERTIES_OUTBOUND
         : SERVER_ADDRESSING_PROPERTIES_INBOUND;

Or will that break something else?

Thanks,
Jesse


RE: jaxws Provider doesn't allow override of outbound ws addressing headers

Posted by Jesse Pangburn <Je...@us.lawson.com>.
This is now tracked as issue: https://issues.apache.org/jira/browse/CXF-3802

Thanks,
Jesse

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Monday, September 12, 2011 12:11 PM
To: Jesse Pangburn
Cc: users@cxf.apache.org
Subject: Re: jaxws Provider doesn't allow override of outbound ws addressing headers

On Monday, September 12, 2011 2:09:13 PM Jesse Pangburn wrote:
> Hi Dan,
> Great!  That worked with the expected messageContext.put() after changing
> this line in your patch to: maps =
> (AddressingPropertiesImpl)message.getExchange().getInMessage().get(mapPrope
> rty);
> 
> For obvious reasons :-)  Thanks so much!  It's much better from the user
> point of view this way.
> 
> Do you want me to create an issue in Jira or you already are taking care of
> that?

Please do so so I don't forget about it.

Thanks!
Dan



> Thanks,
> Jesse
> 
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Friday, September 09, 2011 2:13 PM
> To: users@cxf.apache.org
> Cc: Jesse Pangburn
> Subject: Re: jaxws Provider doesn't allow override of outbound ws addressing
> headers
> 
> 
> This might be a simple enhancement request.   Are you able to build CXF
> source and test?    I think a simple change like:
> 
> ---
> a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
> +++
> b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
> @@ -279,6 +279,9 @@ public final class ContextUtils {
>                  mapProperty);
>          AddressingPropertiesImpl maps =
>              (AddressingPropertiesImpl)message.get(mapProperty);
> +        if (maps == null && isOutbound && !isRequestor) {
> +            message.getExchange().getInMessage().get(mapProperty);
> +        }
>          if (maps != null) {
>              LOG.log(Level.FINE, "current MAPs {0}", maps);
>          } else if (!isProviderContext) {
> 
> 
> would work in this case.    Basically, on the outbound server side, if the
> message doesn't have the map with the key, check the inbound message (where
> the JAX-WS context would have stored it).
> 
> Dan
> 
> On Wednesday, September 07, 2011 9:26:31 PM Jesse Pangburn wrote:
> > Debugging through the code illustrates that you can't just set this
> > property on the MessageContext object for the Provider, you must set it
> > on the outbound message object, like this:
> > ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).get
> > Wra
> > ppedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_
> > ADDRE SSING_PROPERTIES_OUTBOUND, wsaServer);
> > 
> > So the working code for me becomes something like:
> > AddressingProperties wsaServer = new AddressingPropertiesImpl();
> > AttributedURIType aut = new AttributedURIType();
> > aut.setValue("urn:get:some");
> > wsaServer.setAction(aut);
> > ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).get
> > Wrap
> > pedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_A
> > DDRES SING_PROPERTIES_OUTBOUND, wsaServer);
> > 
> > I've tried overriding the message id and the action headers, both were
> > successful.  Still, I'm wondering if it's a bug to have to jump through
> > all these hoops to set that on the outbound message.  Shouldn't it
> > inherit from the MessageContext or something?  The outbound message
> > seems to get the inbound addressing properties assigned just fine.
> > 
> > Thanks,
> > Jesse
> > 
> > -----Original Message-----
> > From: Jesse Pangburn [mailto:Jesse.Pangburn@us.lawson.com]
> > Sent: Wednesday, September 07, 2011 5:24 PM
> > To: users@cxf.apache.org
> > Subject: jaxws Provider doesn't allow override of outbound ws addressing
> > headers
> > 
> > Hi,
> > I have a jaxws Provider configured to do WS-Addressing and the defaults
> > seem to work fine.  However, if I try to override some of the
> > WS-Addressing headers in the MessageContext, it gets ignored.  I've
> > tried the following :
> > 
> > AddressingProperties wsaServer = new AddressingPropertiesImpl();
> > AttributedURIType aut = new AttributedURIType();
> > aut.setValue("urn:get:some");
> > wsaServer.setAction(aut);
> > messageContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND
> > ,
> > wsaServer);
> > 
> > But the Action header sent in the response is the default from the WSDL,
> > not my override value.  Am I doing something wrong or this never
> > worked?  I've tried doing:
> > messageContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND
> > )
> > 
> > But that returns null, so I've been using the put instead.  I tried
> > overriding the messageId as well, but that didn't work either.
> > 
> > Thanks,
> > Jesse
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com



Re: jaxws Provider doesn't allow override of outbound ws addressing headers

Posted by Daniel Kulp <dk...@apache.org>.
On Monday, September 12, 2011 2:09:13 PM Jesse Pangburn wrote:
> Hi Dan,
> Great!  That worked with the expected messageContext.put() after changing
> this line in your patch to: maps =
> (AddressingPropertiesImpl)message.getExchange().getInMessage().get(mapPrope
> rty);
> 
> For obvious reasons :-)  Thanks so much!  It's much better from the user
> point of view this way.
> 
> Do you want me to create an issue in Jira or you already are taking care of
> that?

Please do so so I don't forget about it.

Thanks!
Dan



> Thanks,
> Jesse
> 
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Friday, September 09, 2011 2:13 PM
> To: users@cxf.apache.org
> Cc: Jesse Pangburn
> Subject: Re: jaxws Provider doesn't allow override of outbound ws addressing
> headers
> 
> 
> This might be a simple enhancement request.   Are you able to build CXF
> source and test?    I think a simple change like:
> 
> ---
> a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
> +++
> b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
> @@ -279,6 +279,9 @@ public final class ContextUtils {
>                  mapProperty);
>          AddressingPropertiesImpl maps =
>              (AddressingPropertiesImpl)message.get(mapProperty);
> +        if (maps == null && isOutbound && !isRequestor) {
> +            message.getExchange().getInMessage().get(mapProperty);
> +        }
>          if (maps != null) {
>              LOG.log(Level.FINE, "current MAPs {0}", maps);
>          } else if (!isProviderContext) {
> 
> 
> would work in this case.    Basically, on the outbound server side, if the
> message doesn't have the map with the key, check the inbound message (where
> the JAX-WS context would have stored it).
> 
> Dan
> 
> On Wednesday, September 07, 2011 9:26:31 PM Jesse Pangburn wrote:
> > Debugging through the code illustrates that you can't just set this
> > property on the MessageContext object for the Provider, you must set it
> > on the outbound message object, like this:
> > ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).get
> > Wra
> > ppedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_
> > ADDRE SSING_PROPERTIES_OUTBOUND, wsaServer);
> > 
> > So the working code for me becomes something like:
> > AddressingProperties wsaServer = new AddressingPropertiesImpl();
> > AttributedURIType aut = new AttributedURIType();
> > aut.setValue("urn:get:some");
> > wsaServer.setAction(aut);
> > ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).get
> > Wrap
> > pedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_A
> > DDRES SING_PROPERTIES_OUTBOUND, wsaServer);
> > 
> > I've tried overriding the message id and the action headers, both were
> > successful.  Still, I'm wondering if it's a bug to have to jump through
> > all these hoops to set that on the outbound message.  Shouldn't it
> > inherit from the MessageContext or something?  The outbound message
> > seems to get the inbound addressing properties assigned just fine.
> > 
> > Thanks,
> > Jesse
> > 
> > -----Original Message-----
> > From: Jesse Pangburn [mailto:Jesse.Pangburn@us.lawson.com]
> > Sent: Wednesday, September 07, 2011 5:24 PM
> > To: users@cxf.apache.org
> > Subject: jaxws Provider doesn't allow override of outbound ws addressing
> > headers
> > 
> > Hi,
> > I have a jaxws Provider configured to do WS-Addressing and the defaults
> > seem to work fine.  However, if I try to override some of the
> > WS-Addressing headers in the MessageContext, it gets ignored.  I've
> > tried the following :
> > 
> > AddressingProperties wsaServer = new AddressingPropertiesImpl();
> > AttributedURIType aut = new AttributedURIType();
> > aut.setValue("urn:get:some");
> > wsaServer.setAction(aut);
> > messageContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND
> > ,
> > wsaServer);
> > 
> > But the Action header sent in the response is the default from the WSDL,
> > not my override value.  Am I doing something wrong or this never
> > worked?  I've tried doing:
> > messageContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND
> > )
> > 
> > But that returns null, so I've been using the put instead.  I tried
> > overriding the messageId as well, but that didn't work either.
> > 
> > Thanks,
> > Jesse
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

RE: jaxws Provider doesn't allow override of outbound ws addressing headers

Posted by Jesse Pangburn <Je...@us.lawson.com>.
Hi Dan,
Great!  That worked with the expected messageContext.put() after changing this line in your patch to:
maps = (AddressingPropertiesImpl)message.getExchange().getInMessage().get(mapProperty);

For obvious reasons :-)  Thanks so much!  It's much better from the user point of view this way.

Do you want me to create an issue in Jira or you already are taking care of that?

Thanks,
Jesse

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Friday, September 09, 2011 2:13 PM
To: users@cxf.apache.org
Cc: Jesse Pangburn
Subject: Re: jaxws Provider doesn't allow override of outbound ws addressing headers


This might be a simple enhancement request.   Are you able to build CXF source 
and test?    I think a simple change like:

--- a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
+++ b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
@@ -279,6 +279,9 @@ public final class ContextUtils {
                 mapProperty);
         AddressingPropertiesImpl maps =
             (AddressingPropertiesImpl)message.get(mapProperty);
+        if (maps == null && isOutbound && !isRequestor) {
+            message.getExchange().getInMessage().get(mapProperty);
+        }
         if (maps != null) {
             LOG.log(Level.FINE, "current MAPs {0}", maps);
         } else if (!isProviderContext) {


would work in this case.    Basically, on the outbound server side, if the 
message doesn't have the map with the key, check the inbound message (where 
the JAX-WS context would have stored it).

Dan



On Wednesday, September 07, 2011 9:26:31 PM Jesse Pangburn wrote:
> Debugging through the code illustrates that you can't just set this property
> on the MessageContext object for the Provider, you must set it on the
> outbound message object, like this:
> ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).getWra
> ppedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_ADDRE
> SSING_PROPERTIES_OUTBOUND, wsaServer);
> 
> So the working code for me becomes something like:
> AddressingProperties wsaServer = new AddressingPropertiesImpl();
> AttributedURIType aut = new AttributedURIType();
> aut.setValue("urn:get:some");
> wsaServer.setAction(aut);
> ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).getWrap
> pedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_ADDRES
> SING_PROPERTIES_OUTBOUND, wsaServer);
> 
> I've tried overriding the message id and the action headers, both were
> successful.  Still, I'm wondering if it's a bug to have to jump through all
> these hoops to set that on the outbound message.  Shouldn't it inherit from
> the MessageContext or something?  The outbound message seems to get the
> inbound addressing properties assigned just fine.
> 
> Thanks,
> Jesse
> 
> -----Original Message-----
> From: Jesse Pangburn [mailto:Jesse.Pangburn@us.lawson.com]
> Sent: Wednesday, September 07, 2011 5:24 PM
> To: users@cxf.apache.org
> Subject: jaxws Provider doesn't allow override of outbound ws addressing
> headers
> 
> Hi,
> I have a jaxws Provider configured to do WS-Addressing and the defaults seem
> to work fine.  However, if I try to override some of the WS-Addressing
> headers in the MessageContext, it gets ignored.  I've tried the following :
> 
> AddressingProperties wsaServer = new AddressingPropertiesImpl();
> AttributedURIType aut = new AttributedURIType();
> aut.setValue("urn:get:some");
> wsaServer.setAction(aut);
> messageContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND,
> wsaServer);
> 
> But the Action header sent in the response is the default from the WSDL, not
> my override value.  Am I doing something wrong or this never worked?  I've
> tried doing:
> messageContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND)
> 
> But that returns null, so I've been using the put instead.  I tried
> overriding the messageId as well, but that didn't work either.
> 
> Thanks,
> Jesse
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com



Re: jaxws Provider doesn't allow override of outbound ws addressing headers

Posted by Daniel Kulp <dk...@apache.org>.
This might be a simple enhancement request.   Are you able to build CXF source 
and test?    I think a simple change like:

--- a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
+++ b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
@@ -279,6 +279,9 @@ public final class ContextUtils {
                 mapProperty);
         AddressingPropertiesImpl maps =
             (AddressingPropertiesImpl)message.get(mapProperty);
+        if (maps == null && isOutbound && !isRequestor) {
+            message.getExchange().getInMessage().get(mapProperty);
+        }
         if (maps != null) {
             LOG.log(Level.FINE, "current MAPs {0}", maps);
         } else if (!isProviderContext) {


would work in this case.    Basically, on the outbound server side, if the 
message doesn't have the map with the key, check the inbound message (where 
the JAX-WS context would have stored it).

Dan



On Wednesday, September 07, 2011 9:26:31 PM Jesse Pangburn wrote:
> Debugging through the code illustrates that you can't just set this property
> on the MessageContext object for the Provider, you must set it on the
> outbound message object, like this:
> ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).getWra
> ppedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_ADDRE
> SSING_PROPERTIES_OUTBOUND, wsaServer);
> 
> So the working code for me becomes something like:
> AddressingProperties wsaServer = new AddressingPropertiesImpl();
> AttributedURIType aut = new AttributedURIType();
> aut.setValue("urn:get:some");
> wsaServer.setAction(aut);
> ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).getWrap
> pedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_ADDRES
> SING_PROPERTIES_OUTBOUND, wsaServer);
> 
> I've tried overriding the message id and the action headers, both were
> successful.  Still, I'm wondering if it's a bug to have to jump through all
> these hoops to set that on the outbound message.  Shouldn't it inherit from
> the MessageContext or something?  The outbound message seems to get the
> inbound addressing properties assigned just fine.
> 
> Thanks,
> Jesse
> 
> -----Original Message-----
> From: Jesse Pangburn [mailto:Jesse.Pangburn@us.lawson.com]
> Sent: Wednesday, September 07, 2011 5:24 PM
> To: users@cxf.apache.org
> Subject: jaxws Provider doesn't allow override of outbound ws addressing
> headers
> 
> Hi,
> I have a jaxws Provider configured to do WS-Addressing and the defaults seem
> to work fine.  However, if I try to override some of the WS-Addressing
> headers in the MessageContext, it gets ignored.  I've tried the following :
> 
> AddressingProperties wsaServer = new AddressingPropertiesImpl();
> AttributedURIType aut = new AttributedURIType();
> aut.setValue("urn:get:some");
> wsaServer.setAction(aut);
> messageContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND,
> wsaServer);
> 
> But the Action header sent in the response is the default from the WSDL, not
> my override value.  Am I doing something wrong or this never worked?  I've
> tried doing:
> messageContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND)
> 
> But that returns null, so I've been using the put instead.  I tried
> overriding the messageId as well, but that didn't work either.
> 
> Thanks,
> Jesse
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

RE: jaxws Provider doesn't allow override of outbound ws addressing headers

Posted by Jesse Pangburn <Je...@us.lawson.com>.
Debugging through the code illustrates that you can't just set this property on the MessageContext object for the Provider, you must set it on the outbound message object, like this:
((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).getWrappedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, wsaServer);

So the working code for me becomes something like:
AddressingProperties wsaServer = new AddressingPropertiesImpl();
AttributedURIType aut = new AttributedURIType();
aut.setValue("urn:get:some");
wsaServer.setAction(aut);
((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).getWrappedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, wsaServer);

I've tried overriding the message id and the action headers, both were successful.  Still, I'm wondering if it's a bug to have to jump through all these hoops to set that on the outbound message.  Shouldn't it inherit from the MessageContext or something?  The outbound message seems to get the inbound addressing properties assigned just fine.

Thanks,
Jesse

-----Original Message-----
From: Jesse Pangburn [mailto:Jesse.Pangburn@us.lawson.com] 
Sent: Wednesday, September 07, 2011 5:24 PM
To: users@cxf.apache.org
Subject: jaxws Provider doesn't allow override of outbound ws addressing headers

Hi,
I have a jaxws Provider configured to do WS-Addressing and the defaults seem to work fine.  However, if I try to override some of the WS-Addressing headers in the MessageContext, it gets ignored.  I've tried the following :

AddressingProperties wsaServer = new AddressingPropertiesImpl();
AttributedURIType aut = new AttributedURIType();
aut.setValue("urn:get:some");
wsaServer.setAction(aut);
messageContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, wsaServer);

But the Action header sent in the response is the default from the WSDL, not my override value.  Am I doing something wrong or this never worked?  I've tried doing:
messageContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND)

But that returns null, so I've been using the put instead.  I tried overriding the messageId as well, but that didn't work either.

Thanks,
Jesse




jaxws Provider doesn't allow override of outbound ws addressing headers

Posted by Jesse Pangburn <Je...@us.lawson.com>.
Hi,
I have a jaxws Provider configured to do WS-Addressing and the defaults seem to work fine.  However, if I try to override some of the WS-Addressing headers in the MessageContext, it gets ignored.  I've tried the following :

AddressingProperties wsaServer = new AddressingPropertiesImpl();
AttributedURIType aut = new AttributedURIType();
aut.setValue("urn:get:some");
wsaServer.setAction(aut);
messageContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, wsaServer);

But the Action header sent in the response is the default from the WSDL, not my override value.  Am I doing something wrong or this never worked?  I've tried doing:
messageContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND)

But that returns null, so I've been using the put instead.  I tried overriding the messageId as well, but that didn't work either.

Thanks,
Jesse


Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by yannick <ya...@gmail.com>.
Thank you for your reply.

I looked for the xmlschema 2.0 and didn't find it. Do you mean
xmlschema-core 2.0? I already tried and I received the same result. 

The SchemaInfo.class fails on this line:  
isElementQualified =
schema.getElementFormDefault().getValue().equals(XmlSchemaForm.QUALIFIED);





--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-commons-schema-XmlSchemaForm-tp4780240p4780372.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaForm...

Posted by Benson Margulies <bi...@gmail.com>.
You need 2.0.

On Wed, Sep 7, 2011 at 5:46 PM, yannick <ya...@gmail.com> wrote:
> Hi, I receive the following the exception and tried several Xmlschema
> versions and always receive this errors. I tried version 1.3.1, 1.4.2,
> 1.4.5.
>
> java.lang.NoSuchMethodError:
> org.apache.ws.commons.schema.XmlSchemaForm.getValue()Ljava/lang/String;
>        at org.apache.cxf.service.model.SchemaInfo.setSchema(SchemaInfo.java:146)
>        at org.apache.cxf.wsdl11.SchemaUtil.extractSchema(SchemaUtil.java:136)
>        at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:73)
>        at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:65)
>        at org.apache.cxf.wsdl11.SchemaUtil.getSchemas(SchemaUtil.java:60)
>        at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.getSchemas(WSDLServiceBuilder.java:357)
>        at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:324)
>        at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:188)
>        at
> org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:129)
>        at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:408)
>        at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:521)
>        at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:271)
>        at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:177)
>        at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
>        at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
>        at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
>        at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
>        at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:439)
>        at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:316)
>        at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:303)
>        at javax.xml.ws.Service.getPort(Service.java:92)
>
> Someone any ideas?
>
> Thanks in advance.
>
> Yannick
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/java-lang-NoSuchMethodError-org-apache-ws-commons-schema-XmlSchemaForm-tp4780240p4780240.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>