tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Nash <n...@apache.org>
Subject Re: Dynamic service references (summary)
Date Wed, 04 Jan 2012 19:50:56 GMT
Giorgio Zoppi wrote:
> XML payload is too much for references. Is it feasible to find a more
> convenient format or it needs encapsulated on a SOAP envelope?
> 
What aspect of this is too much?  Is it the size of the message, or
the cost of parsing XML at the receiver?  The former is only about
200 bytes or so in most cases, and the latter shouldn't be much more
than parsing any SOAP request.

   Simon
> 
> 2011/12/7 ant elder <ant.elder@gmail.com>:
>> This is good and i will have a go in 2.x to see if a similar approach
>> works there. But i can't help thinking its a slightly convoluted
>> approach and as we have more flexibility in 2.x to add more APIs I
>> wonder if we should just add a more direct API method to set the URIs
>> with extra methods on Node, or also perhaps something like being able
>> to do: ((TuscanyServiceReference)serviceReference).setURI(uri)?
>>
>>   ...ant
>>
>> ---------- Forwarded message ----------
>> From: Simon Nash <nash@apache.org>
>> Date: Wed, Dec 7, 2011 at 1:04 PM
>> Subject: Re: Dynamic service references (summary)
>> To: user@tuscany.apache.org
>>
>>
>> Millies, Sebastian wrote:
>>> Thank you very much for all your help, Simon.
>>>
>> You're very welcome.  I'm glad this is working for you now.
>>
>>
>>> 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.
>>>
>> One small point--it doesn't need to be interface.wsdl.  It should also work
>> if you use interface.java.
>>
>>  Simon
>>
>>
>>> <sca:reference name="bapiCostcenterGetList" requires="sca:authentication">
>>>  <sca:interface.wsdl
>>>    interface="urn:functions#wsdl.interface(ZWS_BAPI_COSTCENTER_GETLIST)" />
>>>    <sca:binding.ws
>>>      wsdlElement="urn:functions#wsdl.binding(ZWS_BAPI_COSTCENTER_GETLISTBinding)"
>>>      uri="dynamicURI" />
>>> </sca:reference>
>>>
>>> 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
>>> http://www.softwareag.com
>>>
> 
> 
> 


Mime
View raw message