サービスとは、一般的には「提供すること」「奉仕」といった意味の英語である。IT用語としては、主にプログラムが処理やルーチンを実行して他のコンピュータに特定の機能を提供することなどを指す語である。
構文
解説Service クラスは、<definitions> ルート要素で囲まれた WSDL (Web Services Description Language) <service> 要素に対応します。WSDL の詳細については、http://www.w3.org/TR/wsdl/ の仕様を参照してください。
使用例Imports System Imports System.Web.Services.Description Imports System.Xml Imports Microsoft.VisualBasic Class MyServiceClass Public Shared Sub Main() Try ' Read a WSDL document. Dim myServiceDescription As ServiceDescription = _ ServiceDescription.Read("MathService_vb.wsdl") Dim myServiceCollection As ServiceCollection = _ myServiceDescription.Services Dim noOfServices As Integer = myServiceCollection.Count Console.WriteLine(ControlChars.Newline & _ "Total Number of Services :" & noOfServices.ToString()) ' Gets a reference to the service. Dim myOldService As Service = myServiceCollection(0) Console.WriteLine("No. of Ports in the Service" & _ myServiceCollection(0).Ports.Count.ToString()) Console.WriteLine("These are the ports in the service:") Dim i As Integer For i = 0 To myOldService.Ports.Count - 1 Console.WriteLine("Port name: " & myOldService.Ports(i).Name) Next i Console.WriteLine("Service name: " & myOldService.Name) Dim myService As New Service() myService.Name = "MathService" ' Add the Ports to the newly created Service. Dim j As Integer For j = 0 To myOldService.Ports.Count - 1 Dim PortName As String = myServiceCollection(0).Ports(j).Name Dim BindingName As String = _ myServiceCollection(0).Ports(j).Binding.Name myService.Ports.Add(CreatePort(PortName, BindingName, _ myServiceDescription.TargetNamespace)) Next j Console.WriteLine("Newly created ports -") Dim k As Integer For k = 0 To myService.Ports.Count - 1 Console.WriteLine("Port name: " & myOldService.Ports(k).Name) Next k ' Add the extensions to the newly created Service. Dim noOfExtensions As Integer = myOldService.Extensions.Count Console.WriteLine("No. of extensions: " & noOfExtensions.ToString()) If noOfExtensions > 0 Then Dim l As Integer For l = 0 To myOldService.Ports.Count - 1 myService.Extensions.Add(myServiceCollection(0).Extensions(l)) Next l End If ' Remove the service from the collection. myServiceCollection.Remove(myOldService) ' Add the newly created service. myServiceCollection.Add(myService) myServiceDescription.Write("MathService_New.wsdl") Catch e As Exception Console.WriteLine("Exception:" & e.Message) End Try End Sub 'Main Public Shared Function CreatePort(PortName As String, _ BindingName As String, targetNamespace As String) As Port Dim myPort As New Port() myPort.Name = PortName myPort.Binding = New XmlQualifiedName(BindingName, targetNamespace) ' Create a SoapAddress extensibility element to add to the port. Dim mySoapAddressBinding As New SoapAddressBinding() mySoapAddressBinding.Location = _ "http://localhost/ServiceClass/MathService.vb.asmx" myPort.Extensions.Add(mySoapAddressBinding) Return myPort End Function 'CreatePort End Class 'MyServiceClass
using System; using System.Web.Services.Description; using System.Xml; class MyServiceClass { public static void Main() { try { // Read a WSDL document. ServiceDescription myServiceDescription = ServiceDescription.Read("MathService_CS.wsdl"); ServiceCollection myServiceCollection = myServiceDescription.Services; int noOfServices = myServiceCollection.Count; Console.WriteLine("\nTotal number of services: " + noOfServices); // Gets a reference to the service. Service myOldService = myServiceCollection[0]; Console.WriteLine("No. of ports in the service: "+ myServiceCollection[0].Ports.Count); Console.WriteLine("These are the ports in the service:"); for(int i = 0 ; i < myOldService.Ports.Count; i++) Console.WriteLine("Port name: " + myOldService.Ports[i].Name); Console.WriteLine("Service name: " + myOldService.Name); Service myService = new Service(); myService.Name = "MathService"; // Add the Ports to the newly created Service. for(int i = 0; i < myOldService.Ports.Count; i++) { string PortName = myServiceCollection[0].Ports[i].Name; string BindingName = myServiceCollection[0].Ports[i].Binding.Name; myService.Ports.Add(CreatePort(PortName,BindingName, myServiceDescription.TargetNamespace)); } Console.WriteLine("Newly created ports -"); for(int i = 0; i < myService.Ports.Count; i++) Console.WriteLine("Port name: " + myOldService.Ports[i].Name); // Add the extensions to the newly created Service. int noOfExtensions = myOldService.Extensions.Count; Console.WriteLine("No. of extensions: " + noOfExtensions); if (noOfExtensions > 0) { for(int i = 0; i < myOldService.Ports.Count; i++) myService.Extensions.Add(myServiceCollection[0].Extensions[i]); } // Remove the service from the collection. myServiceCollection.Remove(myOldService); // Add the newly created service. myServiceCollection.Add(myService); myServiceDescription.Write("MathService_New.wsdl"); } catch(Exception e) { Console.WriteLine("Exception: " + e.Message); } } public static Port CreatePort(string PortName,string BindingName, string targetNamespace) { Port myPort = new Port(); myPort.Name = PortName; myPort.Binding = new XmlQualifiedName(BindingName,targetNamespace); // Create a SoapAddress extensibility element to add to the port. SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); mySoapAddressBinding.Location = "http://localhost/ServiceClass/MathService_CS.asmx"; myPort.Extensions.Add(mySoapAddressBinding); return myPort; } }
#using <System.Xml.dll> #using <System.Web.Services.dll> #using <System.dll> using namespace System; using namespace System::Web::Services::Description; using namespace System::Xml; Port^ CreatePort( String^ PortName, String^ BindingName, String^ targetNamespace ) { Port^ myPort = gcnew Port; myPort->Name = PortName; myPort->Binding = gcnew XmlQualifiedName( BindingName,targetNamespace ); // Create a SoapAddress extensibility element to add to the port. SoapAddressBinding^ mySoapAddressBinding = gcnew SoapAddressBinding; mySoapAddressBinding->Location = "http://localhost/ServiceClass/MathService_CS.asmx"; myPort->Extensions->Add( mySoapAddressBinding ); return myPort; } int main() { try { // Read a WSDL document. ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_CS.wsdl" ); ServiceCollection^ myServiceCollection = myServiceDescription->Services; int noOfServices = myServiceCollection->Count; Console::WriteLine( "\nTotal number of services: {0}", noOfServices ); // Gets a reference to the service. Service^ myOldService = myServiceCollection[ 0 ]; Console::WriteLine( "No. of ports in the service: {0}", myServiceCollection[ 0 ]->Ports->Count ); Console::WriteLine( "These are the ports in the service:" ); for ( int i = 0; i < myOldService->Ports->Count; i++ ) Console::WriteLine( "Port name: {0}", myOldService->Ports[ i ]->Name ); Console::WriteLine( "Service name: {0}", myOldService->Name ); Service^ myService = gcnew Service; myService->Name = "MathService"; // Add the Ports to the newly created Service. for ( int i = 0; i < myOldService->Ports->Count; i++ ) { String^ PortName = myServiceCollection[ 0 ]->Ports[ i ]->Name; String^ BindingName = myServiceCollection[ 0 ]->Ports[ i ]->Binding->Name; myService->Ports->Add( CreatePort( PortName, BindingName, myServiceDescription->TargetNamespace ) ); } Console::WriteLine( "Newly created ports -" ); for ( int i = 0; i < myService->Ports->Count; i++ ) Console::WriteLine( "Port name: {0}", myOldService->Ports[ i ]->Name ); // Add the extensions to the newly created Service. int noOfExtensions = myOldService->Extensions->Count; Console::WriteLine( "No. of extensions: {0}", noOfExtensions ); if ( noOfExtensions > 0 ) { for ( int i = 0; i < myOldService->Ports->Count; i++ ) myService->Extensions->Add( myServiceCollection[ 0 ]->Extensions[ i ] ); } // Remove the service from the collection. myServiceCollection->Remove( myOldService ); // Add the newly created service. myServiceCollection->Add( myService ); myServiceDescription->Write( "MathService_New.wsdl" ); } catch ( Exception^ e ) { Console::WriteLine( "Exception: {0}", e->Message ); } }
import System.*; import System.Web.Services.Description.*; import System.Xml.*; class MyServiceClass { public static void main(String[] args) { try { // Read a WSDL document. ServiceDescription myServiceDescription = ServiceDescription. Read("MathService_JSL.wsdl"); ServiceCollection myServiceCollection = myServiceDescription. get_Services(); int noOfServices = myServiceCollection.get_Count(); Console.WriteLine("\nTotal number of services: " + noOfServices); // Gets a reference to the service. Service myOldService = myServiceCollection.get_Item(0); Console.WriteLine("No. of ports in the service: " + myServiceCollection.get_Item(0).get_Ports().get_Count()); Console.WriteLine("These are the ports in the service:"); for (int i = 0; i < myOldService.get_Ports().get_Count(); i++) { Console.WriteLine("Port name: " + myOldService.get_Ports(). get_Item(i).get_Name()); } Console.WriteLine("Service name: " + myOldService.get_Name()); Service myService = new Service(); myService.set_Name("MathService"); // Add the Ports to the newly created Service. for (int i = 0; i < myOldService.get_Ports().get_Count(); i++) { String PortName = myServiceCollection.get_Item(0).get_Ports(). get_Item(i).get_Name(); String BindingName = myServiceCollection.get_Item(0).get_Ports(). get_Item(i).get_Binding().get_Name(); myService.get_Ports().Add(CreatePort(PortName, BindingName, myServiceDescription.get_TargetNamespace())); } Console.WriteLine("Newly created ports -"); for (int i = 0; i < myService.get_Ports().get_Count(); i++) { Console.WriteLine("Port name: " + myOldService.get_Ports(). get_Item(i).get_Name()); } // Add the extensions to the newly created Service. int noOfExtensions = myOldService.get_Extensions().get_Count(); Console.WriteLine("No. of extensions: " + noOfExtensions); if (noOfExtensions > 0) { for (int i = 0; i < myOldService.get_Ports().get_Count(); i++) { myService.get_Extensions().Add(myServiceCollection. get_Item(0).get_Extensions().get_Item(i)); } } // Remove the service from the collection. myServiceCollection.Remove(myOldService); // Add the newly created service. myServiceCollection.Add(myService); myServiceDescription.Write("MathService_New.wsdl"); } catch (System.Exception e) { Console.WriteLine("Exception: " + e.get_Message()); } } //main public static Port CreatePort(String PortName, String BindingName, String targetNamespace) { Port myPort = new Port(); myPort.set_Name(PortName); myPort.set_Binding(new XmlQualifiedName(BindingName, targetNamespace)); // Create a SoapAddress extensibility element to add to the port. SoapAddressBinding mySoapAddressBinding = new SoapAddressBinding(); mySoapAddressBinding.set_Location("http://localhost/ServiceClass/" + "MathService_JSL.asmx"); myPort.get_Extensions().Add(mySoapAddressBinding); return myPort; } //CreatePort } //MyServiceClass
継承階層
スレッド セーフ
プラットフォームWindows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照
構文
プラットフォームWindows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照
パブリック プロパティ| 名前 | 説明 | |
|---|---|---|
| Documentation | DocumentableItem のインスタンスのテキスト ドキュメントを取得または設定します。 ( DocumentableItem から継承されます。) |
| DocumentationElement | DocumentableItem のドキュメント要素を取得または設定します。 ( DocumentableItem から継承されます。) |
| ExtensibleAttributes | Web Services Interoperability (WS-I) Basic Profile 1.1 に準拠する WSDL の属性の拡張機能を表す XmlAttribute 型の配列を取得または設定します。 ( DocumentableItem から継承されます。) |
| Extensions | オーバーライドされます。 Service に関連付けられている機能拡張要素のコレクションを取得します。 |
| Name | 項目の名前を取得または設定します。 ( NamedItem から継承されます。) |
| Namespaces | ServiceDescription オブジェクトが生成されるときに名前空間プレフィックスと名前空間を保持するために使用する、名前空間プレフィックスと名前空間のディクショナリを取得または設定します。 ( DocumentableItem から継承されます。) |
| Ports | Service に格納されている Port インスタンスのコレクションを取得します。 |
| ServiceDescription | Service がメンバとして含まれている ServiceDescription を取得します。 |
参照
パブリック メソッド| 名前 | 説明 | |
|---|---|---|
| Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
| GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
| GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
| ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
| ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
参照XML Web サービスに関連付けられる Port クラスと関連するインスタンスをセットにしてグループ化します。このクラスは継承できません。
Service データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ| 名前 | 説明 | |
|---|---|---|
| Service |
パブリック プロパティ| 名前 | 説明 | |
|---|---|---|
| Documentation | DocumentableItem のインスタンスのテキスト ドキュメントを取得または設定します。(DocumentableItem から継承されます。) |
| DocumentationElement | DocumentableItem のドキュメント要素を取得または設定します。(DocumentableItem から継承されます。) |
| ExtensibleAttributes | Web Services Interoperability (WS-I) Basic Profile 1.1 に準拠する WSDL の属性の拡張機能を表す XmlAttribute 型の配列を取得または設定します。(DocumentableItem から継承されます。) |
| Extensions | オーバーライドされます。 Service に関連付けられている機能拡張要素のコレクションを取得します。 |
| Name | 項目の名前を取得または設定します。(NamedItem から継承されます。) |
| Namespaces | ServiceDescription オブジェクトが生成されるときに名前空間プレフィックスと名前空間を保持するために使用する、名前空間プレフィックスと名前空間のディクショナリを取得または設定します。(DocumentableItem から継承されます。) |
| Ports | Service に格納されている Port インスタンスのコレクションを取得します。 |
| ServiceDescription | Service がメンバとして含まれている ServiceDescription を取得します。 |
パブリック メソッド| 名前 | 説明 | |
|---|---|---|
| Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
| GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
| GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
| ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
| ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
参照(Service から転送)
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2026/02/11 10:28 UTC 版)
|
|
この記事は検証可能な参考文献や出典が全く示されていないか、不十分です。 (2021年3月)
|
サービス(英: service)あるいは用役(ようえき)、役務(えきむ)とは、経済活動において、売買した後にモノが残らず、効用や満足などを提供する、形のない財を指す経済学の用語である。第三次産業が取り扱う商品である。
また、サービスの概念に含まれる公共サービスは社会(国家、自治体や組合)がその費用を負担する役務のことである。資源やスキル、創意、経験などを活かし、提供者が消費者、市民などに提供する。
以上の性質が全てに当てはまるわけではない[1]。例えば、エンターテインメント産業(音楽、映像など)において、ライブパフォーマンス以外は同時性、不可分性を満たさない。修理、メンテナンス、クリーニングなどでは品質が標準化されることがある。情報産業ではサービスを形にして在庫にすることができる。
個人向けサービス業、事業所向けサービス業といった区分が用いられることもある。例えば、第3次産業活動指数では、
と分類している。
下記に順不同で列挙するが、まさに多様といえる。
日本においてサービスという言葉を最初に使ったのは、日本自動車会社の社長石沢愛三である。大正末期に米国を視察した際、米国の自動車販売に「サービス・ステーション」が大きな成果を上げていることを知り日本でもサービス・ステーションを広めようとする。帰国後、取引先関係各社にはがきをだす。文面は「今般、当社は完全なるサービス・ステーションに依り顧客本位の御便宜を計ることに相成り候」。これに対し、「サービス・ステーションという便利なものが到着した由、至急届けてもらいたい」との回答が多数返ってくる。これに困った石沢はサービス・ステーションの和訳を試みるが、辞書には、サービスとは奉仕的なるものとの記述のみであり、外国人にきいても要領を得なかったので、使うのをやめたという[2]。
その後、1925年(大正14年)、フォード自動車が横浜に工場を置き操業を開始。米国フォード社自身が「サービス第一主義」を掲げ、フォード・モデルT全盛であったこともあり「サービス・エンジニヤー」を「プロダクション・エンジニヤー」以上に尊敬の対象としたほどで、全世界にサービス網を構築し安心して使用できることを訴求することが販売における重要なポイントであるとしていた。1927年(昭和2年)には日本GMが大阪工場の操業を開始。それぞれの会社が各府県に一箇所はディーラーを置き活動する。このような自動車関連海外資本の日本進出による諸活動が日本でのサービス概念の形成に大きく影響している。また特にGMは、英国資本のライジングサン石油と共に日本にガソリンスタンドを大量設置したことも欧米型サービスの地方への普及に貢献した。しかし、このようなサービスは当初より顧客本位を謳いながらも、海外現地法人下での活動では親会社本位が現実であり、ディーラーに多くのしわ寄せがなされ、原則各府県一箇所のディーラーが10年程で300程が契約されているところにその厳しさがあらわれている[2]。
日本においては、「サービス」という語を「奉仕」、「無料」、「値引き」、「おまけ」というような意味で用いていることも多く、誤解を招く要因となっている[3][4]。
かつては、生産技術、生産管理、商品の品質管理のレベルが低く、不良品の発生率も高かった。このため、メーカーや販売店は不良品を新品と交換する、修理・交換部品を無料にする、修理代金を無料にするといった活動や、販売後のケアを無償とせざるを得なかった。また、人件費が低かったこともあり、商品の販売による売り上げさえ確保できれば、こういった修理や販売後ケアを無料にしてもコスト面で折り合いが付いた[4]。その後、販売競争が激しくなっても、販売価格は据え置きでサービスが無料という形態は続いた。むしろ、サービスが無料という点は、販促のための方策でもあった[4]。製造業や流通業の立場からでも「顧客は値引きを求めている」という解釈を行い、顧客が実際に求めているか否かに関わりなく、各種サービスを無料にすることが行われていた[4]。営業職側も、営業調査やマーケティング調査を怠り、安易な値引き路線やおまけ付与という営業活動が慣習化されていた[4]。
100円均一の回転寿司や100円ショップ、1000円均一の理髪店などが優れたビジネスモデルとして顧客の人気を獲得している一方、技量の優れた職人が握る寿司屋や丁寧に対応する理髪店、美容院もまた同様に支持されていることから、顧客はサービスの差を理解しているとも判断されている[4]。
サービス業(サービス産業)はサービスを取り扱う産業のことであるが、その範囲は、使用される状況や資料によって異なる。広義のサービス業は、第三次産業と同義である。例えば、第637回統計審議会では、「第一次産業、第二次産業に含まれないその他のもの全てを第三次産業として、サービス産業としている」とある。また、経済産業省産業構造審議会サービス政策部会の中間報告書では、「サービス産業は第三次産業と同義で、エネルギーや通信、運輸や卸・小売等も含む」とある。また、形のない財をサービスと呼ぶことから、形のある財を取引する卸売業・小売業を除いた第三次産業を指して、サービス業と呼ぶこともある。狭義のサービス業は、第三次産業をいくつかに分類したときに、その分類に当てはまらないもの全てを総称して呼ぶ。そのため、「○○以外」という表現を用いないで、狭義のサービス業を定義することは不可能である。日本標準産業分類では、第三次産業のうち、電気・ガス・熱供給・水道業、情報通信業、運輸業、卸売・小売業、金融・保険業、不動産業、飲食店、宿泊業、医療、福祉、教育、学習支援業、複合サービス事業、公務に分類されないものを指す。
学術団体については、1951年4月21日、日本商業学会が慶應義塾大学教授向井鹿松を初代会長として設立された[5]。
2002年の日本標準産業分類改訂により、「サービス業」は見直しが行われ、分割や他の産業との統合が行われた。その結果、以前の分類とは内容が異なっており、時系列での比較には注意が必要となる[6]。
大分類として新しく起こされたものを挙げると、
統計の産業分類は日本標準産業分類に準じるため、順次新分類に移行している。ただし、数年おきの大規模な調査では新分類で調査を行っていなかったり、自治体の統計では2002年改訂以前の分類によっているものもある。