webservice « jaxb « Java Enterprise Q&A





1. unmarshalling an axis generated (multiref containing) soap response with jaxb    stackoverflow.com

I'm consuming an axis 1.4 web service that returns soap responses that I want to unmarshal into my domain objects using jaxb annotations. My initial tests worked very well until ...

2. java.util.List is an interface, and JAXB can't handle interfaces    stackoverflow.com

I seemed to get the following exception when trying to deploy my application:

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of     IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
this ...

3. How do I ensure Schema Extensibility using JAXB    stackoverflow.com

If I am using JAXB as part of Metro Web Services under Glassfish v2, how do tell JAXB to add:

 <xsd:any/> and <xsd:anyAttribute/>
tags to my generated complex types so that ...

4. Marshalling polymorphic objects in JAX-WS    stackoverflow.com

I'm creating a JAX-WS type webservice, with operations that return an object WebServiceReply. The class WebServiceReply itself contains a field of type Object. The individual operations would populate that field with ...

5. JAX-WS client: JAXB required?    stackoverflow.com

I need to "dive into JAX-WS programming". So, I played around with Netbeans, after 20 or so erroneous attempts, finally managed to let a web service client execute a web service. I noticed, that ...

6. JAXB: element is named after type, not property    stackoverflow.com

Web service wsdl contains following schema:

<xs:complexType name="DocumentSearchInfo">
    <xs:sequence>
     ...
       <xs:element minOccurs="0" name="Industries" nillable="true" type="tns:ListCondition">
     ...

7. expose JAXB generated Class as WSDL web service    stackoverflow.com

I have a bunch of very simple functions. Each function has one input and one output.

OutputType function func(InputType);
The types of input/output are defined in xsd schema and generated into ...

8. wsimport multiple generated wsdl's    stackoverflow.com

I am using jbossws (with jax-ws) to serve 3 webservices generated from annotated POJOs. These 3 webservices share a few data classes and also have a common method (ping). They all reside in ...

9. EJB3 Web Services Error with JAXB    stackoverflow.com

Update: I checked the JBoss log and found the following errors:

2009-10-28 10:21:34,472 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (main) JBossWS_ejb.uhandler.pds.hsc.xyzis.com_8603663089732759450.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:MessageHeader' to a(n) 'element declaration' component.
2009-10-28 10:21:34,474 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (main) JBossWS_ejb.uhandler.pds.hsc.xyzis.com_8603663089732759450.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: ...





10. How to marshal a DataHandler annotated as @XmlAttachmentRef with JAXB?    stackoverflow.com

I'm trying to marshal an object which has a DataHandler field with JAXB (2.1.12). For streaming support, the DataHandler is annotated with @XmlAttachmentRef. Serialization and streaming over web services (Metro on ...

11. Find if InputStream of DataHandler is empty    stackoverflow.com

In my application I develop web service that get attached file. The file is mapped to DataHandler object via JaxB, and I have access to the file via DataHandler.getInputStream() My problem is this: When the ...

12. What Java type to use to represent a currency value in a web service?    stackoverflow.com

I'm creating a web service in Java that will be consumed by an external application, probably written in C#. In my Purchase bean, I have a Currency object for the ...

13. Generating Java Exceptions from XSD / binding Exceptions with JAXB2    stackoverflow.com

For webservices we usually generate java beans with the maven-jaxb2-plugin and use JAXB2 marshalling in Spring. I am wondering how to handle (SOAP-)faults that are declared in the WSDL/XSD best. In ...

14. web client for web service    stackoverflow.com

I've a web-service that works fine when I access them from a J2SE (desktop) application. To access this service I do follow:

  1. generate stub classes by wsdl link using java wsimport tool
  2. then ...

15. Get rid of JAXBElement in classes generated by wsimport called from ant    stackoverflow.com

I have the following problem: I'm using the wsimport ant task to create a webservice client (for salesforce.com). Everything's working fine but the generated classes all use this strange JAXBElement class for all ...

