Skip to content

Commit b4e9a57

Browse files
authored
Add WCF samples (#4675)
1 parent cd2b753 commit b4e9a57

File tree

4,232 files changed

+267215
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,232 files changed

+267215
-19
lines changed

.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ Backup*/
175175
UpgradeLog*.XML
176176
UpgradeLog*.htm
177177

178-
# SQL Server files
179-
*.mdf
180-
*.ldf
181-
182178
# Business Intelligence projects
183179
*.rdl.data
184180
*.bim.layout
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "service", "service\service.csproj", "{D067DEE6-D9F3-4169-981E-02732E8ABA72}"
5+
EndProject
6+
Global
7+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8+
Debug|Any CPU = Debug|Any CPU
9+
Release|Any CPU = Release|Any CPU
10+
EndGlobalSection
11+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
12+
{D067DEE6-D9F3-4169-981E-02732E8ABA72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13+
{D067DEE6-D9F3-4169-981E-02732E8ABA72}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{D067DEE6-D9F3-4169-981E-02732E8ABA72}.Release|Any CPU.ActiveCfg = Release|Any CPU
15+
{D067DEE6-D9F3-4169-981E-02732E8ABA72}.Release|Any CPU.Build.0 = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>Complex Type AJAX Service Client Page</title>
5+
6+
<script type="text/javascript">
7+
// <![CDATA[
8+
9+
// This function creates an asynchronous call to the service
10+
function makeCall(){
11+
var n1 = document.getElementById("num1").value;
12+
var n2 = document.getElementById("num2").value;
13+
14+
// If user filled out these fields, call the service
15+
if(n1 && n2){
16+
17+
// Instantiate a service proxy
18+
var proxy = new ComplexTypeAjaxService.ICalculator();
19+
20+
// Call DoMath operation on proxy
21+
proxy.DoMath(parseFloat(n1), parseFloat(n2), onSuccess, onFail, null);
22+
}
23+
}
24+
25+
// This function is called when the result from the service call is received
26+
function onSuccess(mathResult){
27+
document.getElementById("sum").value = mathResult.sum;
28+
document.getElementById("difference").value = mathResult.difference;
29+
document.getElementById("product").value = mathResult.product;
30+
document.getElementById("quotient").value = mathResult.quotient;
31+
}
32+
33+
// This function is called if the service call fails
34+
function onFail(){
35+
document.getElementById("sum").value = "Error";
36+
document.getElementById("difference").value = "Error";
37+
document.getElementById("product").value = "Error";
38+
document.getElementById("quotient").value = "Error";
39+
}
40+
41+
// ]]>
42+
</script>
43+
44+
</head>
45+
<body>
46+
<h1>
47+
Complex Type AJAX Service Client Page</h1>
48+
<p>
49+
First Number:
50+
<input type="text" id="num1" /></p>
51+
<p>
52+
Second Number:
53+
<input type="text" id="num2" /></p>
54+
<input id="btn" type="button" onclick="return makeCall();" value="Perform calculation" />
55+
<p>
56+
Sum:
57+
<input type="text" id="sum" /></p>
58+
<p>
59+
Difference:
60+
<input type="text" id="difference" /></p>
61+
<p>
62+
Product:
63+
<input type="text" id="product" /></p>
64+
<p>
65+
Quotient:
66+
<input type="text" id="quotient" /></p>
67+
<form id="mathForm" action="" runat="server">
68+
<asp:ScriptManager ID="ScriptManager" runat="server">
69+
<Services>
70+
<asp:ServiceReference Path="service.svc" />
71+
</Services>
72+
</asp:ScriptManager>
73+
</form>
74+
</body>
75+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//----------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
//----------------------------------------------------------------
4+
5+
using System;
6+
using System.Reflection;
7+
using System.Runtime.InteropServices;
8+
9+
// General Information about an assembly is controlled through the following
10+
// set of attributes. Change these attribute values to modify the information
11+
// associated with an assembly.
12+
[assembly: ComVisible(false)]
13+
[assembly: CLSCompliant(true)]
14+
[assembly: AssemblyTitle("ComplexTypeAjaxService")]
15+
[assembly: AssemblyDescription("ComplexTypeAjaxService")]
16+
[assembly: AssemblyConfiguration("")]
17+
[assembly: AssemblyCompany("Microsoft Corporation")]
18+
[assembly: AssemblyProduct("Windows Communication Foundation and Windows Workflow Foundation SDK")]
19+
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")]
20+
[assembly: AssemblyTrademark("")]
21+
[assembly: AssemblyCulture("")]
22+
23+
// Version information for an assembly consists of the following four values:
24+
//
25+
// Major Version
26+
// Minor Version
27+
// Build Number
28+
// Revision
29+
//
30+
// You can specify all the values or you can default the Revision and Build Numbers
31+
// by using the '*' as shown below:
32+
[assembly: AssemblyVersion("1.0.*")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//----------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
//----------------------------------------------------------------
4+
5+
//------------------------------------------------------------------------------
6+
// <autogenerated>
7+
// This code was generated by a tool.
8+
// Runtime Version:2.0.40903.19
9+
//
10+
// Changes to this file may cause incorrect behavior and will be lost if
11+
// the code is regenerated.
12+
// </autogenerated>
13+
//------------------------------------------------------------------------------
14+
15+
namespace Properties {
16+
17+
18+
/// <summary>
19+
/// A strongly-typed resource class, for looking up localized strings, etc.
20+
/// </summary>
21+
// This class was auto-generated by the Strongly Typed Resource Builder
22+
// class via a tool like ResGen or Visual Studio.NET.
23+
// To add or remove a member, edit your .ResX file then rerun ResGen
24+
// with the /str option, or rebuild your VS project.
25+
class Resources {
26+
27+
private static System.Resources.ResourceManager _resMgr;
28+
29+
private static System.Globalization.CultureInfo _resCulture;
30+
31+
/*FamANDAssem*/ internal Resources() {
32+
}
33+
34+
/// <summary>
35+
/// Returns the cached ResourceManager instance used by this class.
36+
/// </summary>
37+
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
38+
public static System.Resources.ResourceManager ResourceManager {
39+
get {
40+
if ((_resMgr == null)) {
41+
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Properties.Resources", typeof(Resources).Assembly);
42+
_resMgr = temp;
43+
}
44+
return _resMgr;
45+
}
46+
}
47+
48+
/// <summary>
49+
/// Overrides the current thread's CurrentUICulture property for all
50+
/// resource lookups using this strongly typed resource class.
51+
/// </summary>
52+
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
53+
public static System.Globalization.CultureInfo Culture {
54+
get {
55+
return _resCulture;
56+
}
57+
set {
58+
_resCulture = value;
59+
}
60+
}
61+
}
62+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 2.0
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">2.0</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+
<comment>This is a comment</comment>
28+
</data>
29+
30+
There are any number of "resheader" rows that contain simple
31+
name/value pairs.
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
37+
mimetype set.
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
41+
extensible. For a given mimetype the value must be set accordingly:
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
45+
read any of the formats listed below.
46+
47+
mimetype: application/x-microsoft.net.object.binary.base64
48+
value : The object must be serialized with
49+
: System.Serialization.Formatters.Binary.BinaryFormatter
50+
: and then encoded with base64 encoding.
51+
52+
mimetype: application/x-microsoft.net.object.soap.base64
53+
value : The object must be serialized with
54+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+
: and then encoded with base64 encoding.
56+
57+
mimetype: application/x-microsoft.net.object.bytearray.base64
58+
value : The object must be serialized into a byte array
59+
: using a System.ComponentModel.TypeConverter
60+
: and then encoded with base64 encoding.
61+
-->
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:element name="root" msdata:IsDataSet="true">
64+
<xsd:complexType>
65+
<xsd:choice maxOccurs="unbounded">
66+
<xsd:element name="metadata">
67+
<xsd:complexType>
68+
<xsd:sequence>
69+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
70+
</xsd:sequence>
71+
<xsd:attribute name="name" type="xsd:string" />
72+
<xsd:attribute name="type" type="xsd:string" />
73+
<xsd:attribute name="mimetype" type="xsd:string" />
74+
</xsd:complexType>
75+
</xsd:element>
76+
<xsd:element name="assembly">
77+
<xsd:complexType>
78+
<xsd:attribute name="alias" type="xsd:string" />
79+
<xsd:attribute name="name" type="xsd:string" />
80+
</xsd:complexType>
81+
</xsd:element>
82+
<xsd:element name="data">
83+
<xsd:complexType>
84+
<xsd:sequence>
85+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
86+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
87+
</xsd:sequence>
88+
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
89+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
90+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
91+
</xsd:complexType>
92+
</xsd:element>
93+
<xsd:element name="resheader">
94+
<xsd:complexType>
95+
<xsd:sequence>
96+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
97+
</xsd:sequence>
98+
<xsd:attribute name="name" type="xsd:string" use="required" />
99+
</xsd:complexType>
100+
</xsd:element>
101+
</xsd:choice>
102+
</xsd:complexType>
103+
</xsd:element>
104+
</xsd:schema>
105+
<resheader name="resmimetype">
106+
<value>text/microsoft-resx</value>
107+
</resheader>
108+
<resheader name="version">
109+
<value>2.0</value>
110+
</resheader>
111+
<resheader name="reader">
112+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
113+
</resheader>
114+
<resheader name="writer">
115+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+
</resheader>
117+
</root>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//----------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
//----------------------------------------------------------------
4+
5+
//------------------------------------------------------------------------------
6+
// <autogenerated>
7+
// This code was generated by a tool.
8+
// Runtime Version:2.0.40903.19
9+
//
10+
// Changes to this file may cause incorrect behavior and will be lost if
11+
// the code is regenerated.
12+
// </autogenerated>
13+
//------------------------------------------------------------------------------
14+
15+
namespace Properties {
16+
17+
18+
sealed partial class Settings : System.Configuration.ApplicationSettingsBase {
19+
20+
private static Settings m_Value;
21+
22+
private static object m_SyncObject = new object();
23+
24+
[System.Diagnostics.DebuggerNonUserCode()]
25+
public static Settings Value {
26+
get {
27+
if ((Settings.m_Value == null)) {
28+
System.Threading.Monitor.Enter(Settings.m_SyncObject);
29+
if ((Settings.m_Value == null)) {
30+
try {
31+
Settings.m_Value = new Settings();
32+
}
33+
finally {
34+
System.Threading.Monitor.Exit(Settings.m_SyncObject);
35+
}
36+
}
37+
}
38+
return Settings.m_Value;
39+
}
40+
}
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version='1.0' encoding='iso-8859-1'?>
2+
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)" GeneratedClassNamespace="Properties" GeneratedClassName="Settings">
3+
<Profiles>
4+
<Profile Name="(Default)" />
5+
</Profiles>
6+
<Settings />
7+
</SettingsFile>

0 commit comments

Comments
 (0)