RE: example of using MIME types in operations

Kevin, 

the approach you have below is one way to do it, but that's intended to
be useful also when it is not actually supported by the WSDL tooling -
in that case the message would contain exactly one XML element with
base64 binary data in it. This element can be optimized away, possibly,
but abstractly it will still be there.

What I intended to show was using a different, non-XML type system - I
didn't intend to show how binary data can be used in WSDL. I did choose
MIME typing because it was very simple and, I think, illustrative.

Best regards,

Jacek


On Wed, 2005-06-22 at 05:21 +0200, Liu, Kevin wrote:
> Jacek,
> 
> Maybe I am missing something here, but why do we need another extension
> for indicating mime type? Is the media type spec at [1] sufficient? 
> 
> The following code using [1] should be able to do exactly the same thing
> as the example you gave below does:
> 
> <?xml version="1.0" encoding="utf-8" ?> 
> <description 
>     xmlns="http://www.w3.org/2005/05/wsdl"
>     targetNamespace= "http://example.com/images" 
>     xmlns:tns= "http://example.com/images"
>     xmlns:sns= "http://example.com/imagesSchema"
>     xmlns:wsoap= "http://www.w3.org/2005/05/wsdl/soap"
>     xmlns:whttp="http://www.w3.org/2005/05/wsdl/http"
>     xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
>     xmlns:xmime="http://www.w3.org/@@@@/@@/xmlmime">
> 
> 	<types>
> 		<xs:schema
> targetNamespace="http://example.com/imagesSchema">
> 			<xs:element name="imageID" type="xs:string" />
> 			<xs:element name="imageOut"
> type="xmine:base64binary" xmime:expectedContentTypes="image/*"/>
> 				<!-- IMHO, media type should be defined
> as part of the message definition -->
> 		</xs:schema>
> 	</types>
> 
> 	<interface  name="imageRepositoryInterface" >
>    
> 		<operation name="opDownloadImage" 
> 	
> pattern="http://www.w3.org/2005/05/wsdl/in-out"
> 	
> style="http://www.w3.org/2005/05/wsdl/style/uri"
> 				wsdlx:safe = "true">
> 			<input messageLabel="In" 
> 				element="sns:imageID" />
> 			<output messageLabel="Out" element ="imageOut"/>
> 				   <!-- you don't need to mix the
> message definition with the interface definition -->
> 		</operation>
> 	</interface>
> 
> 	<binding name="imageRepositoryHTTPBinding"
> 		 interface="tns:imageRepositoryInterface"
> 		 type="http://www.w3.org/2005/05/wsdl/http"
> 		 whttp:methodDefault="GET">
> 
> 		<operation ref="tns:opDownloadImage"
> 			whttp:location="{imageID}"  />
> 
> 		<!-- It requires defining how to interpret the media
> types for http binding, no matter whether the media type data is
> provided with the message definition or with the interface definition
> -->
> 	</binding>
> 
> 	<service name="imageRepositoryService"
> 		 interface="tns:imageRepositoryInterface">
> 		<endpoint name="repositoryEndpoint"
> 			binding="tns:imageRepositoryHTTPBinding"
> 			address="http://example.com/images/"/>
> 
> 	</service>
> </description>
> 
> 
> [1]
> http://dev.w3.org/cvsweb/~checkout~/2002/ws/desc/media-types/xml-media-t
> ypes.html?content-type=text/html;%20charset=utf-8
> 
> Thoughts?
> 
> Best Regards,
> Kevin
>   
> 
> > -----Original Message-----
> > From: www-ws-desc-request@w3.org 
> > [mailto:www-ws-desc-request@w3.org] On Behalf Of Jacek Kopecky
> > Sent: Tuesday, Jun 21, 2005 3:56 AM
> > To: WS-Description WG
> > Subject: example of using MIME types in operations
> > 
> > 
> > Hi all, 
> > 
> > here's an example of how MIME media types could be used as a 
> > type system
> > in WSDL. I think it only needs very little verbiage around to make it
> > fit in the appropriate place in the primer or wherever it 
> > should go. It
> > should say the MIME extension (on the line with the XML 
> > comment) is not
> > formally specified, it is just a mock-up example, but if specified, it
> > would introduce the attribute wmime:type and it would extend the HTTP
> > binding to be able to handle MIME-typed binary messages.
> > 
> > Is this helpful, do you think? 8-)
> > 
> > Jacek
> > 
> > 
> > <?xml version="1.0" encoding="utf-8" ?> 
> > <description 
> >     xmlns="http://www.w3.org/2005/05/wsdl"
> >     targetNamespace= "http://example.com/images" 
> >     xmlns:tns= "http://example.com/images"
> >     xmlns:sns= "http://example.com/imagesSchema"
> >     xmlns:wsoap= "http://www.w3.org/2005/05/wsdl/soap"
> >     xmlns:whttp="http://www.w3.org/2005/05/wsdl/http"
> >     xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> > 
> > 	<types>
> > 		<xs:schema 
> > targetNamespace="http://example.com/imagesSchema">
> > 			<xs:element name="imageID" type="xs:string" />
> > 		</xs:schema>
> > 	</types>
> > 
> > 	<interface  name="imageRepositoryInterface" >
> >    
> > 		<operation name="opDownloadImage" 
> > 				
> > pattern="http://www.w3.org/2005/05/wsdl/in-out"
> > 				
> > style="http://www.w3.org/2005/05/wsdl/style/uri"
> > 				wsdlx:safe = "true">
> > 			<input messageLabel="In" 
> > 				element="sns:imageID" />
> > 			<output messageLabel="Out" 
> > 				wmime:type="image/*" />   <!-- 
> > this is how simple it could be -->
> > 		</operation>
> > 	</interface>
> > 
> > 	<binding name="imageRepositoryHTTPBinding"
> > 		 interface="tns:imageRepositoryInterface"
> > 		 type="http://www.w3.org/2005/05/wsdl/http"
> > 		 whttp:methodDefault="GET">
> > 
> > 		<operation ref="tns:opDownloadImage"
> > 			whttp:location="{imageID}"  />
> > 	</binding>
> > 
> > 	<service name="imageRepositoryService"
> > 		 interface="tns:imageRepositoryInterface">
> > 		<endpoint name="repositoryEndpoint"
> > 			binding="tns:imageRepositoryHTTPBinding"
> > 			address="http://example.com/images/"/>
> > 
> > 	</service>
> > </description>
> > 
> > 
> > 
> 
> 

Received on Wednesday, 22 June 2005 07:55:28 UTC