16. How do you marshall a parameterized type with JAX-WS / JAXB?    stackoverflow.com

Consider the following classes (please assume public getter and setter methods for the private fields).

// contains a bunch of properties
public abstract class Person { private String name; }

// adds some properties ...





17. Best ways to manage generated artifacts for web service/xml bindings in a java webapp/client?    stackoverflow.com

I'm working on a couple of web services that use JAXB bindings for the messages (in JAX-WS or spring-ws). When using these bindings there's always some code that is automatically generated ...

18. Clickatell SOAP wsdl to JAXB java classes    stackoverflow.com

I'm trying to generate JAXB classes from the Clickatell wsdl: You can find the wsdl definition here it quite large: http://api.clickatell.com/soap/webservice.php?WSDL When trying to generate java classes from this Wsdl i got ...

19. Java Web Services/JAXB - Abstract superclass    stackoverflow.com

I have a package with JAXB annotated classes with an abstract superclass. I want to use this superclass in web service interface, so I can pass any of subclasses as a parameter. ...

20. Java object to XML Elements?    stackoverflow.com

I'm working on a webservices client app and I have it mostly working. I can retrieve and read data from the third-party webservice fine. Now I need to submit ...

21. NoSuchMethodError: com/sun/istack/logging/Logger.getLogger    stackoverflow.com

I developed a webservice and deployed it to websphere 7.0 and developed a dynamic dispatch client using JAX-WS APIs which also runs on same application server. I get error at the following ...

22. need to use custom classes instead of generated (by wsimport) in web-services    stackoverflow.com

Could you, please, help with the following issue? When generate WS client code (with wsimport ant task), all classes are generated automatically in the same package (e.g. helloservice.endpoint) as web service, e.g. ...

23. Standard JSON representations    stackoverflow.com

We are building a webservice which consumes and produces JSON. Problem: We are kind of confused about how to represent some specific details of a object. Example: we specify any empty element or ...

24. InstantiationException in web service client calling Web Service deployed to JBoss    stackoverflow.com

I'm deploying a StatelessSessionBean annotated with @WebService to JBoss. I'm taking the WSDL generated by JBoss to generate client stubs. My problem is in calling a method which returns a list ...

25. A java.lang.ClassCastException while accessing web service method written in java. jaxb    stackoverflow.com

I am writing an application where i have to interact with MS SQL database. In my application i am creating web services (using javax.jws) for accessing database tables. i am creating ...

26. SAAJ compatibility with JAXB    stackoverflow.com

I've been working on creating a SAAJ based client. Everything seemed to be working fine, until I implemented the logic to send attachments as part of a web-service request. The web-service operation ...

27. Java/XML problem    stackoverflow.com

I'm having an issue generating XML via Java code. I have a class that for SailingAvailabilityResponseMessage. Within this class there are several other classes that are also used in ...

28. JAXB "(variable) is not a valid property" on a ResponseWrapper    stackoverflow.com

I have a webservice:

@WebService()
public interface WMCService {

    @WebMethod(operationName="getGroupInfoFromUserId")
    @ResponseWrapper(className="wmc.web.service.BasicGroupWrapper")
    @WebResult(name="basicGroup")
    BasicGroup getGroupInfoFromUserId(@WebParam(name = "id") Long id);
}

@WebService(endpointInterface="wmc.web.service.WMCService", serviceName="WMCService")
public class WMCServiceImpl ...

29. WebService client: getting 'null' when tried to get the contents of the response    stackoverflow.com

I am working on a WebService Client using Netbeans. I am able to post a request and even i get the response but getting null when tried to get the contents ...

30. Why can't my Java/SalesForce app create JAXBContext due to a security restriction?    stackoverflow.com

I was on one Java/Salesforce tutorial but I couldn't get it to work as is because SoapBindingStub seems to be obsolete code based upon depreciated libraries. So I ...

