java-metro-framework

JAXB marshals XML differently to OutputStream vs. StringWriter

最后都变了- 提交于 2019-12-06 20:24:49
问题 I apologize if this has been answered, but the search terms I have been using (i.e. JAXB @XmlAttribute condensed or JAXB XML marshal to String different results ) aren't coming up with anything. I am using JAXB to un/marshal objects annotated with @XmlElement and @XmlAttribute annotations. I have a formatter class which provides two methods -- one wraps the marshal method and accepts the object to marshal and an OutputStream , the other just accepts the object and returns the XML output as a

WSDL Requests with Metro/JAX-WS/WSIT During Runtime

*爱你&永不变心* 提交于 2019-12-06 14:54:46
问题 During runtime, JAX-WS fetches the WSDL of a SOAP endpoint even though it already ran wsimport in the IDE. This behavior is illustrated here: http://jax-ws.java.net/faq/index.html#wsdl_at_runtime Is there a limit to amount of metadata that a client can retrieve during runtime? If so, is there a way to increase this limit? Please note that I am not referring to running wsimport inside the IDE; that works fine. I'm specifically talking about fetching the WSDL metadata during runtime. 回答1: After

IntelliJ Web Client Errors

僤鯓⒐⒋嵵緔 提交于 2019-12-06 14:03:41
问题 I'm trying to create a Java web service client with IntelliJ IDEA, but am getting errors. My web service "MagicEightBall" is a minimalistic service that has one method: "GetAdvice", which takes no arguments and returns a string. When I use IntelliJ to create a WebServices client (using GlashFish / JAXWS 2.X RI / Metro 1.X / JWSDP 2.0 ), I get the following code: public class HelloWorldClient { public static void main(String[] argv) { pakeightball.IMagicEightBallService service = new

Staying DRY with JAXB

纵饮孤独 提交于 2019-12-05 16:23:12
I'm developing a number of Java classes that must serialize to XML in the following format: <foo value="123"/> <!-- or this --> <bar value="abc"/> <!-- or this --> <baz value="true"/> In the beginning, Foo.java looked something like this: @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) class Foo { @XmlAttribute String value; // snip constructors // snip methods // getValue // equals, hashCode, toString // static valueOf(String), static valueOf(int) } It doesn't take much imagination to guess what Bar.java and Baz.java might look like. These are very simple wrapper classes for (in this

JAXB marshals XML differently to OutputStream vs. StringWriter

主宰稳场 提交于 2019-12-05 01:54:57
I apologize if this has been answered, but the search terms I have been using (i.e. JAXB @XmlAttribute condensed or JAXB XML marshal to String different results ) aren't coming up with anything. I am using JAXB to un/marshal objects annotated with @XmlElement and @XmlAttribute annotations. I have a formatter class which provides two methods -- one wraps the marshal method and accepts the object to marshal and an OutputStream , the other just accepts the object and returns the XML output as a String. Unfortunately, these methods do not provide the same output for the same objects. When

WSDL Requests with Metro/JAX-WS/WSIT During Runtime

折月煮酒 提交于 2019-12-04 20:51:32
During runtime, JAX-WS fetches the WSDL of a SOAP endpoint even though it already ran wsimport in the IDE. This behavior is illustrated here: http://jax-ws.java.net/faq/index.html#wsdl_at_runtime Is there a limit to amount of metadata that a client can retrieve during runtime? If so, is there a way to increase this limit? Please note that I am not referring to running wsimport inside the IDE; that works fine. I'm specifically talking about fetching the WSDL metadata during runtime. After many long hours spent on this problem, we came up with a solution. I was working in a Glassfish environment

Programmatically read encrypted error messages from webservice using metro 2.3

风格不统一 提交于 2019-12-04 19:44:59
Using METRO 2.3 in Netbeans with WS-Security I try to read error messages of an encrypted webservice. The communication works fine until my payload contains errors. Then the server sends an encrypted error message with the information what went wrong. My client tries to decrypt it and understands that the message got another structure than expected and throws an XMLSignatureException: javax.xml.crypto.dsig.XMLSignatureException: WSS1717: Error occurred while doing digest verification of body/payload The error message that was send by the server is hidden. The exception is thrown here in line

IntelliJ Web Client Errors

江枫思渺然 提交于 2019-12-04 19:12:29
I'm trying to create a Java web service client with IntelliJ IDEA, but am getting errors. My web service "MagicEightBall" is a minimalistic service that has one method: "GetAdvice", which takes no arguments and returns a string. When I use IntelliJ to create a WebServices client (using GlashFish / JAXWS 2.X RI / Metro 1.X / JWSDP 2.0 ), I get the following code: public class HelloWorldClient { public static void main(String[] argv) { pakeightball.IMagicEightBallService service = new MagicEightBallService().(); //invoke business method service.getAdvice(); } } I tried this with a WCF

Webservice - client service instantiation

醉酒当歌 提交于 2019-12-04 10:17:18
问题 Do you know how costly is to create a webservice client service instance ? JavaWebService service = new JavaWebService(); SomePort port = service.getJavaWebServicePort(); Creating the service once and after that reusing same port in a multi threaded environment (webapp) is not dangerous ? Read that the port getPort and port itself is not thread safe but also creating each time a service it might be problematic if it is a costly operation. Any idea ? THanks 回答1: In the JAX-WS reference

Using Glassfish libraries in proprietary software [closed]

白昼怎懂夜的黑 提交于 2019-12-03 13:37:25
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. I would like to use some parts of Glassfish in a proprietary software that are under a CDDL + GPLv2 license. Am I allowed to do that? I haven't modified anything in the code of these libraries, so is this OK, or my software, because it uses these libraries, is still considered derivative work, and thus a big no-no? I mean, according to http://jaxb.java.net/ , JAXB is also under CDDL + GPLv2, but I know I can freely use