Return-Path: X-Original-To: apmail-tuscany-user-archive@www.apache.org Delivered-To: apmail-tuscany-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF7767CCC for ; Wed, 7 Dec 2011 13:05:20 +0000 (UTC) Received: (qmail 86825 invoked by uid 500); 7 Dec 2011 13:05:20 -0000 Delivered-To: apmail-tuscany-user-archive@tuscany.apache.org Received: (qmail 86791 invoked by uid 500); 7 Dec 2011 13:05:20 -0000 Mailing-List: contact user-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@tuscany.apache.org Delivered-To: mailing list user@tuscany.apache.org Received: (qmail 86784 invoked by uid 99); 7 Dec 2011 13:05:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 13:05:20 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.227.17.8] (HELO moutng.kundenserver.de) (212.227.17.8) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2011 13:05:13 +0000 Received: from [192.168.0.51] (w-194.cust-4723.ip.static.uno.uk.net [95.172.230.194]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M6854-1QaQWX1ioM-00yK5r; Wed, 07 Dec 2011 14:04:52 +0100 Message-ID: <4EDF6475.6040602@apache.org> Date: Wed, 07 Dec 2011 13:04:53 +0000 From: Simon Nash User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: user@tuscany.apache.org Subject: Re: Dynamic service references (summary) References: <32F15738E8E5524DA4F01A0FA4A8E4906FF56686@HQMBX1.eur.ad.sag> In-Reply-To: <32F15738E8E5524DA4F01A0FA4A8E4906FF56686@HQMBX1.eur.ad.sag> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:+/V+d3noo3rzOR/W8BbGDEv8ePq8e5mXum/wzmWRDSb x2vKGHlNj8ZeKm+7eVBk9+rvvPHWzOwY9WSX1yGxHYYhuSfVnF MMfz10EZ52xNG+ChpXhaaZ4ObJHfi6FoipPCvOxumf4ze0VCHp 6mVA4PcCLfaEvFFagS6LKolocO3d21Pss9C+BsDlS+r68T/7Ju LRxAx1L66A2yk/nSkyCQsdL12n7nzDhIGeu7OocB+j5asCXHwA ZvmCpG1pRZftW2QB8Y9D4zNlt+xq1SR04uYluZ67hPVuj0rjpX k1STKJsaeeBQ5yJlaZGoCUa7AEprsWD3BBkawAhkkIgtj3m7C2 qVeyzORhkBLk1pccZBCU= X-Virus-Checked: Checked by ClamAV on 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 > > interface="urn:functions#wsdl.interface(ZWS_BAPI_COSTCENTER_GETLIST)" /> > wsdlElement="urn:functions#wsdl.binding(ZWS_BAPI_COSTCENTER_GETLISTBinding)" > 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 sr ) > throws IOException > { > ServiceReferenceImpl sri = (ServiceReferenceImpl) sr; > return sri.toXMLString(); > } > > public ServiceReference deserializeServiceReferenceXML( String serializedSR ) > throws Exception > { > StringReader reader = new StringReader( serializedSR ); > XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader( reader ); > ServiceReferenceImpl sri = new ServiceReferenceImpl( 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 >