31. using xsd:any for extensible schema    stackoverflow.com

Until now, I've been handling extensions by defining a placeholder element that has "name" and "value" attributes as shown in the below example

<root>
   <typed-content>
      ...

32. Whats the right choice for me for building Web Service using Axis2 - AXIOM, JAXB, ADB or XMLBeans    stackoverflow.com

Axis2 supports Web Service creation using AXIOM, JAXB, ADB and XMLBeans. I am new in this area of Web Service development and want to create a Web Service using Axis2. ...

33. JAXB Parsing - weird behavior    stackoverflow.com

I am receiving a valid XML from server. lets say XSD

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:element name="rootElement">
        <xs:complexType>
     ...

34. JAXB unmarshaling Ignoring the SOAP Envelope/Header tags    stackoverflow.com

I have a client I am building for accessing a web service. I am using some JAXB generated classes(Netbeans 6.9) to unmarshal my xml data. I am getting unexpected element errors ...

35. jaxWS "client" need a way to track raw xml requests and responses    stackoverflow.com

I just got in to debug some jaxWS "client". I need a way to track raw xml requests and responses that process through. This is a legacy system so I don't ...

36. Create SOAP Attribute in JAXB    stackoverflow.com

I am currently learning JAXB and Web Service and I have this problem that I dont know how to solve. Suppose I have this very simple class that I annotated with JAXB.

@XmlRootElement
public class ...

37. Mapping Java Date Object to XML Schema datetime format    stackoverflow.com

I am having some problem mapping my Java Data Type to standard Schema Date data type. I have a simple class that I annotated like this. The period instance variable is ...

38. Axis2 web service, bottom-up approach, complex object    stackoverflow.com

I am using axis2 to expose a method of existing class as a web service (bottom-up approach). The method takes a complex object (non-primitive type) as a parameter and returns a ...

39. Generating wsdl using Websphere and JAXB annotated service/entities    stackoverflow.com

I'm trying to generate a wsdl. The service is constructed as shown below. Nothing unusual really, but I do have the Exception I want to throw, located in a separate package, ...

40. Unmarshal generates null field on generic with a List field    stackoverflow.com

I have a Web Service created in Java (1.6), with metro (2.0), using maven, under Tomcat 6. In all web methods the return type is a generic class:

public class WsResult<T> {
  ...

41. Java to XML using JAXB    stackoverflow.com

I´m using JAXB to marshall an Java object to XML. I want to make a web service where i put this code and return the xml, but the last line where i ...

42. XmlAdapter to JAXB-bind Joda Time Interval?    stackoverflow.com

I've been stuck for a few hours with a problem in my JAXB bindings for a web service: In order to prepare for a bigger web service that has to return Joda ...

43. avoiding arg0 tag    stackoverflow.com

I am using EJB3 webservice and Jaxb. No where in my input xsd I have metioned an element arg0. But its getting created when I open the WSDL in my SOAP ...

44. Access to web-service context from XmlAdapter    stackoverflow.com

I am using XmlAdapter<String, String> to encode/decode my string while marshaling/un-marshaling. I want to perform encode/decode operation in XmlAdapter, based on some condition. Let us say if encodingAllwed in HTTP session is set ...

45. JAX-WS support in Axis2 and WTP3.2    stackoverflow.com

Please correct me if I am wrong but it seems to me that you can not create a Web service in Eclipse/WTP3.2 using JAX-WS and JAXB (as data binding). Whenever I ...

46. Consuming a WSDL from a Flex client with inheritance types    stackoverflow.com

General information:

