You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-user@ws.apache.org by jd...@brunswickwdi.com on 2003/09/04 23:17:45 UTC

Getting raw xml back from WSIF

I am writing an application that needs to call web services dynamically 
based on a wsdl description.  WSIF currently works well for this when 
using primitive types, but for complex types it needs generated code. 
Since the application requires the calls to be dynamic this will not work 
(without a headache).  What I would like to do is get the raw xml 
representing the type if it is a complex type. 

The sample application ships with a latitude/longitude service example. Is 
there any way to make the call dynamically to the service and return the 
GetLatLongResult output message without having to generate code?

Any help is very appreciated.

Jeff De Pons

example return;

      <GetLatLongResult>
         <ServiceError>false</ServiceError>
         <AddressError>false</AddressError>
         <City>MILWAUKEE</City>
         <StateAbbrev>WI</StateAbbrev>
         <ZipCode>53202</ZipCode>
         <County>MILWAUKEE</County>
         <FromLongitude>-87.913284</FromLongitude>
         <FromLatitude>43.027514</FromLatitude>
         <ToLongitude>-87.913284</ToLongitude>
         <ToLatitude>43.060212</ToLatitude>
         <AvgLongitude>-87.895021</AvgLongitude>
         <AvgLatitude>43.043863</AvgLatitude>
         <CMSA>5082</CMSA>
         <PMSA>5080</PMSA>
   </GetLatLongResult>


Re: Getting raw xml back from WSIF

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
Build a single java class, say ComplexTypeWrapper, which you map to all XSD complex types which appear as inputs or return values of dynamically invoked web services.  What I put in my version of this class is the xml type, if known, and the Element holding the data.  You have to provide your own serializer/deserializers.

If you look at the WSIF DynamicInvoker sample, you'll see code which does the right thing with various simple types.  You need to add another branch for all complex types.

Using the org.apache.wsif.schema stuff may help with the determination of what things are complex types (as opposed to derived simple types not handled by the branches in the dynamic invoker sample.)

Jeff
  ----- Original Message ----- 
  From: jdepons@brunswickwdi.com 
  To: wsif-user@ws.apache.org 
  Sent: Thursday, September 04, 2003 2:17 PM
  Subject: Getting raw xml back from WSIF



  I am writing an application that needs to call web services dynamically based on a wsdl description.  WSIF currently works well for this when using primitive types, but for complex types it needs generated code.  Since the application requires the calls to be dynamic this will not work (without a headache).  What I would like to do is get the raw xml representing the type if it is a complex type.   

  The sample application ships with a latitude/longitude service example.  Is there any way to make the call dynamically to the service and return the GetLatLongResult output message without having to generate code?