axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <andreas.veit...@gmail.com>
Subject Re: Axis2 create sample response xml using generated stubs
Date Fri, 19 Jun 2009 10:30:10 GMT
The correct approach would be to instantiate the bean, use reflection
(java.beans.Introspector) to populate all properties and then create
the XML from it.

Note that you should not use OMNavigator because it doesn't do what
you believe it does.

Andreas

2009/6/19 Krystian Szczesny <Krystian.Szczesny@intecbilling.com>:
> Hi,
>
> I want to create a sample response xml message, same way as soapui does when you create
a mock service.
> I just want a sample xml message with all possible values set to '?'.
> I wanted to navigate through the structure of my response using OMNavigator, but it fails
to instantiate due to mandatory attributes:
> Caused by: org.apache.axis2.databinding.ADBException: status cannot be null!!
>
> What I am trying to do now is:
> <StubResponseGeneratedByADB> response = new <StubResponseGeneratedByADB>();
> OMFactory factory = OMAbstractFactory.getOMFactory();
> OMElement documentElement = response.getOMElement(response.MY_QNAME, factory);
> OMNavigator navigator = new OMNavigator(documentElement);
>
> And at this stage I am getting the exception.
> I do understand why I got the exception, however I am not sure how can I easily and automatically
(without knowing the structure upfront) loop through the whole response to set the values
to "something".
>
> Any help will be appreciated.
>
> Regards,
> Krystian
>
> !--
> KRYSTIAN SZCZĘSNY
> This e-mail and any attachments are confidential and may also be legally
> privileged and/or copyright material of Intec Telecom Systems PLC (or its
> affiliated companies).  If you are not an intended or authorised recipient
> of this e-mail or have received it in error, please delete it immediately
> and notify the sender by e-mail. In such a case, reading, reproducing,
> printing or further dissemination of this e-mail or its contents is strictly
> prohibited and may be unlawful.
> Intec Telecom Systems PLC does not represent or warrant that an attachment
> hereto is free from computer viruses or other defects. The opinions
> expressed in this e-mail and any attachments may be those of the author and
> are not necessarily those of Intec Telecom Systems PLC.
>

Mime
View raw message