  • I use Flex 4.5
  • I use FlashBuilder 4
  • I generate the WSDL using JAX-WS 2.2 (via a GlassFish 3.1 AS)
I want to have a web service that returns a list of clients. In ...

47. Is JAXB worth it for a handful of small POJOs?    stackoverflow.com

I'm implementing a small RESTful web service, and figured I'd return XML blobs to represent the resources, which map fairly directly to some Java classes I have. I could do custom XML ...

48. JAXB-AXIS, When request xml is unmarshalled JAXB creates JAXBElement object is creted instead of Foo Object    stackoverflow.com

After doing a search abt the topic, i came to know by setting generateElementProperty=false for JAXB bindings we can avoid this. But all the solutions shows how to set this ...

49. Wrap webservice request element in CDATA    stackoverflow.com

I am using a webservice with Axis framework where I need to send an XML element wrapped in CDATA. The element payload below is declared of type java.lang.String Currently, when I set ...

50. Java: JAX-WS Mapping    stackoverflow.com

I am using JAX-WS for web services. Whenever I use a char as a method parameter, I am getting it as an unsignedShort in the xsd (Focus on weatherLetter). Here is the ...

51. How to get control over JAXBContext in JAX-WS?    stackoverflow.com

I need to deploy the same web service for each customer. This @javax.jws.WebService uses Object as method arguments and return types (resulting in <xs:anyType/> in wsdl). Each instance of web service ...

52. help please: xjc throws "Two declarations cause a collision in the ObjectFactory class"    stackoverflow.com

Take the following over simplified XSD:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="com.acme" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Widget">
        <xs:complexType>
         ...

53. SOAP XML -> WebService Annotation-> JAXB Annotations based parsing of XML to DB?    stackoverflow.com

I want a SOAP XML request to be sent to webservice which uses Jaxb annotations to parse the XML and save the details, can some1 please provide some examples created using ...

54. How to convert an Integer param in JAXB?    stackoverflow.com

I am creating a SOAP service using JAX-WS and JAXB. There is a count param. How can I using a costomize DataTypeConvert to convert it? I want to convert an Integer(not ...

55. What's difference between and null in JAXB?    stackoverflow.com

I am have created a Java Webservice application which uses JAXB. When I test my application using SoapUI and I send a SOAP message like <foo></foo>, it will convert to 0, ...

56. JAXB Customizations With a Poorly Formed WSDL    stackoverflow.com

This is driving me insane. I have a schema embedded within a WSDL that needs customization because WSIMPORT is throwing the following error

[ERROR] Complex type and its child element share the ...

57. xsd jaxb classes    stackoverflow.com

i am looking at xsd [contract driven] based web services implementation. i have a schema sample such as ...

58. Allowing EJB 3.1 Webservice with optional namespace    stackoverflow.com

i'm using EJB 3.1 with NetBeans 7.0 to deploy WebServices. I have generated classes from my XSD file. NetBeans generates a WSDL File for this WebServices.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jii="http//webservice.example.de/jii" xmlns:j="http://testservice.example.de/updatecheck/j">
   <soapenv:Header/>
 ...

59. JAXB - Customizing a generated class name, but configuring for not generating it    stackoverflow.com

I have multiple WSDL/XSD files and using JAXB I'm generating it's clients. But there are some common classes among them all, that I have in a separate project. I'm able to ...

60. wsimport - how to generate service endpoint classes and JAXB classes in seperate projects/folders    stackoverflow.com

We are using top-down approach for a project with multiple web services (multiple wsdl's). Each web service needs to be setup as a seperate project and deployed as a seperate war. ...

61. JAX-WS request validation using JAXB    stackoverflow.com

In JAX-WS, to validate the incoming request, one of the ways is to use @SchemaValidation as suggested in below link. JAX-WS and XSD Validation However the application server (WAS 7) I am ...

62. Receiving a null BigDecimal from JAX-WS when client input is an invalid String    stackoverflow.com

I'm developing a webservice using a WSDL (contract-first) that defines one of it's fields as a decimal type, which JAXB converts to a BigDecimal when generating client code. So far so good. ...

63. javax.xml.bind.JAXBException w/ JAXB Jersey    stackoverflow.com

I'm new to Jersey and JAXB and just created my very first small webservice. I have defined a resource that comes with some request server methods. Those methods shall return something ...