java - Return XML document Jax-WS -
i have web service (jax-ws), uses internal service (further i.s. ) connect url
via get
method. i.s. connects specific url , gets response. returned data(in xml format) might different depending on parameters passed. here 1 important point! difference mean difference of structure of returned xml, i.e 1 set of parametres 1 xml, set of parameters another, different xml (structure different). main goal resend response (another jobs done) client calling web service. here web service works brigde. suppose can't use jaxb, cause different xml structured data(there nothing common between them). question how can solve ? how can resend came me client? without unmarshalling . possible stream? able returned data in inputstream
or string
@slf4j @webservice(name = ccservicews.ws_name, servicename = ccws.ws_service_name, portname = ccws.ws_port_name, targetnamespace = ccws.ws_namespace) @logged @component public class ccwsimpl implements ccservicews { @autowired ccservice ccservice; @override public object reserve(@xmlelement(required = true) @notnull string m1, @xmlelement(required = true) @notnull string m2, @xmlelement(required = true) @notnull integer amount) { return ccservice.reserve(m1, m2, amount); } }
my internal service
@slf4j @component public class ccservice { @override public object reserve(@notnull string m1, @notnull string m2, @notnull integer amount) { url url = new url("http://example.com?a=5&v=56"); httpurlconnection connection = (httpurlconnection) url.openconnection(); connection.setrequestmethod("get"); inputstream = connection.getinputstream(); // here input stream } }
why don't send string
? no matter comes , can send clients
Comments
Post a Comment