jax-ws

jax-ws change Content-type to Content-Type because server is hyper sensitive

喜夏-厌秋 提交于 2020-01-10 10:17:07
问题 I have to connect to a poorly implemented server that only understands Content-Type (capital-T) and not Content-type . How can I ask my JAX-WS client to send Content-Type ? I've tried: Map<String, List<String>> headers = (Map<String, List<String>>) ((BindingProvider)port).getRequestContext().get(MessageContext.HTTP_REQUEST_HEADERS); But headers is null . What am I doing wrong? 回答1: I have to connect to a poorly implemented server that only understands Content-Type(capital-T) and not Content

JAXWS Soap Handler Large MTOM Attachments

血红的双手。 提交于 2020-01-10 05:51:07
问题 The JAXWS implementation within IBM WebSphere 7 and 8 appears to have some problems when it comes to soap handlers and large MTOM attachments. It appears that the entire message, including all attachment binary content, is read into memory when getMessage() is invoked on the SOAPMessageContext object. This can very easily cause the JVM to run out of available memory. @Override public boolean handleMessage(SOAPMessageContext context) { SOAPMessage soapMsg = context.getMessage(); ... } In the

Getting raw XML response from Java web service client

前提是你 提交于 2020-01-10 05:48:25
问题 I am trying to get the raw XML response from a web service, instead of the usual set of POJOs. I am using a webservice client that I generated (so I have access to the client's code) from a WSDL and some schemas. The client is generated in RAD 7.5, I think using JAX-WS. I've been looking at the client code itself, but I'm not even sure if the client code ever handles raw XML or if it passes it off to other libraries. 回答1: You can do it using javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws

How to make generated classes contain Javadoc from XML Schema documentation

我只是一个虾纸丫 提交于 2020-01-09 04:38:05
问题 I'm currently working with an XML Schema that has <xsd:annotation> / <xsd:documentation> on most types and elements. When I generate Java Beans from this XML Schema, then the Javadoc of those Beans only contains some generic generated information about the allowed content of the type/element. I'd like to see the content of the <xsd:documentation> tag in the relevant places (for example the content of that tag for a complextType should show up in the Javadoc of the class generated to represent

JAX-WS + Spring 开发webservice

做~自己de王妃 提交于 2020-01-09 02:37:36
通过几天的时间研究了下使用jax-ws来开发webservice,看了网上的一些资料总结出jax-ws的开发大概分为两种。 以下项目使用的spring3.0,jar包可以到官网下载 第一种:使用独立的端口(指端口可以在spring中自定义配置)   首先说第一种方式,这种方式不需要添加额外的jar包,他使用的是JDK自带的JWS来实现的。 web.xml文件配置: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>JAXWSExample</display-name> <!-- applicationContext*.xml文件在src目录下的conf文件夹中--> <context-param> <param-name

Spring整合JAX-WS

你。 提交于 2020-01-08 22:39:43
  Jax-ws在使用上很方便,也很轻量级。重点是他是jvnet(dev.java.net)的项目,是基于java标准的(JSR181)。   不过它与Spring的整合相对麻烦,于此,我将自己的一些研究结果贴出来以供备忘和后来者参考。   首先我们要有组件支持,包括三部分(我们需要他们的jar包):      Spring      jax-ws      jaxws commons spring   Spring就不用说了,如果大家使用MyEclipse的话就直接添加支持。   jax-ws的jar包可以再网站上下载,或者搜索下载“jax-ws 2.2”。   jaxws commons spring的jar包是中间件,这个可能不好下载,如果不适用maven的话可能就只能在网络上搜索下载“jaxws-spring-1.8”(包含不只一个jar包哦)。      然后我们导入jar包并创建web项目。         然后编写一个测试WebService类: 1 package org.coderecord.blog; 2 3 import javax.jws.WebMethod; 4 import javax.jws.WebService; 5 import javax.jws.soap.SOAPBinding; 6 import javax.jws.soap

Changing the default XML namespace prefix generated with JAXWS

核能气质少年 提交于 2020-01-08 21:40:12
问题 I am using JAXWS to generate a WebService client for a Java Application we're building. When JAXWS build its XMLs to use in SOAP protocol, it generates the following namespace prefix: <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body ...> <!-- body goes here --> </env:Body> </env:Envelope> My problem is that my Counterpart (a big money transfer company) which manages the server my client is connecting to, refuses to accept the WebService call ( please don't ask my

Changing the default XML namespace prefix generated with JAXWS

Deadly 提交于 2020-01-08 21:39:46
问题 I am using JAXWS to generate a WebService client for a Java Application we're building. When JAXWS build its XMLs to use in SOAP protocol, it generates the following namespace prefix: <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body ...> <!-- body goes here --> </env:Body> </env:Envelope> My problem is that my Counterpart (a big money transfer company) which manages the server my client is connecting to, refuses to accept the WebService call ( please don't ask my

JAX-WS 与XFire比较

社会主义新天地 提交于 2020-01-08 09:54:21
【说明】 本文我将通过三个简单的小实验来验证 jax-ws 和 XFire 在发布和调用 WebService 上的区别,从而得出相应的结论以便在以后使用他们发布和调用 WebService 时作为进行选择的依据。 【实验】 [Experiment1] : 调用 WebService 的 Client 端采用 jax-ws 调用 XFire 发布的 WebService ;( Project : XfireJax ) 流程: 1) 建立 JavaProject ; 2) 建立 WebServiceClient : (1) Other è MyEclipse è WebServices è WebServiceClient ; (2) “ Strategy ”只能选 jax-ws (不能选 XFire ); (3) 选用 WSDL URL ;(( 3 )( 4 )两步表示只能用 jax-ws 采用 WSDL 解析的方式来调用 WebService ); (4) 下一步会提示加入 jax-ws 的包; (5) “ Finish ”后会自动产生很多的类; 3) 手动设计本地调用 WebService 的类,流程: (1) 实例化一个 Service : NumberPlusService srvc = new NumberPlusService() (2) 生成该 WebService

wsdl with conflicting xsd imports

↘锁芯ラ 提交于 2020-01-06 15:29:33
问题 I tried to find a solution for some time to the following problem. I have a wsdl file containing several (6) xsd imports. I cannot change these xsd's because they are external to my project. There are 4 definitions all together which are slightly defined different in 2 of these schemas. I was attempting to translate each 'conflicting' xsd schema to it's own package. I tried following bindings, but it did not do the job: testbindings.jaxb: <bindings xmlns="http://java.sun.com/xml/ns/jaxb"