cxf

generate xsd from xml [duplicate]

丶灬走出姿态 提交于 2019-12-21 21:39:37
问题 This question already has answers here : Any tools to generate an XSD schema from an XML instance document? [closed] (10 answers) Closed 6 years ago . I need a tool to automatically generate an xsd from an xml file. Are there tools that do this? How does it work? Thanks! 回答1: There are several tools such as Altova. If you would like to do this command line or in code trang is a good option. 回答2: Most "big" XML editors boast this feature but in my experience, none can really deliver. The last

Apache CXF web services problems

时间秒杀一切 提交于 2019-12-21 20:54:15
问题 I have a multi-module project using Maven. On one of the modules I have several web services developed using Apache CXF Framework 2.5.4. At the moment I have two "problems" or questions. First of all, if I call to a method of one of the web services that should return a List, if the list is empty, it returns "null" instead of the empty list. I was trying to find out what could be the problem, if it's a bug of the CXF version I'm using or if I should use some annotation to modify the

how to throw a 403 error in Apache CXF - Java

不想你离开。 提交于 2019-12-21 20:46:44
问题 I am using the following code based on having an interceptor. When check returns true I want to throw a 403 error: @Override public void handleMessage(Message arg0) throws Fault { HttpServletRequest request = context.getHttpServletRequest(); if(check(request)){ // currently not working throw "Fault"; } I want to throw a 403 error. How do I go about doing that from this situation? I am a little confused about how "throws fault" works. Any help is appreciated 回答1: CXF will default the status

How can I prevent Apache CXF from sending a response message?

陌路散爱 提交于 2019-12-21 20:43:30
问题 In cases where a given SOAP header element has a given value (for example, if the value of the header tag "response" is "0"), I don't want Apache CXF to return a response at all. How can I do this? It appears that CXF makes the assumption that all calls will receive a response. (I know this seems strange in a web services context, but if your transport is JMS, it seems less strange). 回答1: I've been able to do this with an interceptor that aborts the interceptor chain. I've tested this with an

How to disable chunking in cxf webservice on server-side?

社会主义新天地 提交于 2019-12-21 20:39:44
问题 I need to disable chunking in cxf webservice on server-side as some clients need 'Content-Length' header in response. Now i can see 'Transfer-Encoding' is 'chunked' in server response and no 'Content-Length' header is sent. I've found that chunkins can be disabled in spring's context like this: <http-conf:conduit name="*.http-conduit"> <http-conf:client ReceiveTimeout=“300000“ AllowChunking="false"/> </http-conf:conduit> Since i'm creating services programmatically like this: // media service

latest CXF with Spring: WARNING: javax.ws.rs.NotFoundException

三世轮回 提交于 2019-12-21 20:24:24
问题 I am able to access REST services from the browser url: http://localhost:8080/assignment/services/services/test/test1 From My servlet, I use to call service method as shown below. Now I need to call through REST services but getting below error. URL url = new URL("http://localhost:8080/assignment/services/services/"+userName+"/"+password); System.out.println("URL-->"+url); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection

Using CXF web service from java web start

▼魔方 西西 提交于 2019-12-21 17:48:58
问题 UPDATE: I have submitted my question to the CXF User's mailing list, here . UPDATE: I have currently signed all of my jars. I still can't seem to get CXF setup in a way that it can find the WSDL. My last attempt was to place the WSDL inside of my WAr file so I can access it through a web browser. I set the wsdllocation inside of the client to the URL (http://www.example.com/app/example.wsdl). I am now getting the following exception: Exception in thread "AWT-EventQueue-0" java.lang

Apache CXF Exception: java.lang.RuntimeException: Could not find conduit initiator for address

余生颓废 提交于 2019-12-21 09:38:29
问题 I want call a .net SOAP web service from java. .net Service has ws-security module and I used apache CXF for setting username and password (and maybe later X.509 certificate). The code I used is: ITaxOrganService wsHttpBindingITaxOrganService = new TaxOrganService().getWSHttpBindingITaxOrganService(); Endpoint endpoint = ClientProxy.getClient(wsHttpBindingITaxOrganService).getEndpoint(); Map<String,Object> outProps = new HashMap<>(); outProps.put(WSHandlerConstants.ACTION,WSHandlerConstants

CXF 2.2.12: How to turn off schema validation on the client side

心已入冬 提交于 2019-12-21 08:54:56
问题 I would like to turn off schema validation for JAXB-bound messages. I am dealing with the client-side CXF code (WSDL first generation). I have tried using <jaxws:client name="{http://apache.org/hello_world_soap_http}SoapPort" createdFromAPI="true"> <jaxws:properties> <entry key="schema-validation-enabled" value="true" /> </jaxws:properties> </jaxws:client> Without success (see reference CXF FAQ ). I've had difficulty finding a programmatic way of settings this property. I've also explored

CXF 2.2.12: How to turn off schema validation on the client side

自作多情 提交于 2019-12-21 08:54:52
问题 I would like to turn off schema validation for JAXB-bound messages. I am dealing with the client-side CXF code (WSDL first generation). I have tried using <jaxws:client name="{http://apache.org/hello_world_soap_http}SoapPort" createdFromAPI="true"> <jaxws:properties> <entry key="schema-validation-enabled" value="true" /> </jaxws:properties> </jaxws:client> Without success (see reference CXF FAQ ). I've had difficulty finding a programmatic way of settings this property. I've also explored