Re: Exception object has all fields set to NULL on client side
Dan, I followed the discussion on CXF-1226 in this forum and found it very helpful. (http://www.nabble.com/Created:-(CXF-1226)-Missing-input-output-param-namespace-in-SOAP-td13870857.html) The workaround proposed by Benson is creating a qualified schema and fixing the NULL field problem. I tried the ReflectionServiceFactoryBean approach that you had suggested but I couldn't get it working. You had mentioned that it was not very well tested at that time. It will be cleaner to use a spring configuration rather than create package-info files and dummy beans. Do have any update on its status? - Kannan rkannan wrote: Dan, Sorry, I made a mistake in my previous post. There is nothing wrong with parsing the SOAP detail. However the problem is with the Unmarshaller piece. As you said I wrote a simple HelloWorld program that throws an exception and this is what I found out. - HelloWorld program is working fine for exception. The reason is that the generated WSDL has elementFormDefault=qualified on its schema. As a result, WSDL2Java generates stub code that has @XmlElement annotation with namespace attribute on the protected field of exception class. I checked to see what happens when elementFormDefault is set to unqualified in WSDL. The generated stub code does not have namespace atttribute in @XmElement annotation. In this case the fields of exception object are all null (my original post talks about this problem). I believe while unmarshalling the fault message, the namespace attribute in SOAP fault message is compared with the annotation and it fails here. When you said its working fine with your sample program, I assume its because of qualified schema. Can you check if it works fine with unqualified also? - Having figured this, I decided to generate the WSDL of my original problem with elementFormDefault set to qualified. I followed the instruction in this post: http://www.nabble.com/xs%3Aschema-attributeFormDefault%3D%22unqualified%22-elementFormDefault%3D%22unqualified%22-td13604195.html#a13620904 But I am not able to get it to work. There is no change in the WSDL. What is the correct way to get this problem resolved? Using qualified in WSDL (if so how?), or is there a bug. Because even with unqualified schema, unmarhsalling happens fine for SOAP request/response messages other than fault messages. Thanks, Kannan dkulp wrote: Kannan, Any chance you could come up with an example so I can see what the issue is in a debugger? A modified hello world or something would be great. The samples that I've written seem to be OK. Dan On Thursday 10 January 2008, rkannan wrote: I did some debugging of the CXF code and figured the following: There is a call to a method in StaxUtils that parses the SOAP fault response. It correctly identifies values for all headers except detail. As a result a NULL value is returned for fault detail; the created exception object therefore has its member variables uninitialized. This could be a bug in CXF. Maybe we need to include some jar file that has correct implementation for parsing the SOAP fault. This is a serious block. - Kannan rkannan wrote: I am throwing an exception from server side but on the client side the exception object has all the fields set to NULL. I checked the incoming SOAP fault message and it has correct values for the fields. I believe the correct jar files are not being used because I had a similar problem in sending List data types as parameters and it was fixed by adding asm.jar. I am using Wrapped Doc/Lit with the following dependencies on client: -- dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.1/version scopeprovided/scope /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-frontend-jaxws/artifactId version${cxf.version}/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-transports-http/artifactId version${cxf.version}/version /dependency dependency groupIdasm/groupId artifactIdasm/artifactId version3.0/version /dependency -- If it really is a problem with using the correct jar files, it will be very helpful to get a list of jars that need to be used on server and client side to enable web service using CXF. I read the WHICH_JARS file that is part of CXF download, but adding them has not solved my problem. Can someone point out which classes are absolutely needed to handle fault/exception objects properly? Thanks, Kannan --
More than one Element in Request Wrapper?
Hi everyone, I have a simple question for someone who is familiar with CXF. I try to add annotations to a method that contains three selfdefined datatypes: init(SessionId sid, DataTyp dt, DataTyp2 dt) How can I annotate them in the RequestWrapper to get a correct WSDL? I also tried to create something like a wrapperClass, but I always get an error when I try to start the service: INFO: Creating Service {http://xxx.de/}xxxService from class de.xxx.xxxService Exception in thread main org.apache.ws.commons.schema.constants.Enum$EnumValueException: Bad Enumeration value 'extension restriction' Can anybody help me? Regards, Benjamin -- View this message in context: http://www.nabble.com/More-than-one-Element-in-Request-Wrapper--tp14753520p14753520.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Exception object has all fields set to NULL on client side
The stuff in CXF-1226 is new for 2.0.4 so you would need to be using a snapshot version of 2.0.4 for that to work. I'm looking into the other stuff now. Dan On Friday 11 January 2008, rkannan wrote: Dan, I followed the discussion on CXF-1226 in this forum and found it very helpful. (http://www.nabble.com/Created:-(CXF-1226)-Missing-input-output-param- namespace-in-SOAP-td13870857.html) The workaround proposed by Benson is creating a qualified schema and fixing the NULL field problem. I tried the ReflectionServiceFactoryBean approach that you had suggested but I couldn't get it working. You had mentioned that it was not very well tested at that time. It will be cleaner to use a spring configuration rather than create package-info files and dummy beans. Do have any update on its status? - Kannan rkannan wrote: Dan, Sorry, I made a mistake in my previous post. There is nothing wrong with parsing the SOAP detail. However the problem is with the Unmarshaller piece. As you said I wrote a simple HelloWorld program that throws an exception and this is what I found out. - HelloWorld program is working fine for exception. The reason is that the generated WSDL has elementFormDefault=qualified on its schema. As a result, WSDL2Java generates stub code that has @XmlElement annotation with namespace attribute on the protected field of exception class. I checked to see what happens when elementFormDefault is set to unqualified in WSDL. The generated stub code does not have namespace atttribute in @XmElement annotation. In this case the fields of exception object are all null (my original post talks about this problem). I believe while unmarshalling the fault message, the namespace attribute in SOAP fault message is compared with the annotation and it fails here. When you said its working fine with your sample program, I assume its because of qualified schema. Can you check if it works fine with unqualified also? - Having figured this, I decided to generate the WSDL of my original problem with elementFormDefault set to qualified. I followed the instruction in this post: http://www.nabble.com/xs%3Aschema-attributeFormDefault%3D%22unqualif ied%22-elementFormDefault%3D%22unqualified%22-td13604195.html#a136209 04 But I am not able to get it to work. There is no change in the WSDL. What is the correct way to get this problem resolved? Using qualified in WSDL (if so how?), or is there a bug. Because even with unqualified schema, unmarhsalling happens fine for SOAP request/response messages other than fault messages. Thanks, Kannan dkulp wrote: Kannan, Any chance you could come up with an example so I can see what the issue is in a debugger? A modified hello world or something would be great. The samples that I've written seem to be OK. Dan On Thursday 10 January 2008, rkannan wrote: I did some debugging of the CXF code and figured the following: There is a call to a method in StaxUtils that parses the SOAP fault response. It correctly identifies values for all headers except detail. As a result a NULL value is returned for fault detail; the created exception object therefore has its member variables uninitialized. This could be a bug in CXF. Maybe we need to include some jar file that has correct implementation for parsing the SOAP fault. This is a serious block. - Kannan rkannan wrote: I am throwing an exception from server side but on the client side the exception object has all the fields set to NULL. I checked the incoming SOAP fault message and it has correct values for the fields. I believe the correct jar files are not being used because I had a similar problem in sending List data types as parameters and it was fixed by adding asm.jar. I am using Wrapped Doc/Lit with the following dependencies on client: -- dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.1/version scopeprovided/scope /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-frontend-jaxws/artifactId version${cxf.version}/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-transports-http/artifactId version${cxf.version}/version /dependency dependency groupIdasm/groupId artifactIdasm/artifactId version3.0/version /dependency -- If it really is a problem with using the correct jar files, it will be very helpful to get a list of jars that
Re: Exception object has all fields set to NULL on client side
I'm definitely going to need a test case from you. I've checked the system tests that we currently have and they are all using the default unqualified schemas. In particular, I looked at the CustomException.java thing that we throw (code at: http://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/CustomException.java and the Schema it generates is definitely unqualified and the exception test does work. (Line 360 of ClientServerMiscTest.java) Could you please send me the exception class you are trying to throw so I can try and reproduce it? Thanks! Dan On Friday 11 January 2008, Daniel Kulp wrote: The stuff in CXF-1226 is new for 2.0.4 so you would need to be using a snapshot version of 2.0.4 for that to work. I'm looking into the other stuff now. Dan On Friday 11 January 2008, rkannan wrote: Dan, I followed the discussion on CXF-1226 in this forum and found it very helpful. (http://www.nabble.com/Created:-(CXF-1226)-Missing-input-output-para m- namespace-in-SOAP-td13870857.html) The workaround proposed by Benson is creating a qualified schema and fixing the NULL field problem. I tried the ReflectionServiceFactoryBean approach that you had suggested but I couldn't get it working. You had mentioned that it was not very well tested at that time. It will be cleaner to use a spring configuration rather than create package-info files and dummy beans. Do have any update on its status? - Kannan rkannan wrote: Dan, Sorry, I made a mistake in my previous post. There is nothing wrong with parsing the SOAP detail. However the problem is with the Unmarshaller piece. As you said I wrote a simple HelloWorld program that throws an exception and this is what I found out. - HelloWorld program is working fine for exception. The reason is that the generated WSDL has elementFormDefault=qualified on its schema. As a result, WSDL2Java generates stub code that has @XmlElement annotation with namespace attribute on the protected field of exception class. I checked to see what happens when elementFormDefault is set to unqualified in WSDL. The generated stub code does not have namespace atttribute in @XmElement annotation. In this case the fields of exception object are all null (my original post talks about this problem). I believe while unmarshalling the fault message, the namespace attribute in SOAP fault message is compared with the annotation and it fails here. When you said its working fine with your sample program, I assume its because of qualified schema. Can you check if it works fine with unqualified also? - Having figured this, I decided to generate the WSDL of my original problem with elementFormDefault set to qualified. I followed the instruction in this post: http://www.nabble.com/xs%3Aschema-attributeFormDefault%3D%22unqual if ied%22-elementFormDefault%3D%22unqualified%22-td13604195.html#a136 209 04 But I am not able to get it to work. There is no change in the WSDL. What is the correct way to get this problem resolved? Using qualified in WSDL (if so how?), or is there a bug. Because even with unqualified schema, unmarhsalling happens fine for SOAP request/response messages other than fault messages. Thanks, Kannan dkulp wrote: Kannan, Any chance you could come up with an example so I can see what the issue is in a debugger? A modified hello world or something would be great. The samples that I've written seem to be OK. Dan On Thursday 10 January 2008, rkannan wrote: I did some debugging of the CXF code and figured the following: There is a call to a method in StaxUtils that parses the SOAP fault response. It correctly identifies values for all headers except detail. As a result a NULL value is returned for fault detail; the created exception object therefore has its member variables uninitialized. This could be a bug in CXF. Maybe we need to include some jar file that has correct implementation for parsing the SOAP fault. This is a serious block. - Kannan rkannan wrote: I am throwing an exception from server side but on the client side the exception object has all the fields set to NULL. I checked the incoming SOAP fault message and it has correct values for the fields. I believe the correct jar files are not being used because I had a similar problem in sending List data types as parameters and it was fixed by adding asm.jar. I am using Wrapped Doc/Lit with the following dependencies on client: -- -- -- dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.1/version scopeprovided/scope /dependency
Re: Exception object has all fields set to NULL on client side
Maybe not. I did wireshark wiretraces on the messages and the messages are in qualified form despite the schema saying they should be unqualified.That's definitely a bug and may be part of the issue. :-( I'll try and get that fixed and see if that helps. Might not be able to get to it till monday though. Silly meetings. Dan On Friday 11 January 2008, Daniel Kulp wrote: I'm definitely going to need a test case from you. I've checked the system tests that we currently have and they are all using the default unqualified schemas. In particular, I looked at the CustomException.java thing that we throw (code at: http://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/ java/org/apache/cxf/systest/jaxws/CustomException.java and the Schema it generates is definitely unqualified and the exception test does work. (Line 360 of ClientServerMiscTest.java) Could you please send me the exception class you are trying to throw so I can try and reproduce it? Thanks! Dan On Friday 11 January 2008, Daniel Kulp wrote: The stuff in CXF-1226 is new for 2.0.4 so you would need to be using a snapshot version of 2.0.4 for that to work. I'm looking into the other stuff now. Dan On Friday 11 January 2008, rkannan wrote: Dan, I followed the discussion on CXF-1226 in this forum and found it very helpful. (http://www.nabble.com/Created:-(CXF-1226)-Missing-input-output-pa ra m- namespace-in-SOAP-td13870857.html) The workaround proposed by Benson is creating a qualified schema and fixing the NULL field problem. I tried the ReflectionServiceFactoryBean approach that you had suggested but I couldn't get it working. You had mentioned that it was not very well tested at that time. It will be cleaner to use a spring configuration rather than create package-info files and dummy beans. Do have any update on its status? - Kannan rkannan wrote: Dan, Sorry, I made a mistake in my previous post. There is nothing wrong with parsing the SOAP detail. However the problem is with the Unmarshaller piece. As you said I wrote a simple HelloWorld program that throws an exception and this is what I found out. - HelloWorld program is working fine for exception. The reason is that the generated WSDL has elementFormDefault=qualified on its schema. As a result, WSDL2Java generates stub code that has @XmlElement annotation with namespace attribute on the protected field of exception class. I checked to see what happens when elementFormDefault is set to unqualified in WSDL. The generated stub code does not have namespace atttribute in @XmElement annotation. In this case the fields of exception object are all null (my original post talks about this problem). I believe while unmarshalling the fault message, the namespace attribute in SOAP fault message is compared with the annotation and it fails here. When you said its working fine with your sample program, I assume its because of qualified schema. Can you check if it works fine with unqualified also? - Having figured this, I decided to generate the WSDL of my original problem with elementFormDefault set to qualified. I followed the instruction in this post: http://www.nabble.com/xs%3Aschema-attributeFormDefault%3D%22unqu al if ied%22-elementFormDefault%3D%22unqualified%22-td13604195.html#a1 36 209 04 But I am not able to get it to work. There is no change in the WSDL. What is the correct way to get this problem resolved? Using qualified in WSDL (if so how?), or is there a bug. Because even with unqualified schema, unmarhsalling happens fine for SOAP request/response messages other than fault messages. Thanks, Kannan dkulp wrote: Kannan, Any chance you could come up with an example so I can see what the issue is in a debugger? A modified hello world or something would be great. The samples that I've written seem to be OK. Dan On Thursday 10 January 2008, rkannan wrote: I did some debugging of the CXF code and figured the following: There is a call to a method in StaxUtils that parses the SOAP fault response. It correctly identifies values for all headers except detail. As a result a NULL value is returned for fault detail; the created exception object therefore has its member variables uninitialized. This could be a bug in CXF. Maybe we need to include some jar file that has correct implementation for parsing the SOAP fault. This is a serious block. - Kannan rkannan wrote: I am throwing an exception from server side but on the client side the exception object has all the fields set to NULL. I checked the incoming SOAP fault message and it has correct values for the fields. I believe the correct jar files are not being
Map parameter is empty in CXF, worked in XFire
I've been struggling with this for the better part of a day now. I have a service that takes a MapString, String as a parameter. It worked under XFire, but I am trying to port to CXF 2.0.3 now and I can't get the values in the Map to come across. I pass a Map with three entries from the client but an empty Map appears on the server side. Any ideas where I'm going wrong: Here is the client setup code: ClientProxyFactoryBean fb = new ClientProxyFactoryBean(); fb.setServiceClass(IntegrityCheckWebService.class); fb.setAddress(serviceUri + SERVICE_URL); fb.setProperties(properties); // Not sure if this line is needed, but tried it anyway // Didn't work either way fb.setDataBinding(new AegisDatabinding()); fb.getServiceFactory().setDataBinding(new AegisDatabinding()); this.service = (IntegrityCheckWebService) fb.create(); And the call: MapString, String licenseCheckInfo = new HashMapString, String(); licenseCheckInfo.put(IntegrityCheckWebService.TRANSACTION_ID, rro.getTransactionID()); licenseCheckInfo.put(IntegrityCheckWebService.OPERATOR_ID, rro.getParameters().get(2)); licenseCheckInfo.put(IntegrityCheckWebService.TERMINAL_SERIAL_NUMBER, rro.getParameters().get(1)); result = this.service.integrityAssert(licenseCheckInfo); And the service method interface: public boolean integrityAssert(MapString, String integrityCheckInfo); And the Spring config: bean id=aegisBean class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id='jaxwsAegisServiceFactory' class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=dataBinding ref=aegisBean / property name=serviceConfigurations list bean class=org.apache.cxf.jaxws.support.JaxWsServiceConfiguration / bean class=org.apache.cxf.aegis.databinding.AegisServiceConfiguration / bean class=org.apache.cxf.service.factory.DefaultServiceConfiguration / /list /property /bean bean id=integrityCheckWebService class=IntegrityCheckWebService/ property name=licenseManager ref=systemLicenseManager/ /bean jaxws:endpoint id=IntegrityCheckService implementor=#integrityCheckWebService address=/IntegrityCheckService jaxws:serviceFactory ref bean='jaxwsAegisServiceFactory' / /jaxws:serviceFactory /jaxws:endpoint
Getting the total size of a DataHandler-type Request Parameter
Hello, This question is hard for me to phrase exactly, but for a SOAP request which contains an input parameter which is resolved as a DataHandler by JAX-WS, is there a way to determine the total size in bytes of that DataHandler object? Can I rely on any HTTP headers for that information? I'm trying to insert the DataHandler-based object into a CLOB column in an Oracle database table. AFAICT inserting CLOBs requires a length parameter, which I don't know because the DataHandler object is resolved as a sizeless InputStream in the service's Java code. This forces us to serialize the InputStream into a file first so I can determine its length, prior to inserting into Oracle. It is this serialization part I'd like to remove if I can. Content-Length might be a possibility, but that would take into account the message as a whole, also, I think with MTOM chunking/multiple sends occurs so the value of C-L wouldn't necessarily map to the size of the DataHandler object. Overall, I'd just like to confirm here that there is nothing much I can accurately rely on within JAX-WS to get the DataHandler size. Thanks, Glen -- View this message in context: http://www.nabble.com/Getting-the-total-size-of-a-DataHandler-type-Request-Parameter-tp14760716p14760716.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: override binding name
Hi, I'm evaluating CXF as a possible replacement for Axis, and I have the same problem (the client requires a particular SOAP binding name in the WSDL). The SoapBinding name seems to be hard-coded in SoapBindingFactory: SoapBindingInfo info = new SoapBindingInfo(si, bindingid, config.getVersion()); info.setName(new QName(si.getName().getNamespaceURI(), si.getName().getLocalPart() + SoapBinding)); The documentation (http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html) says you can provide your own binding factory: You can specify the BindingFactory for this endpoint to use. This can be supplied using the Spring bean class=MyBindingFactory/ syntax. Like this: jaxws:binding bean class='...MySoapBindingFactory'/ /jaxws:binding However, that gives the error: Cannot convert value of type [demo.spring.NamedSoapBindingFactory] to required type [org.apache.cxf.binding.BindingConfiguration] for property 'bindingConfig' Another possibility I'm considering is an interceptor that rewrites the WSDL returned to the client. Any suggestions on the correct way to handle this? Thanks, mnereson wrote: Is there a way to override the binding name property? For example service xmlns=http://xfire.codehaus.org/config/1.0; nameMyFulfillmentService/name serviceClass com.myco.myapp.MyFulfillmentServiceImpl /serviceClass serviceFactory#jsr181ServiceFactory/serviceFactory /service Results in a binding named MyFulfillmentServiceHttpBinding The wsdl shows wsdl:binding name=MyFulfillmentServiceHttpBinding type=tns:MyFulfillmentServicePortType ... /wsdl:binding However, Our lightweight enterprise service bus requires the binding name to be SomethingSoapBinding so I need MyFulfillmentServiceSoapBinding. My current configuration uses annotations and resembles the following: === services.xml === beans bean name=jsr181ServiceFactory class=org.codehaus.xfire.annotations.AnnotationServiceFactory constructor-arg ref=xfire.transportManager type=org.codehaus.xfire.transport.TransportManager index=0/ constructor-arg ref=config index=1 type=org.codehaus.xfire.aegis.type.Configuration/ /bean bean id=config class=org.codehaus.xfire.aegis.type.Configuration property name=defaultNillable value=true/ property name=defaultMinOccurs value=1/ /bean service xmlns=http://xfire.codehaus.org/config/1.0; nameMyFulfillmentService/name serviceClass com.myco.myapp.MtFulfillmentServiceImpl /serviceClass serviceFactory#jsr181ServiceFactory/serviceFactory /service /beans == web.xml == web-app servlet servlet-nameXFireServlet/servlet-name display-nameXFire Servlet/display-name servlet-class org.codehaus.xfire.transport.http.XFireConfigurableServlet /servlet-class /servlet servlet-mapping servlet-nameXFireServlet/servlet-name url-pattern/services/*/url-pattern /servlet-mapping /web-app == excerpts RemoteFulfillmentServiceImpl.java == import javax.jws.WebMethod; import javax.jws.WebService; @WebService public class MyFulfillmentServiceImpl implements MyFulfillmentService { // various private methods @WebMethod public String soemPublicMethod(final int someId) { // maybe a couple lines of code } } Thanks for the help. ~ mnereson -- View this message in context: http://www.nabble.com/override-binding-name-tp13218105p14760134.html Sent from the cxf-user mailing list archive at Nabble.com.
maven build problem
I need to add in CXF to webwork project. webwork has integrate with Spring. I use maven-2.0.7. After deploying to JBoss, I try to access the service. But I got the following error. What did I miss? soap:Envelope soap:Body soap:Fault faultcodesoap:Server/faultcode faultstringNo such operation: /faultstring /soap:Fault /soap:Body /soap:Envelope Below is my pom.xml repositories repository idapache.incubating.releases/id name Apache Incubating Release Distribution Repository /name url http://people.apache.org/repo/m2-incubating-repository /url /repository /repositories properties cxf.version2.0.3-incubator/cxf.version /properties dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-core/artifactId version${cxf.version}/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-frontend-jaxws/artifactId version${cxf.version}/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-transports-http/artifactId version${cxf.version}/version /dependency -- View this message in context: http://www.nabble.com/maven-build-problem-tp14760998p14760998.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: maven build problem
Here is my solution: !-- WSS4J -- dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-ws-security/artifactId version${cxf.version}/version /dependency I also need to plugin xalan as well. --- yulinxp wrote: I need to add in CXF to webwork project. webwork has integrate with Spring. I use maven-2.0.7. After deploying to JBoss, I try to access the service. But I got the following error. What did I miss? soap:Envelope soap:Body soap:Fault faultcodesoap:Server/faultcode faultstringNo such operation: /faultstring /soap:Fault /soap:Body /soap:Envelope Below is my pom.xml repositories repository idapache.incubating.releases/id name Apache Incubating Release Distribution Repository /name url http://people.apache.org/repo/m2-incubating-repository /url /repository /repositories properties cxf.version2.0.3-incubator/cxf.version /properties dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-core/artifactId version${cxf.version}/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-frontend-jaxws/artifactId version${cxf.version}/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-transports-http/artifactId version${cxf.version}/version /dependency -- View this message in context: http://www.nabble.com/maven-build-problem-tp14760998p14763592.html Sent from the cxf-user mailing list archive at Nabble.com.
FW: how to include cxf-2.0.2-incubator.jar in maven
Hi, I am new to cxf and i want to incldue cxf-2.0.2-incubator.jar in my pom.xml when i added following code in pom.xml it does not compile. dependency groupIdorg.apache.cxf/groupId artifactIdcxf/artifactId version2.0.2-incubator/version /dependency actually my purpose is to include cxf-2.0.2-incubator.jar Downloading: http://people.apache.org/repo/m2-incubating-repository/org/apac xf/cxf/2.0.2-incubator/cxf-2.0.2-incubator.jar Downloading: http://repo1.maven.org/maven2/org/apache/cxf/cxf/2.0.2-incubato f-2.0.2-incubator.jar [INFO] - [ERROR] BUILD ERROR [INFO] - [INFO] Failed to resolve artifact. Missing: -- 1) org.apache.cxf:cxf:jar:2.0.2-incubator Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.apache.cxf -DartifactId=cxf \ -Dversion=2.0.2-incubator -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there mvn deploy:deploy-file -DgroupId=org.apache.cxf -DartifactId=cxf \ -Dversion=2.0.2-incubator -Dpackaging=jar -Dfile=/path/to/file \ -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) kaiser:process:jar:1.2.2-SNAPSHOT 2) org.apache.cxf:cxf:jar:2.0.2-incubator -- 1 required artifact is missing. thanks Manoj
how to include cxf-2.0.2-incubator.jar in maven
Hi, I am new to cxf and i want to incldue cxf-2.0.2-incubator.jar in my pom.xml when i added following code in pom.xml it does not compile. dependency groupIdorg.apache.cxf/groupId artifactIdcxf/artifactId version2.0.2-incubator/version /dependency actually my purpose is to include cxf-2.0.2-incubator.jar Downloading: http://people.apache.org/repo/m2-incubating-repository/org/apac xf/cxf/2.0.2-incubator/cxf-2.0.2-incubator.jar Downloading: http://repo1.maven.org/maven2/org/apache/cxf/cxf/2.0.2-incubato f-2.0.2-incubator.jar [INFO] - [ERROR] BUILD ERROR [INFO] - [INFO] Failed to resolve artifact. Missing: -- 1) org.apache.cxf:cxf:jar:2.0.2-incubator Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.apache.cxf -DartifactId=cxf \ -Dversion=2.0.2-incubator -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there mvn deploy:deploy-file -DgroupId=org.apache.cxf -DartifactId=cxf \ -Dversion=2.0.2-incubator -Dpackaging=jar -Dfile=/path/to/file \ -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) kaiser:process:jar:1.2.2-SNAPSHOT 2) org.apache.cxf:cxf:jar:2.0.2-incubator -- 1 required artifact is missing. thanks Manoj
RE: Map parameter is empty in CXF, worked in XFire
Little more info: I turned on logging, and the map entries are being sent by the client, just not mapped on the server side. The inbound message was logged as: soap:Envelope soap:Body ns1:integrityAssert ns1:arg0 ns1:entry ns1:keyterminalSerialNumber/ns1:key ns1:value63336559/ns1:value /ns1:entry ns1:entry ns1:keytransactionId/ns1:key ns1:valueprTaskLUTCoreSignOn/ns1:value /ns1:entry ns1:entry ns1:keyoperatorId/ns1:key ns1:valuedennisd/ns1:value /ns1:entry /ns1:arg0 /ns1:integrityAssert /soap:Body /soap:Envelope -Original Message- From: Doubleday, Dennis [mailto:[EMAIL PROTECTED] Sent: Friday, January 11, 2008 12:28 PM To: cxf-user@incubator.apache.org Subject: Map parameter is empty in CXF, worked in XFire I've been struggling with this for the better part of a day now. I have a service that takes a MapString, String as a parameter. It worked under XFire, but I am trying to port to CXF 2.0.3 now and I can't get the values in the Map to come across. I pass a Map with three entries from the client but an empty Map appears on the server side. Any ideas where I'm going wrong: Here is the client setup code: ClientProxyFactoryBean fb = new ClientProxyFactoryBean(); fb.setServiceClass(IntegrityCheckWebService.class); fb.setAddress(serviceUri + SERVICE_URL); fb.setProperties(properties); // Not sure if this line is needed, but tried it anyway // Didn't work either way fb.setDataBinding(new AegisDatabinding()); fb.getServiceFactory().setDataBinding(new AegisDatabinding()); this.service = (IntegrityCheckWebService) fb.create(); And the call: MapString, String licenseCheckInfo = new HashMapString, String(); licenseCheckInfo.put(IntegrityCheckWebService.TRANSACTION_ID, rro.getTransactionID()); licenseCheckInfo.put(IntegrityCheckWebService.OPERATOR_ID, rro.getParameters().get(2)); licenseCheckInfo.put(IntegrityCheckWebService.TERMINAL_SERIAL_NUMBER, rro.getParameters().get(1)); result = this.service.integrityAssert(licenseCheckInfo); And the service method interface: public boolean integrityAssert(MapString, String integrityCheckInfo); And the Spring config: bean id=aegisBean class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id='jaxwsAegisServiceFactory' class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=dataBinding ref=aegisBean / property name=serviceConfigurations list bean class=org.apache.cxf.jaxws.support.JaxWsServiceConfiguration / bean class=org.apache.cxf.aegis.databinding.AegisServiceConfiguration / bean class=org.apache.cxf.service.factory.DefaultServiceConfiguration / /list /property /bean bean id=integrityCheckWebService class=IntegrityCheckWebService/ property name=licenseManager ref=systemLicenseManager/ /bean jaxws:endpoint id=IntegrityCheckService implementor=#integrityCheckWebService address=/IntegrityCheckService jaxws:serviceFactory ref bean='jaxwsAegisServiceFactory' / /jaxws:serviceFactory /jaxws:endpoint
Re: Exception object has all fields set to NULL on client side
Dan, I am wondering how you got the test case for exception to work if the SOAP messages are qualified but WSDL is unqualified. I believe that was the problem with my case also and the exception test case failed. FYI, I am still working on 2.0.3. Are you running these test cases for exception on 2.0.3 or 2.0.4 snapshot? I noticed that in runDocLitTest you have a catch statement for CustomException. In my case its always something like CustomException_Exception because WSDL2Java generates this wrapper. Does 2.0.4 get rid off the wrapper exception class? I am going to give 2.0.4 a try today in the evening. Also, is the tentative release date around mid Jan? - Kannan dkulp wrote: Maybe not. I did wireshark wiretraces on the messages and the messages are in qualified form despite the schema saying they should be unqualified.That's definitely a bug and may be part of the issue. :-( I'll try and get that fixed and see if that helps. Might not be able to get to it till monday though. Silly meetings. Dan On Friday 11 January 2008, Daniel Kulp wrote: I'm definitely going to need a test case from you. I've checked the system tests that we currently have and they are all using the default unqualified schemas. In particular, I looked at the CustomException.java thing that we throw (code at: http://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/ java/org/apache/cxf/systest/jaxws/CustomException.java and the Schema it generates is definitely unqualified and the exception test does work. (Line 360 of ClientServerMiscTest.java) Could you please send me the exception class you are trying to throw so I can try and reproduce it? Thanks! Dan On Friday 11 January 2008, Daniel Kulp wrote: The stuff in CXF-1226 is new for 2.0.4 so you would need to be using a snapshot version of 2.0.4 for that to work. I'm looking into the other stuff now. Dan On Friday 11 January 2008, rkannan wrote: Dan, I followed the discussion on CXF-1226 in this forum and found it very helpful. (http://www.nabble.com/Created:-(CXF-1226)-Missing-input-output-pa ra m- namespace-in-SOAP-td13870857.html) The workaround proposed by Benson is creating a qualified schema and fixing the NULL field problem. I tried the ReflectionServiceFactoryBean approach that you had suggested but I couldn't get it working. You had mentioned that it was not very well tested at that time. It will be cleaner to use a spring configuration rather than create package-info files and dummy beans. Do have any update on its status? - Kannan rkannan wrote: Dan, Sorry, I made a mistake in my previous post. There is nothing wrong with parsing the SOAP detail. However the problem is with the Unmarshaller piece. As you said I wrote a simple HelloWorld program that throws an exception and this is what I found out. - HelloWorld program is working fine for exception. The reason is that the generated WSDL has elementFormDefault=qualified on its schema. As a result, WSDL2Java generates stub code that has @XmlElement annotation with namespace attribute on the protected field of exception class. I checked to see what happens when elementFormDefault is set to unqualified in WSDL. The generated stub code does not have namespace atttribute in @XmElement annotation. In this case the fields of exception object are all null (my original post talks about this problem). I believe while unmarshalling the fault message, the namespace attribute in SOAP fault message is compared with the annotation and it fails here. When you said its working fine with your sample program, I assume its because of qualified schema. Can you check if it works fine with unqualified also? - Having figured this, I decided to generate the WSDL of my original problem with elementFormDefault set to qualified. I followed the instruction in this post: http://www.nabble.com/xs%3Aschema-attributeFormDefault%3D%22unqu al if ied%22-elementFormDefault%3D%22unqualified%22-td13604195.html#a1 36 209 04 But I am not able to get it to work. There is no change in the WSDL. What is the correct way to get this problem resolved? Using qualified in WSDL (if so how?), or is there a bug. Because even with unqualified schema, unmarhsalling happens fine for SOAP request/response messages other than fault messages. Thanks, Kannan dkulp wrote: Kannan, Any chance you could come up with an example so I can see what the issue is in a debugger? A modified hello world or something would be great. The samples that I've written seem to be OK. Dan On Thursday 10 January 2008, rkannan wrote: I did some debugging of the CXF code and figured the following: There is a call to a method in StaxUtils that parses the
Issues with JSON based Service and Jettison
Hello, I cannot seem to get a JSON based servive to work properly. Does anyone have a complete end to end example using the spring config to set up jettison? Ideally I want to be able to use a post or a get to a service using JSON both on request and response. I am accessing the service via /message/ABC123DEF456/4 I am using Jettison and am getting the following exceptions: Jan 11, 2008 12:36:27 PM org.apache.cxf.interceptor.AttachmentInInterceptor handleMessage INFO: AttachmentInInterceptor skipped in HTTP GET method Jan 11, 2008 12:36:27 PM org.apache.cxf.binding.http.interceptor.DispatchInterceptor handleMessage INFO: Invoking GET on /message/ABC123DEF456/4 Jan 11, 2008 12:36:27 PM org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor handleMessage INFO: URIParameterInterceptor handle message on path [/message/ABC123DEF456/4] with content-type [null] Jan 11, 2008 12:36:27 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: SINGLE_PART_REQUIRED at org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.handle Message(URIParameterInInterceptor.java:82) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC hain.java:207) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiati onObserver.java:78) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDes tination.java:79) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(Ser vletController.java:264) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletControl ler.java:123) at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSe rvlet.java:170) at org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFSer vlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2 63) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84 4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process( Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) Jan 11, 2008 12:36:27 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now java.lang.IllegalStateException: Invalid JSON namespace: http://cxf.apache.org/bindings/xformat at org.codehaus.jettison.mapped.MappedNamespaceConvention.getJSONNamespace( MappedNamespaceConvention.java:148) at org.codehaus.jettison.mapped.MappedNamespaceConvention.createKey(MappedN amespaceConvention.java:155) at org.codehaus.jettison.mapped.MappedXMLStreamWriter.writeStartElement(Map pedXMLStreamWriter.java:220) at org.apache.cxf.staxutils.StaxUtils.writeStartElement(StaxUtils.java:182) ) I set up my jettison properties in my beans.xml as such following other examples on this list: jaxws:endpoint id=jBoardService implementor=com.cbs.bos.ws.json.BoardServiceImpl address=/jBoardService bindingUri=http://apache.org/cxf/binding/http; jaxws:properties entry key=Content-Type value=text/plain/ /jaxws:properties jaxws:serviceFactory bean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=wrapped value=false/ property name=properties map entry keyvaluejavax.xml.stream.XMLInputFactory/value/key bean class=org.codehaus.jettison.mapped.MappedXMLInputFactory constructor-arg map entry key=http://BoardService.json.bos.cbs.com/; value=jBoardService/ entry key=http://BoardServiceImpl.json.bos.cbs.com/; value=jBoardServiceImpl/ /map /constructor-arg /bean /entry entry keyvaluejavax.xml.stream.XMLOutputFactory/value/key bean class=org.codehaus.jettison.mapped.MappedXMLOutputFactory constructor-arg map entry key=http://BoardService.json.bos.cbs.com/; value=jBoardService/ entry key=http://BoardServiceImpl.json.bos.cbs.com/; value=jBoardServiceImpl/ /map /constructor-arg /bean /entry /map /property /bean /jaxws:serviceFactory /jaxws:endpoint
Re: maven build problem
I found out I missed the following .jar using maven build. xmlsec-*.jar xalan-*.jar wss4j-*.jar js-1.6R5.jar jra-1.0-alpha-4.jar jettison-1.0-RC2.jar Some of them might not be needed. But I know wss4j-*.jar will be used if my cxf server setup to use WS-Security. While in the meantime, the reason I got faultstringNo such operation: /faultstring is because there is no xalan-*.jar. Where can I got these jars. Is anything wrong with my pom.xml? Why it's not getting those needed jars? yulinxp wrote: I need to add in CXF to webwork project. webwork has integrate with Spring. I use maven-2.0.7. After deploying to JBoss, I try to access the service. But I got the following error. What did I miss? soap:Envelope soap:Body soap:Fault faultcodesoap:Server/faultcode faultstringNo such operation: /faultstring /soap:Fault /soap:Body /soap:Envelope Below is my pom.xml repositories repository idapache.incubating.releases/id name Apache Incubating Release Distribution Repository /name url http://people.apache.org/repo/m2-incubating-repository /url /repository /repositories properties cxf.version2.0.3-incubator/cxf.version /properties dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-core/artifactId version${cxf.version}/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-frontend-jaxws/artifactId version${cxf.version}/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-transports-http/artifactId version${cxf.version}/version /dependency -- View this message in context: http://www.nabble.com/maven-build-problem-tp14760998p14762248.html Sent from the cxf-user mailing list archive at Nabble.com.
Unable to get xml as tring in rest services
Hi, All I have following rest service. When I post a request xml using wget, I get null string on my impl class. I want to recevice xml as string so that I can marshall the string using JiBX. @Post @HttpResource(location = /requestHLTranscode) public String requestHLTranscode(@WebParam(name=requestXML)String requestXML); Configuration == jaxws:endpoint id=transcodeservice_rest implementor=#transcodeService address=/TranscodeService_Rest bindingUri=http://apache.org/cxf/binding/http; jaxws:serviceFactory bean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=wrapped value=true / /bean /jaxws:serviceFactory /jaxws:endpoint -- View this message in context: http://www.nabble.com/Unable-to-get-xml-as-tring-in-rest-services-tp14767165p14767165.html Sent from the cxf-user mailing list archive at Nabble.com.