cxf

How do you add a Soap Header defined in a wsdl to a web service client in CXF?

你离开我真会死。 提交于 2019-12-18 09:26:37
问题 I have a wsdl that defines a soap header that needs to be passed when calling the web service. The sample SOAP Header is: <soapenv:Header> <AuthenticationInfo> <userName>User</userName> <password/> </AuthenticationInfo> </soapenv:Header> CXF's wsdl2java generated an "AuthenticationInfo" java class that I can create and populate with a username and password, but I don't know the proper way to pass that to the CXF Client when calling the web service. 回答1: Well, the most simple way to do this

content not allowed in prolog exception

大兔子大兔子 提交于 2019-12-18 08:48:41
问题 I am trying to send xml to a java-based web service given to me by a third party via a c#.NET application, and I get the org.xml.sax.SAXParseException: Content is not allowed in prolog error. I have verified the xml against the schema, and I passed the memorystream I am using to hold the xml to an .xml file, then opened the file with a hex editor to make sure that there were no undesired characters in the prolog, and there are none. When opened, the first characters in the file are <?xml

Is setting up a server runtime necessary to generate a web service client with CXF in Eclipse?

佐手、 提交于 2019-12-18 08:47:31
问题 When I go to file -> new -> other -> web services -> web service client in Eclipse and select the "Web services runtime" I see "Apache CFX 2.x", but the finish button is disabled and I get the following in the dialog box: "Choose from the list of runtimes and deployment servers, or use the default settings." Do I really have to setup a server in order to generate a web service client with CXF in Eclipse? Thanks in advance. 回答1: Yes it does seem so. The CXF client runs in a "Dynamic Web

JAXB generating JAXBElement<String> instead of String

偶尔善良 提交于 2019-12-17 22:36:31
问题 I am using Apache CXF cxf-codegen-plugin Maven plugin to generate sources from WSDL file. Problem is that I get JAXBElement<String> generated instead of String . I have added the jaxb-bindings.xml file which looks like this: <jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"> <jaxb:globalBindings generateElementProperty="false"/> </jaxb:bindings> This should prevent JAXB to generate JAXBElement<String> . But it is not working I still have JAXBElement<String> generated

Caused by: java.net.SocketException: Unexpected end of file from server

陌路散爱 提交于 2019-12-17 18:58:06
问题 I am getting the below error quite intermittently when i run the WS through SOAP UI. Sometimes it does not work and then it keeps working and then again sometimes it does not work. One other issue is the test web service works fine provided by client with no issues but moment we switch to the production one it gives issues. Googled and did some changes (timeout on HttpConfig , jetty maxIdleTime) but still cant make it work :( Any ideas how i can narrow down what the issue is ? org.apache.cxf

How do I prevent JAXBElement<String> from being generated in a CXF Web Service client?

旧城冷巷雨未停 提交于 2019-12-17 10:33:28
问题 I'm trying to create a web service client using CXF to consume a WCF web service. When I use wsdl2java it generates objects with JAXBElement types instead of String. I read about using a jaxb bindings.xml file to set generateElementProperty="false" to try to fix the problem, but the web service I'm consuming contains 7 imported schemas. How can I specify the generateElementProperty="false" on all seven schemas, or is there a way to apply it to all schemas? 回答1: You have to create a binding

Server-Side XML Validation with CXF Webservice

风流意气都作罢 提交于 2019-12-17 08:53:45
问题 I'm working on an Apache CXF webservice (using JAX-WS, over SOAP). The service itself is pretty simple: receive a request, insert the request into a database, and return whether the insert was successful. I'd like to rely on XML validation to enforce a number of constraints on the request. So, my question. How do I return detailed validation errors to a client of my service? I've turned validation on server-side by configuring my endpoint. <jaxws:endpoint id="someEndpoint" implementor="

Java中一些jar包的作用

北城以北 提交于 2019-12-16 22:26:45
axis.jar SOAP引擎包 commons-discovery-0.2.jar 用来发现、查找和实现可插入式接口,提供一些一般类实例化、单件的生命周期管理的常用方法. jaxrpc.jar Axis运行所需要的组件包 saaj.jar 创建到端点的点到点连接的方法、创建并处理SOAP消息和附件的方法,以及接收和处理SOAP错误的方法. wsdl4j-1.5.1.jar Axis运行所需要的组件包 activation.jar JAF框架的jar包 annotations-api.jar 使用注解所需 jar ant.jar 用于自动化调用程序完成项目的编译,打包,测试等 aopalliance-1.0.jar 支持Spring AOP asm-2.2.3.jar ASM字节码库 asm-commons-2.2.3.jar ASM字节码库 asm-util-2.2.3.jar Java字节码操纵和分析框架 aspectjrt.jar 处理事务和AOP所需的包 aspectjweaver.jar 处理事务和AOP所需的包 axiom-api-1.2.7.jar Axis 对象模型 axiom-impl-1.2.7.jar Axis 对象模型 bcprov-jdk15-140.jar 基于java1.5 的加密算法实现 bfmclientmodel.jar

常见Jar包的用途

大憨熊 提交于 2019-12-16 14:57:51
jar包 用途 axis.jar SOAP引擎包 commons-discovery-0.2.jar 用来发现、查找和实现可插入式接口,提供一些一般类实例化、单件的生命周期管理的常用方法. jaxrpc.jar Axis运行所需要的组件包 saaj.jar 创建到端点的点到点连接的方法、创建并处理SOAP消息和附件的方法,以及接收和处理SOAP错误的方法. wsdl4j-1.5.1.jar Axis运行所需要的组件包 activation.jar JAF框架的jar包 annotations-api.jar 使用注解所需jar ant.jar 用于自动化调用程序完成项目的编译,打包,测试等 aopalliance-1.0.jar 支持Spring AOP asm-2.2.3.jar ASM字节码库 asm-commons-2.2.3.jar ASM字节码库 asm-util-2.2.3.jar Java字节码操纵和分析框架 aspectjrt.jar 处理事务和AOP所需的包 aspectjweaver.jar 处理事务和AOP所需的包 axiom-api-1.2.7.jar Axis 对象模型 axiom-impl-1.2.7.jar Axis 对象模型 bcprov-jdk15-140.jar 基于java1.5 的加密算法实现 bfmclientmodel.jar

Web service code created by CXF is not legal because of XMLGregorianCalendar?

青春壹個敷衍的年華 提交于 2019-12-14 04:18:15
问题 I have a WSDL and created a web service from it using CXF in Eclipse. The execution went fine: no output in the console, I don't know if there is a log somewhere but I could not find one. But in the service interface created, everywhere an XMLGregorianCalendar is used (as either parameter or return value), I get this error from Eclipse: Abstract class javax.xml.datatype.XMLGregorianCalendar cannot be used as a runtime class because it is not extended by a non abstract class which is suitable