tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Millies, Sebastian" <Sebastian.Mill...@softwareag.com>
Subject Re: Dynamic service references (summary)
Date Wed, 07 Dec 2011 12:00:50 GMT
Thank you very much for all your help, Simon.

I summarize here the result of this discussion for everyone's benefit:

For dynamic web service endpoints, get a wsdl for the web service and define
a service reference with interface.wsdl using wsdl.binding and a dummy
URI in the binding.ws element.

<sca:reference name="bapiCostcenterGetList" requires="sca:authentication">
    interface="urn:functions#wsdl.interface(ZWS_BAPI_COSTCENTER_GETLIST)" />
      uri="dynamicURI" />

At run time get the service reference, serialize it to XML, replace the
dummy URI with the real endpoint URI, deserialize the reference and call the
service method. The serialization coding goes like this:

  public String serializeServiceReferenceXML( ServiceReference<T> sr )
    throws IOException
    ServiceReferenceImpl<T> sri = (ServiceReferenceImpl<T>) sr;
    return sri.toXMLString();

  public ServiceReference<T> deserializeServiceReferenceXML( String serializedSR )
    throws Exception
    StringReader reader = new StringReader( serializedSR );
    XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader( reader
    ServiceReferenceImpl<T> sri = new ServiceReferenceImpl<T>( xmlReader );
    return sri;

The deserialized reference will work also when using policy sets (I have tested
that with basic authentication).

For background on the changes that have been made to the 1.x  trunk to make
this possible, refer to TUSCANY-3984.

-- Sebastian

IDS Scheer Consulting GmbH
Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev
Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - Registergericht/Commercial
register: Saarbrücken HRB 19681

View raw message