W3C home > Mailing lists > Public > www-ws-desc@w3.org > June 2005

RE: example of using MIME types in operations

From: Liu, Kevin <kevin.liu@sap.com>
Date: Wed, 22 Jun 2005 05:21:52 +0200
Message-ID: <3470F33FF8ED12498D07F3A9651AA18E2082B0@uspale20.pal.sap.corp>
To: "Jacek Kopecky" <jacek.kopecky@deri.org>, "WS-Description WG" <www-ws-desc@w3.org>

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 03:21:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:58:36 GMT