RE: Generated client to connect to a https ws
Thanks Dan! I've solved this issue adding ContentType information in http-conduit: http:conduit name={http://www.google.com/api/adsense/v2}AccountService.http-conduit; http:client Connection=Keep-Alive MaxRetransmits=1 AllowChunking=false ContentType=text/xml/ http:tlsClientParameters/ /http:conduit I don't know why without it I receive this error... in fact, the http request already contains the text/xml information... so shouldn't be necessary to specify it in conduit :/ Now I'm working on another issue... adding some Soap header parameters to the message. I think that i've done it correctly: MapString, Object soapHeaders = new HashMapString, Object(); List h1 = new ArrayList(); h1.add([EMAIL PROTECTED]); soapHeaders.put(developer_email, h1); List h2 = new ArrayList(); h2.add(mypassword); soapHeaders.put(developer_password, h2); List h3 = new ArrayList(); h3.add(myclientid); soapHeaders.put(client_id, h3); ... ... requestContext.put(MessageContext.HTTP_REQUEST_HEADERS, soapHeaders); but Google tell me that these values are missing :( There are other ways to add them to soap headers (for example directly in http-conduit)? Thanks Davide -Original Message- From: Dan Diephouse [mailto:[EMAIL PROTECTED] Sent: giovedì 19 luglio 2007 0.07 To: cxf-user@incubator.apache.org Subject: Re: Generated client to connect to a https ws It looks like Google is sending you an HTML response - not XML. Are you using the right endpoint URL for the google web service? You might want to try using TCPMon to look at the response google is sending back and see what their message says... http://cwiki.apache.org/CXF20DOC/debugging.html - Dan On 7/18/07, Pirola Davide [EMAIL PROTECTED] wrote: Hi all, I solved the problem... was my fault :( Now I can contact adsense web services... BUT I have another issue. When I call the service cxf give me this error: org.apache.cxf.binding.soap.SoapFault: null is not a valid SOAP version The reason is that all services give me a wrong http response (415 Unsupported Media Type). My request: [EMAIL PROTECTED] pairs: {POST /api/adsense/v2/AccountService HTTP/1.1: null}{Content-Type: text/xml; charset=UTF-8}{developer_email: [EMAIL PROTECTED]: }{developer_password: mypassword}{client_id: ignored}{Cache-Control: no-cache}{Pragma: no-cache}{User-Agent: Java/1.6.0_01}{Host: sandbox.google.com}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}{Transfer-Encoding: chunked} Google response: [EMAIL PROTECTED] pairs: {null: HTTP/1.1 415 Unsupported Media Type}{Content-Type: text/html; charset=UTF-8}{Cache-control: private}{Content-Length: 167}{Date: Tue, 17 Jul 2007 17:09:38 GMT}{Server: GFE/1.3} Anyone have experience on this problem? Sure, Is always my fault.. but where? :D Thanks Davide -Original Message- From: Pirola Davide Sent: venerdì 13 luglio 2007 10.12 To: 'cxf-user@incubator.apache.org' Subject: RE: Generated client to connect to a https ws Hi Dan Willem, Thanks for your support! The problem I have is in this peace of code (AbstractHTTPTransportFactory): /** * This static call creates a connection factory based on * the existence of the SSL (TLS) client side configuration. */ static HttpURLConnectionFactory getConnectionFactory( HTTPConduit configuredConduit ) { HttpURLConnectionFactory fac = null; if (configuredConduit.getTlsClientParameters() != null) { fac = new HttpsURLConnectionFactory( configuredConduit.getTlsClientParameters()); } else { fac = new HttpURLConnectionFactoryImpl(); } return fac; } The configuredConduit object seems to be ok... so I have it from the one configured in my cxf.xml file: http:conduit name={ http://www.google.com/api/adsense/v2}AccountServiceService.http-conduit; http:tlsClientParameters /http:tlsClientParameters /http:conduit BUT... the getTlsClientParameters() method return a null object :( So... seems that the general definition of conduit is ok.. but the http:tlsClientParameters is ingnored. I tried to put http:conduit definition in my cxf.xml file, and I used the system property to tell to cxf to load it, then I tried to put it in the cxf.xml file contained in the cxf-2.0-incubator.jar(/META-INF/cxf/cxf.xml).. but the result is the same. Now I'm trying to use the API, as suggested from Dan. Thanks Davide -Original Message- From: Dan Diephouse [mailto:[EMAIL PROTECTED] Sent: giovedì 12 luglio 2007 21.42 To: cxf-user@incubator.apache.org Subject: Re: Generated client to connect to a https ws Actually if you're using the client API, this is probably easier: YourService s = new YourService() ServiceInterface client =
Re: JAX-WS/annotated SOAP services -- exporting implementation methods rather than interface ones?
Hi Dan, On Wednesday 18 July 2007 23:10:46 Dan Diephouse wrote: Hi Stuart, Did you specify a @WebService(endpointInterface=...YourInterface) on the implementation class? You're using the JAX-WS frontend and per the JAX-WS spec, thats how its supposed to work :-) Yeah, I've got my implementation class pointing to the interface via endpointInterface -- I pretty much copied and pasted the example from that page, then tried to add a property to the implementation class. Here's my current test code, if it helps: Interface: @WebService(name = HelloWorld) @SOAPBinding(style=Style.RPC, use=Use.LITERAL) public interface HelloWorld { String sayHi(@WebParam(name = text) String text); } Implementation: @WebService(endpointInterface = showcase.cxf.HelloWorld) public class HelloWorldImpl implements HelloWorld { private String prefix = *** unspecified ***; @Override public String sayHi(@WebParam(name = text) String text) { return prefix + text; } @WebMethod(exclude = true) public String getPrefix() { return prefix; } @WebMethod(exclude = true) public void setPrefix(String prefix) { this.prefix = prefix; } } So essentially the problem is if you take out the @WebMethod(exclude = true) on the getter and setter, they're included in the generated WSDL as methods of the service :-/ Cheers, - Dan On 7/18/07, Stuart Bingë [EMAIL PROTECTED] wrote: Hello all, We've been using XFire (specifically its SOAP transport) together with JSR-181 annotations for some time now in our internal Spring-based web services (hosted in Tomcat), and are now in the process of looking to upgrade to CXF as part of a general systems upgrade. The web services are java-first, where we code to a SEI and then rely on XFire to generate the WSDL as appropriate. In addition, the SOAP binding used is RPC/Literal for interoperability with PHP clients. After following the Writing a service with Spring article on the CXF site (http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html), as well as attempting the basic HelloWorld applet that the article describes (i.e. separate from our existing environment/services), I've discovered some strange behaviour that wasn't present with XFire. When exposing an endpoint via jaxws:endpoint ... /, the generated WSDL appears to be coming from the implementation class rather than the service interface -- i.e. getters and setters for implementation-specific properties are included in the WSDL. Is this the expected behaviour with jaxws:endpoint /? If so, what other methods are available/recommended for exposing an endpoint via an interface rather than an implementation object? This can be solved with @WebMethod(ignore = true) annotations on the implementation class, but obviously this isn't ideal and shouldn't be needed in the first place. We'd like to continue just exposing the interface as the service contract and then be able to implement the service in whatever way we deem fit. Any pointers would be greatly appreciated! Cheers, -- Stuart Bingë __ Complinet Ltd is registered in England. Registered office at Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Company number 3170722. VAT No. 749 324 021. Complinet Inc is a corporation registered in Delaware, USA. This email has been scanned by the MessageLabs Email Security System. __ Complinet Ltd is registered in England. Registered office at Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Company number 3170722. VAT No. 749 324 021. Complinet Inc is a corporation registered in Delaware, USA. This email has been scanned by the MessageLabs Email Security System.
RE: Contribution of wsdl2js tool
OK, time to join the dev list. Will do. -Original Message- From: Dan Diephouse [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 11:29 AM To: cxf-user@incubator.apache.org Subject: Re: Contribution of wsdl2js tool Hi Benson, Such contributions are definitely welcome! I believe there are a few major things that need to happen. You would need to package the code under an ASL license and send along Corporate CLA [1]. The CXF community would also need to vote on the contribution and possible committers. There may also be some incubator related things we need to do. I'll do some digging and will report back with more info. Also, it might be good to redirect this discussion to the dev list. Cheers, - Dan 1. http://www.apache.org/licenses/#clas On 7/19/07, Benson Margulies [EMAIL PROTECTED] wrote: Dear CXF team, Basis Technology would like to contribute our wsdl2js tool to CXF under the usual ASF license. The tool consists of Java source code that uses the same WSDL library that CXF already uses and generates Javascript code that targets some JavaScript utility functions that work in Firefox and IE (and probably others). What is the mechanics of this process? I could tar up the whole business and append it to a JIRA. You could consider accepting me as a committer. You could ask me to post it for review some other way. --benson -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
Eclipse XSD validation for jaxws.xsd
I am new to CXF and trying to use it with spring. When I am trying to use beans.xml file with jaxws.xsd namespace, Eclipse reports that this namespace is not found. How can I add this schema to the eclipse so that it can find the schema and does not report validation errors. Any help is appreciated. -- View this message in context: http://www.nabble.com/Eclipse-XSD-validation-for-jaxws.xsd-tf4111858.html#a11691580 Sent from the cxf-user mailing list archive at Nabble.com.
RE: Eclipse XSD validation for jaxws.xsd
The jaxws.xsd file is packaged in the cxf-rt-frontend-jaxws-2.0-incubator.jar as well as the uber cxf-2.0-incubator.jar. In both cases, you can find it under /schemas. -Chris -Original Message- From: gdprao [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 11:35 AM To: cxf-user@incubator.apache.org Subject: Eclipse XSD validation for jaxws.xsd I am new to CXF and trying to use it with spring. When I am trying to use beans.xml file with jaxws.xsd namespace, Eclipse reports that this namespace is not found. How can I add this schema to the eclipse so that it can find the schema and does not report validation errors. Any help is appreciated. -- View this message in context: http://www.nabble.com/Eclipse-XSD-validation-for-jaxws.xsd-tf4111858.htm l#a11691580 Sent from the cxf-user mailing list archive at Nabble.com.
Re: Using CXF
Cool. Everything works now. Including the serviceBean=#somebean. Thanks again, Jacob On 7/18/07, Dan Diephouse [EMAIL PROTECTED] wrote: I think that section of the migration guide assumes that you've already imported the cxf bean definitions into your application. The cxf-* resources include some basic CXF bean definitions which are necessary to use CXF inside your spring application - like a definition for the Servlet transport or the Binding manager. So yes, you need to import these if you're going to use jaxws:endpoint, jaxws:client, etc. Regards, - Dan On 7/18/07, Jacob Marcus [EMAIL PROTECTED] wrote: If my services are defined in the cxf.xml, do I still need to import the cxf bean definitions.? I followed the instructions on this wiki page. http://cwiki.apache.org/CXF20DOC/xfire-migration-guide.html#XFireMigrationGuide-services.xml Or are you saying that if I want to use a bean defined else where in my cxf.xml, then I should import these ? Thanks, Jacob On 7/18/07, Dan Diephouse [EMAIL PROTECTED] wrote: Hi Jacob, You need to import the CXF bean definitions: import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf- extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / You can find for more details here: http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html Cheers, - Dan On 7/17/07, Jacob Marcus [EMAIL PROTECTED] wrote: I am not importing the cxf bean definitions in my spring configuration. Here is my cxf.xml file. beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:simple=http://cxf.apache.org/simple; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; simple:server id=Test address=/hello serviceBean=#helloService serviceClass= com.ironmountain.digital.erm.irmrap.cl.soap.util.Hello /simple:server /beans The relevant portions of my web.xml is below. context-param param-namecontextConfigLocation/param-name param-value classpath:configuration-sprcfg.xml, classpath:version-configuration-sprcfg.xml, classpath:jmx-sprcfg.xml, classpath:storage-common-sprcfg.xml, classpath:services-authorization-sprcfg.xml, classpath:services-sprcfg.xml, classpath:cl-http-security-sprcfg.xml, classpath:soap-sprcfg.xml /param-value /context-param servlet servlet-nameCXFServlet/servlet-name display-nameCXF Servlet/display-name servlet-class org.apache.cxf.transport.servlet.CXFServlet /servlet-class load-on-startup3/load-on-startup /servlet servlet-mapping servlet-nameCXFServlet/servlet-name url-pattern/cxfservices/*/url-pattern /servlet-mapping listener listener-class org.springframework.web.context.ContextLoaderListener /listener-class /listener On 7/17/07, Dan Diephouse [EMAIL PROTECTED] wrote: Can you show me what your web.xml and whole cxf.xml look like? How are you importing the CXF bean definitions? Thanks, - Dan On 7/16/07, Jacob Marcus [EMAIL PROTECTED] wrote: Thanks Dan. That worked. from the cxf.xml I would like to refer to a bean defined else where like, simple:server id=Test address= http://localhost:8081/tes/cxfservices/HelloWorld; serviceClass=com.test.HelloWorld simple:serviceBean#helloService/simple:serviceBean /simple:server This is giving me an error saying the bean with id helloService cannot be found. It appears that the SpringBusFactory does not have the bean definition. Is there a way I can instruct the server to use a specific bus? My spring application context is defined in the web.xml and I use the ContextLoaderListener. My problem is that the cxf.xml does not seem to be able to refer to beans in my application context. Thanks in advance for your help, Jacob On 7/14/07, Dan Diephouse [EMAIL PROTECTED] wrote: Hi Jacob, I would go with something like: dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-frontend-jaxws/artifactId version2.0-incubator/version /dependency dependency groupIdorg.apache.cxf/groupId artifactIdcxf-rt-transports-http/artifactId
Re: Web Method not returning correctly
Samuel, Could you send the soap message? I'm willing to bet this is related to CXF-802 and CXF-655 which I'm still battling with. My expectation is that the completedLogId element in the response soap message is ending up qualified instead of unqualified like the schema states it should be..NET is probably just looking for the unqualified version. (as it should) The main workaround for most of the Java First cases is to run wsdl2java with the -s flag to generate the wrapper types. The runtime should then pick up those wrappers and use those which should make the messages correct. Dan On Thursday 19 July 2007 13:37, Clough, Samuel (USPC.PRG.Atlanta) wrote: Well, I've sniffed this with tcpmon and executed it via soapui. In both cases, I'm seeing the correct value come back in the response, but for some reason .NET is not reading it. Do I need to set some sort of annotation to ensure .NET compatibility? I would think things are fine. I see literal in the wsdl and the server is getting the request from .NET correctly, .NET is just not parsing the response correctly apparently. _ From: Clough, Samuel (USPC.PRG.Atlanta) Sent: Thursday, July 19, 2007 11:54 AM To: cxf-user@incubator.apache.org Subject: Web Method not returning correctly I'm trying to track down a problem. I have a method that takes a long and boolean parameter and then returns a long. The method was working just fine when I was using Aegis binding with the ServerFactoryBean. For some reason, Aegis was generating invalid wsdl (another thread I posted yesterday) related to other methods in the class and since I've been unable to get Aegis to create good wsdl for the class, I just put some basic annotations on the class and hosted it using JaxB via the JaxWsServerFactoryBean. The wsdl is good and the .NET clients have no problems consuming it. However, the method in question returns the correct long value on the Java server, but the .NET client now always sees zero as the return value when it calls the service. It worked properly before using Aegis binding and I know the long value is still being populated correctly from the logs. I'm assuming this is some sort of serialization issue, but is there an annotation I'm missing? Where should I be looking for the problem? The signature for the method in question is: @WebMethod public @WebResult(name=completedLogId) long finishImport(@WebParam(name=logId) long logId, @WebParam(name=rejectsOccurred)boolean rejectsOccurred) throws Exception The full wsdl for the service is: ?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://services.afp.prg.com/; xmlns:ns2=http://schemas.xmlsoap.org/soap/http; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=AFPManagerServiceService targetNamespace=http://services.afp.prg.com/; wsdl:types xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns=http://services.afp.prg.com/; attributeFormDefault=unqualified elementFormDefault=unqualified targetNamespace=http://services.afp.prg.com/; xs:complexType name=afpImportInfo xs:sequence xs:element minOccurs=0 name=description type=xs:string/ xs:element name=id type=xs:int/ /xs:sequence /xs:complexType xs:element name=getDataWarnings type=getDataWarnings/ xs:complexType name=getDataWarnings xs:sequence xs:element minOccurs=0 name=arg0 type=xs:string/ xs:element name=arg1 type=xs:long/ xs:element name=arg2 type=xs:boolean/ /xs:sequence /xs:complexType xs:element name=getDataWarningsResponse type=getDataWarningsResponse/ xs:complexType name=getDataWarningsResponse xs:sequence xs:element maxOccurs=unbounded minOccurs=0 name=return type=xs:string/ /xs:sequence /xs:complexType xs:element name=finishImport type=finishImport/ xs:complexType name=finishImport xs:sequence xs:element name=logId type=xs:long/ xs:element name=rejectsOccurred type=xs:boolean/ /xs:sequence /xs:complexType xs:element name=finishImportResponse type=finishImportResponse/ xs:complexType name=finishImportResponse xs:sequence xs:element name=completedLogId type=xs:long/ /xs:sequence /xs:complexType xs:element name=getImports type=getImports/ xs:complexType name=getImports xs:sequence xs:element minOccurs=0 name=arg0 type=xs:string/ /xs:sequence /xs:complexType xs:element name=getImportsResponse type=getImportsResponse/ xs:complexType name=getImportsResponse xs:sequence xs:element maxOccurs=unbounded minOccurs=0 name=return type=afpImportInfo/ /xs:sequence /xs:complexType /xs:schema /wsdl:types wsdl:message name=finishImport wsdl:part element=ns1:finishImport name=parameters /wsdl:part /wsdl:message wsdl:message name=getDataWarningsResponse wsdl:part element=ns1:getDataWarningsResponse name=parameters /wsdl:part /wsdl:message wsdl:message name=finishImportResponse wsdl:part
RE: Web Method not returning correctly
I went ahead and ran wsdl2java against the current wsdl that Jaxb is generating. Should I go ahead and just use those replacement classes? -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 1:51 PM To: cxf-user@incubator.apache.org Cc: Clough, Samuel (USPC.PRG.Atlanta) Subject: Re: Web Method not returning correctly Samuel, Could you send the soap message? I'm willing to bet this is related to CXF-802 and CXF-655 which I'm still battling with. My expectation is that the completedLogId element in the response soap message is ending up qualified instead of unqualified like the schema states it should be..NET is probably just looking for the unqualified version. (as it should) The main workaround for most of the Java First cases is to run wsdl2java with the -s flag to generate the wrapper types. The runtime should then pick up those wrappers and use those which should make the messages correct. Dan On Thursday 19 July 2007 13:37, Clough, Samuel (USPC.PRG.Atlanta) wrote: Well, I've sniffed this with tcpmon and executed it via soapui. In both cases, I'm seeing the correct value come back in the response, but for some reason .NET is not reading it. Do I need to set some sort of annotation to ensure .NET compatibility? I would think things are fine. I see literal in the wsdl and the server is getting the request from .NET correctly, .NET is just not parsing the response correctly apparently. _ From: Clough, Samuel (USPC.PRG.Atlanta) Sent: Thursday, July 19, 2007 11:54 AM To: cxf-user@incubator.apache.org Subject: Web Method not returning correctly I'm trying to track down a problem. I have a method that takes a long and boolean parameter and then returns a long. The method was working just fine when I was using Aegis binding with the ServerFactoryBean. For some reason, Aegis was generating invalid wsdl (another thread I posted yesterday) related to other methods in the class and since I've been unable to get Aegis to create good wsdl for the class, I just put some basic annotations on the class and hosted it using JaxB via the JaxWsServerFactoryBean. The wsdl is good and the .NET clients have no problems consuming it. However, the method in question returns the correct long value on the Java server, but the .NET client now always sees zero as the return value when it calls the service. It worked properly before using Aegis binding and I know the long value is still being populated correctly from the logs. I'm assuming this is some sort of serialization issue, but is there an annotation I'm missing? Where should I be looking for the problem? The signature for the method in question is: @WebMethod public @WebResult(name=completedLogId) long finishImport(@WebParam(name=logId) long logId, @WebParam(name=rejectsOccurred)boolean rejectsOccurred) throws Exception The full wsdl for the service is: ?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://services.afp.prg.com/; xmlns:ns2=http://schemas.xmlsoap.org/soap/http; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=AFPManagerServiceService targetNamespace=http://services.afp.prg.com/; wsdl:types xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns=http://services.afp.prg.com/; attributeFormDefault=unqualified elementFormDefault=unqualified targetNamespace=http://services.afp.prg.com/; xs:complexType name=afpImportInfo xs:sequence xs:element minOccurs=0 name=description type=xs:string/ xs:element name=id type=xs:int/ /xs:sequence /xs:complexType xs:element name=getDataWarnings type=getDataWarnings/ xs:complexType name=getDataWarnings xs:sequence xs:element minOccurs=0 name=arg0 type=xs:string/ xs:element name=arg1 type=xs:long/ xs:element name=arg2 type=xs:boolean/ /xs:sequence /xs:complexType xs:element name=getDataWarningsResponse type=getDataWarningsResponse/ xs:complexType name=getDataWarningsResponse xs:sequence xs:element maxOccurs=unbounded minOccurs=0 name=return type=xs:string/ /xs:sequence /xs:complexType xs:element name=finishImport type=finishImport/ xs:complexType name=finishImport xs:sequence xs:element name=logId type=xs:long/ xs:element name=rejectsOccurred type=xs:boolean/ /xs:sequence /xs:complexType xs:element name=finishImportResponse type=finishImportResponse/ xs:complexType name=finishImportResponse xs:sequence xs:element name=completedLogId type=xs:long/ /xs:sequence /xs:complexType xs:element name=getImports type=getImports/ xs:complexType name=getImports xs:sequence xs:element minOccurs=0 name=arg0 type=xs:string/ /xs:sequence /xs:complexType xs:element name=getImportsResponse type=getImportsResponse/ xs:complexType name=getImportsResponse xs:sequence xs:element maxOccurs=unbounded minOccurs=0 name=return type=afpImportInfo/
RE: Web Method not returning correctly
So I should setup the JaxWsServerFactoryBean to use the generated wsdl rather than what JAXB is creating? Looking at the generated java classes from the wsdl, would just using an annotation like this on the methods fix the problem rather than needing an external wsdl? @WebResult(targetNamespace = , name = completedLogId) -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 2:21 PM To: Clough, Samuel (USPC.PRG.Atlanta) Cc: cxf-user@incubator.apache.org Subject: Re: Web Method not returning correctly Oh. shoot. I gave the wrong instructions... :-( Use the java2wsdl tool with the -s option. Not the wsdl2java tool. Sorry about that. (you can add the -classdir option if you want as well to have the generated classes compiled) Looking at the soap message, what I described is correct. The soap message is not valid according to the schema in the wsdl. Dan On Thursday 19 July 2007 14:15, Clough, Samuel (USPC.PRG.Atlanta) wrote: I went ahead and ran wsdl2java against the current wsdl that Jaxb is generating. Should I go ahead and just use those replacement classes? -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 1:51 PM To: cxf-user@incubator.apache.org Cc: Clough, Samuel (USPC.PRG.Atlanta) Subject: Re: Web Method not returning correctly Samuel, Could you send the soap message? I'm willing to bet this is related to CXF-802 and CXF-655 which I'm still battling with. My expectation is that the completedLogId element in the response soap message is ending up qualified instead of unqualified like the schema states it should be..NET is probably just looking for the unqualified version. (as it should) The main workaround for most of the Java First cases is to run wsdl2java with the -s flag to generate the wrapper types. The runtime should then pick up those wrappers and use those which should make the messages correct. Dan On Thursday 19 July 2007 13:37, Clough, Samuel (USPC.PRG.Atlanta) wrote: Well, I've sniffed this with tcpmon and executed it via soapui. In both cases, I'm seeing the correct value come back in the response, but for some reason .NET is not reading it. Do I need to set some sort of annotation to ensure .NET compatibility? I would think things are fine. I see literal in the wsdl and the server is getting the request from .NET correctly, .NET is just not parsing the response correctly apparently. _ From: Clough, Samuel (USPC.PRG.Atlanta) Sent: Thursday, July 19, 2007 11:54 AM To: cxf-user@incubator.apache.org Subject: Web Method not returning correctly I'm trying to track down a problem. I have a method that takes a long and boolean parameter and then returns a long. The method was working just fine when I was using Aegis binding with the ServerFactoryBean. For some reason, Aegis was generating invalid wsdl (another thread I posted yesterday) related to other methods in the class and since I've been unable to get Aegis to create good wsdl for the class, I just put some basic annotations on the class and hosted it using JaxB via the JaxWsServerFactoryBean. The wsdl is good and the .NET clients have no problems consuming it. However, the method in question returns the correct long value on the Java server, but the .NET client now always sees zero as the return value when it calls the service. It worked properly before using Aegis binding and I know the long value is still being populated correctly from the logs. I'm assuming this is some sort of serialization issue, but is there an annotation I'm missing? Where should I be looking for the problem? The signature for the method in question is: @WebMethod public @WebResult(name=completedLogId) long finishImport(@WebParam(name=logId) long logId, @WebParam(name=rejectsOccurred)boolean rejectsOccurred) throws Exception The full wsdl for the service is: ?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://services.afp.prg.com/; xmlns:ns2=http://schemas.xmlsoap.org/soap/http; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=AFPManagerServiceService targetNamespace=http://services.afp.prg.com/; wsdl:types xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns=http://services.afp.prg.com/; attributeFormDefault=unqualified elementFormDefault=unqualified targetNamespace=http://services.afp.prg.com/; xs:complexType name=afpImportInfo xs:sequence xs:element minOccurs=0 name=description type=xs:string/ xs:element name=id type=xs:int/ /xs:sequence /xs:complexType xs:element name=getDataWarnings type=getDataWarnings/ xs:complexType name=getDataWarnings xs:sequence xs:element minOccurs=0 name=arg0 type=xs:string/ xs:element name=arg1 type=xs:long/
Re: JAX-WS/annotated SOAP services -- exporting implementation methods rather than interface ones?
Confirmed as a bug and logged as: https://issues.apache.org/jira/browse/CXF-813 I'm testing a fix now. Dan On Thursday 19 July 2007 04:49, Stuart Bingë wrote: Hi Dan, On Wednesday 18 July 2007 23:10:46 Dan Diephouse wrote: Hi Stuart, Did you specify a @WebService(endpointInterface=...YourInterface) on the implementation class? You're using the JAX-WS frontend and per the JAX-WS spec, thats how its supposed to work :-) Yeah, I've got my implementation class pointing to the interface via endpointInterface -- I pretty much copied and pasted the example from that page, then tried to add a property to the implementation class. Here's my current test code, if it helps: Interface: @WebService(name = HelloWorld) @SOAPBinding(style=Style.RPC, use=Use.LITERAL) public interface HelloWorld { String sayHi(@WebParam(name = text) String text); } Implementation: @WebService(endpointInterface = showcase.cxf.HelloWorld) public class HelloWorldImpl implements HelloWorld { private String prefix = *** unspecified ***; @Override public String sayHi(@WebParam(name = text) String text) { return prefix + text; } @WebMethod(exclude = true) public String getPrefix() { return prefix; } @WebMethod(exclude = true) public void setPrefix(String prefix) { this.prefix = prefix; } } So essentially the problem is if you take out the @WebMethod(exclude = true) on the getter and setter, they're included in the generated WSDL as methods of the service :-/ Cheers, - Dan On 7/18/07, Stuart Bingë [EMAIL PROTECTED] wrote: Hello all, We've been using XFire (specifically its SOAP transport) together with JSR-181 annotations for some time now in our internal Spring-based web services (hosted in Tomcat), and are now in the process of looking to upgrade to CXF as part of a general systems upgrade. The web services are java-first, where we code to a SEI and then rely on XFire to generate the WSDL as appropriate. In addition, the SOAP binding used is RPC/Literal for interoperability with PHP clients. After following the Writing a service with Spring article on the CXF site (http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.ht ml), as well as attempting the basic HelloWorld applet that the article describes (i.e. separate from our existing environment/services), I've discovered some strange behaviour that wasn't present with XFire. When exposing an endpoint via jaxws:endpoint ... /, the generated WSDL appears to be coming from the implementation class rather than the service interface -- i.e. getters and setters for implementation-specific properties are included in the WSDL. Is this the expected behaviour with jaxws:endpoint /? If so, what other methods are available/recommended for exposing an endpoint via an interface rather than an implementation object? This can be solved with @WebMethod(ignore = true) annotations on the implementation class, but obviously this isn't ideal and shouldn't be needed in the first place. We'd like to continue just exposing the interface as the service contract and then be able to implement the service in whatever way we deem fit. Any pointers would be greatly appreciated! Cheers, -- Stuart Bingë __ Complinet Ltd is registered in England. Registered office at Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Company number 3170722. VAT No. 749 324 021. Complinet Inc is a corporation registered in Delaware, USA. This email has been scanned by the MessageLabs Email Security System. __ Complinet Ltd is registered in England. Registered office at Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Company number 3170722. VAT No. 749 324 021. Complinet Inc is a corporation registered in Delaware, USA. This email has been scanned by the MessageLabs Email Security System. -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: spring injection with jaxws:endpoint
Hi, Sorry for the late reply, I was away on business. Anyway, both solutions solve my problem, thanks. Regards Marc On 7/16/07, Holger Stolzenberg [EMAIL PROTECTED] wrote: For me this worked: bean id=CustomerServiceImpl class=com.domain.CustomerServiceImpl property name=daoProxyProvider ref=DaoProxyProvider/ property name=eventManager ref=EventManager/ /bean jaxws:endpoint id=CustomerService address=/CustomerService jaxws:implementor bean parent=CustomerServiceImpl / /jaxws:implementor /jaxws:endpoint -Ursprüngliche Nachricht- Von: Dan Diephouse [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Juli 2007 23:11 An: cxf-user@incubator.apache.org Betreff: Re: spring injection with jaxws:endpoint I believe this is what you want: bean id=foo class=com.test.testServiceImpl property name=testDAO ref bean=TestDAO / /bean jaxws:endpoint id=testService implementor=#foo address= /MyTestService Hope that helps :-) - Dan On 7/13/07, Marc Preddie [EMAIL PROTECTED] wrote: Hi, I have exposed a web service using cxf using the systex below, and it works fine jaxws:endpoint id=testService implementor=com.test.testServiceImpl address= /MyTestService /jaxws:endpoint What I then did was to actully make the service do something (access a database through hibernate), so I wanted to inject my SpringDAO into my service. This is where I get lost I tried the systax below, but to no avial. (of course TestDAO is defined within the spring xml config...) jaxws:endpoint id=testService implementor=com.test.testServiceImpl address= /MyTestService property name=testDAO ref bean=TestDAO //property /jaxws:endpoint I tried many differnt things with no success and I was wondering whether or not anyone has done this and how they did it. BTW. I'm using Java 6, CXF 2.0 and Spring 2.1 Regards Marc -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
Back to a really basic question: using CXF+Spring to deploy a JAX-WS+Aegis service behind a servlet container.
Before I started discovering various issues in the migration from xfire to cxf, my original goal was to wrap up a service of mine for deployment in a servlet container. The code of my service is set up to use Spring to wire together various of its bits and pieces. I'm looking at the macros defined in the samples, and I see one or two things that give me a pause. They don't look that much like http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html. Should I just follow the wiki and ignore the samples?
RE: Web Method not returning correctly
Can I set the wsdl and the the service bean? I'm getting an error when it loads the wsdl saying it can't find the service, but that maybe since java2wsdk splits the wsdl into two files and maybe it's not loading the second one. -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 2:21 PM To: Clough, Samuel (USPC.PRG.Atlanta) Cc: cxf-user@incubator.apache.org Subject: Re: Web Method not returning correctly Oh. shoot. I gave the wrong instructions... :-( Use the java2wsdl tool with the -s option. Not the wsdl2java tool. Sorry about that. (you can add the -classdir option if you want as well to have the generated classes compiled) Looking at the soap message, what I described is correct. The soap message is not valid according to the schema in the wsdl. Dan On Thursday 19 July 2007 14:15, Clough, Samuel (USPC.PRG.Atlanta) wrote: I went ahead and ran wsdl2java against the current wsdl that Jaxb is generating. Should I go ahead and just use those replacement classes? -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Thursday, July 19, 2007 1:51 PM To: cxf-user@incubator.apache.org Cc: Clough, Samuel (USPC.PRG.Atlanta) Subject: Re: Web Method not returning correctly Samuel, Could you send the soap message? I'm willing to bet this is related to CXF-802 and CXF-655 which I'm still battling with. My expectation is that the completedLogId element in the response soap message is ending up qualified instead of unqualified like the schema states it should be..NET is probably just looking for the unqualified version. (as it should) The main workaround for most of the Java First cases is to run wsdl2java with the -s flag to generate the wrapper types. The runtime should then pick up those wrappers and use those which should make the messages correct. Dan On Thursday 19 July 2007 13:37, Clough, Samuel (USPC.PRG.Atlanta) wrote: Well, I've sniffed this with tcpmon and executed it via soapui. In both cases, I'm seeing the correct value come back in the response, but for some reason .NET is not reading it. Do I need to set some sort of annotation to ensure .NET compatibility? I would think things are fine. I see literal in the wsdl and the server is getting the request from .NET correctly, .NET is just not parsing the response correctly apparently. _ From: Clough, Samuel (USPC.PRG.Atlanta) Sent: Thursday, July 19, 2007 11:54 AM To: cxf-user@incubator.apache.org Subject: Web Method not returning correctly I'm trying to track down a problem. I have a method that takes a long and boolean parameter and then returns a long. The method was working just fine when I was using Aegis binding with the ServerFactoryBean. For some reason, Aegis was generating invalid wsdl (another thread I posted yesterday) related to other methods in the class and since I've been unable to get Aegis to create good wsdl for the class, I just put some basic annotations on the class and hosted it using JaxB via the JaxWsServerFactoryBean. The wsdl is good and the .NET clients have no problems consuming it. However, the method in question returns the correct long value on the Java server, but the .NET client now always sees zero as the return value when it calls the service. It worked properly before using Aegis binding and I know the long value is still being populated correctly from the logs. I'm assuming this is some sort of serialization issue, but is there an annotation I'm missing? Where should I be looking for the problem? The signature for the method in question is: @WebMethod public @WebResult(name=completedLogId) long finishImport(@WebParam(name=logId) long logId, @WebParam(name=rejectsOccurred)boolean rejectsOccurred) throws Exception The full wsdl for the service is: ?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://services.afp.prg.com/; xmlns:ns2=http://schemas.xmlsoap.org/soap/http; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=AFPManagerServiceService targetNamespace=http://services.afp.prg.com/; wsdl:types xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns=http://services.afp.prg.com/; attributeFormDefault=unqualified elementFormDefault=unqualified targetNamespace=http://services.afp.prg.com/; xs:complexType name=afpImportInfo xs:sequence xs:element minOccurs=0 name=description type=xs:string/ xs:element name=id type=xs:int/ /xs:sequence /xs:complexType xs:element name=getDataWarnings type=getDataWarnings/ xs:complexType name=getDataWarnings xs:sequence xs:element minOccurs=0 name=arg0 type=xs:string/ xs:element name=arg1 type=xs:long/ xs:element name=arg2 type=xs:boolean/ /xs:sequence /xs:complexType xs:element
Re: Back to a really basic question: using CXF+Spring to deploy a JAX-WS+Aegis service behind a servlet container.
Hi Benson, FYI, I just know Willem update this wiki page today. So what I see may not same as you saw. Best Regards Freeman Freeman Fang wrote: Hi Benson, I think you should follow spring_http sample. The doc from wiki might out of date, but the working demo is more believable. :-) Btw, I roughly check this wiki page and spring_http sample, they are pretty much match with each other. Would you please mark what kind of macros defined in the sample is not match the wiki, so that we can update the wiki. Best Regards Freeman Benson Margulies wrote: Before I started discovering various issues in the migration from xfire to cxf, my original goal was to wrap up a service of mine for deployment in a servlet container. The code of my service is set up to use Spring to wire together various of its bits and pieces. I'm looking at the macros defined in the samples, and I see one or two things that give me a pause. They don't look that much like http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html. Should I just follow the wiki and ignore the samples?
Re: Returning a java map
Hi Jim - I partially fix this, I change the data binding to Aegis (now the map has a type in the WSDL) but now I get a different problem with wsdl2java The WSDL looks very similar at the one generated by xFire I think there is a problem with the WSDL namespaces but I'm not sure what. This is the WSDL: ?xml version=1.0 encoding=utf-8? wsdl:definitions name=MetadataService targetNamespace=http:// lor.rbx.com/ws/metadata xmlns:ns1=http://lor.rbx.com/ws/metadata; xmlns:ns2=urn:com:rbx:lor:ws:model xmlns:ns3=http://util.java; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http:// schemas.xmlsoap.org/wsdl/ xmlns:xsd=http://www.w3.org/2001/XMLSchema; wsdl:types schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http:// metadata.core.lor.rbx.com xmlns=http://www.w3.org/2001/XMLSchema; simpleType name=DocumentLanguage restriction base=string enumeration value=Any/ enumeration value=English/ /restriction /simpleType simpleType name=DocumentDegreeInteractivity restriction base=string enumeration value=Any/ enumeration value=VeryLow/ enumeration value=Low/ enumeration value=Medium/ enumeration value=High/ enumeration value=VeryHigh/ /restriction /simpleType simpleType name=DocumentFormat restriction base=string enumeration value=Any/ enumeration value=HTML_XHTML/ enumeration value=SHOWCKWAVE_FLASH/ enumeration value=FLASH_VIDEO/ enumeration value=JPEG/ enumeration value=GIF/ enumeration value=MPEG/ enumeration value=PDF/ enumeration value=MSWORD/ enumeration value=MSEXCEL/ enumeration value=MSPOWERPOINT/ enumeration value=XML/ /restriction /simpleType simpleType name=DocumentDifficulty restriction base=string enumeration value=Any/ enumeration value=VeryLow/ enumeration value=Low/ enumeration value=Medium/ enumeration value=High/ enumeration value=VeryHigh/ /restriction /simpleType simpleType name=DocumentLearningResourceType restriction base=string enumeration value=Any/ enumeration value=Excercise/ enumeration value=Simulation/ enumeration value=Questionnaire/ enumeration value=Diagram/ enumeration value=Figure/ enumeration value=Graph/ enumeration value=Index/ enumeration value=Slide/ enumeration value=Table/ enumeration value=NarrativeText/ enumeration value=Exam/ enumeration value=Experiment/ enumeration value=ProblemStatement/ enumeration value=SelfAssesment/ /restriction /simpleType simpleType name=DocumentIntendedEndUser restriction base=string enumeration value=Any/ enumeration value=Teacher/ enumeration value=Author/ enumeration value=Learner/ enumeration value=Manager/ /restriction /simpleType simpleType name=Context restriction base=string enumeration value=Any/ enumeration value=PrimaryEducation/ enumeration value=SecondaryEducation/ enumeration value=HigherEducation/ enumeration value=UniversityFirstCycle/ enumeration value=UniversitySecondCycle/ enumeration value=UniversityPostgrade/ enumeration value=TechnicalSchoolFirstCycle/ enumeration value=TechnicalSchoolSecondCycle/ enumeration value=ProfessionalFormation/ enumeration value=ContinuousFormation/ enumeration value=VocationalTraining/ /restriction /simpleType simpleType name=DocumentStatus restriction base=string enumeration value=Any/ enumeration value=Draft/ enumeration value=Final/ enumeration value=Revised/ enumeration value=Unavailable/ /restriction /simpleType simpleType name=DocumentInteractivityType restriction base=string enumeration value=Any/ enumeration value=Active/ enumeration value=Expositive/ enumeration value=Mixed/ enumeration value=Undefined/ /restriction /simpleType /schema schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://lor.rbx.com/ws/ metadata xmlns=http://www.w3.org/2001/XMLSchema; complexType name=anyType2anyTypeMap sequence element maxOccurs=unbounded minOccurs=0 name=entry complexType sequence element minOccurs=0 name=key type=anyType/ element minOccurs=0 name=value type=anyType/ /sequence /complexType /element /sequence /complexType /schema schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=urn:com:rbx:lor:ws:model xmlns=http://www.w3.org/ 2001/XMLSchema xmlns:ns0=http://util.java; xmlns:ns1=http:// metadata.core.lor.rbx.com complexType name=User sequence element minOccurs=0 name=firstName nillable=true type=string/ element minOccurs=0 name=id nillable=true type=ns0:UUID/ element minOccurs=0 name=lastName nillable=true type=string/ any maxOccurs=unbounded/ /sequence /complexType complexType name=Metadata sequence element minOccurs=0 name=ageFrom type=int/ element minOccurs=0 name=ageTo type=int/ element minOccurs=0 name=context nillable=true type=ns1:Context/ element minOccurs=0 name=coverage nillable=true type=ns3:Coverage/ element minOccurs=0 name=creator nillable=true type=ns3:User/ element minOccurs=0 name=degreeInteractivity nillable=true type=ns1:DocumentDegreeInteractivity/ element minOccurs=0 name=description nillable=true type=string/ element
Re: Error trying to run client against web service with Header
Hi, I think this issue is fixed by James couple days before .(http://svn.apache.org/viewvc?view=revrev=554819*)* . Did you used the lastest cxf kit ? Cheers Jim kranga wrote: Can someone please attempt to duplicate this and help me debug the root cause. The error is with the geenrated code without changes. The WSDL is readily accessible at the location (you don't have to register) and the error happens on calling the SoapPort implementation. Any help is appreciated. Thanks - Original Message - From: kranga [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Sent: Thursday, July 19, 2007 1:52 PM Subject: Error trying to run client against web service with Header I'm trying to build a webservice against the WSDL at http://www.xignite.com/xRealTime.asmx?WSDL I generated the client using wsdl2Java included the -exsh flag. However, when I run the SOAP client, I get the following exception: Note: The web service works perfectly when I access from Axis2 generated client, but I'd really like to use CXF. So please help! EXCEPTION STACK TRACE: Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find a message part matching name {http://www.xignite.com/services/}Header. Possible values are [{http://www.xignite.com/services/}Time, {http://www.xignite.com/services/}Symbol, http://www.xignite.com/services/}Exchange]. at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(Jax WsServiceFactoryBean.java:393) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(Jax WsServiceFactoryBean.java:371) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation (JaxWsServiceFactoryBean.java:187) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOp erations(ReflectionServiceFactoryBean.java:303) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation s(JaxWsServiceFactoryBean.java:196) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFrom WSDL(ReflectionServiceFactoryBean.java:195) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServic eModel(ReflectionServiceFactoryBean.java:246) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflectio nServiceFactoryBean.java:136) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpo intFactory.java:83) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean .java:82) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:320) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:238)
Re: REST on servlet
You can read the doc[1] and try the sample in CXF_HOME\samples\restful_http_binding [1] http://cwiki.apache.org/CXF20DOC/http-binding.html Cheers, Willem. Mansour Raad wrote: I've seen the example where a SOAP endpoint is published using a Servlet. Can somebody please point me to how to create REST endpoint that produces JSON ? Thanks. Mansour :-)