8383 float : right;
8484 }
8585
86+ H3 B
87+ {
88+ color : # 061 ;
89+ }
8690 H4 B
8791 {
8892 color : # 555 ;
122126 padding : 0 20px 20px 0 ;
123127 }
124128
129+ # configpath
130+ {
131+ margin : 0 0 40px 0 ;
132+ }
133+ # configpath DT
134+ {
135+ line-height : 30px ;
136+ font-weight : bold;
137+ }
138+ # configpath DD
139+ {
140+ margin : 0 0 0 10px ;
141+ }
125142
126143 </ style >
127144</ head >
@@ -161,13 +178,44 @@ <h2>2. Configuring Service Stack to run in your application</h2>
161178 Add a reference to the < a href ="https://github.com/ServiceStack/ServiceStack/downloads "> latest ServiceStack.dll's</ a > to your project:
162179 </ p >
163180
181+
164182 < p >
165- Register the ServiceStack handler with in your ASP.NET application
166- by adding either of the following to your < strong > Web.config</ strong > :
183+ There are 2 supported options available to register ServiceStack in your ASP.NET application < strong > Web.config</ strong > :
167184 </ p >
185+ < dl id ="configpath ">
186+ < dt > a) host at: < a href ="#rootpath "> /</ a > </ dt >
187+ < dd > When running ServiceStack as standalone (i.e. don't need to use an existing framework)</ dd >
188+
189+ < dt > b) host at: < a href ="#custompath "> /custompath</ a > </ dt >
190+ < dd > When you're using ServiceStack together with an existing web framework</ dd >
191+ </ dl >
192+
193+ < h3 > < a name ="rootpath "> </ a > a) You do not require an existing Web Framework - Host from the root path: < b > /</ b > </ h3 >
194+ < p >
195+ You can host at the root path < b > /</ b > when you don't need to use an existing Web Framework with your ServiceStack web services (i.e. project only has static files)
196+ </ p >
197+ < h4 > The configuration below allows you to host your webservices from the root path: < b > /</ b > </ h4 >
198+ < code class ="web-config "> <system.web>
199+ <httpHandlers>
200+ <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
201+ </httpHandlers>
202+ </system.web>
168203
169- < h3 > Host Web services at a custom path: < b > /servicestack</ b > </ h3 >
170- < h4 > Use the location configuration below to host webservices at the custom path: < b > /servicestack</ b > </ h4 >
204+ <!-- Required for IIS 7.0 -->
205+ <system.webServer>
206+ <handlers>
207+ <add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
208+ </handlers>
209+ </system.webServer>
210+ </ code >
211+
212+ < h3 > < a name ="custompath "> </ a > b) You require an existing Web Framework - Host web services at: < b > /custompath</ b > </ h3 >
213+ < p >
214+ In order to avoid conflicts with your existing ASP.NET web framework it is recommended to host your ServiceStack web services at a custom path.< br />
215+ This will allow you to use ServiceStack together with an existing web framework
216+ e.g. < a href ="http://www.asp.net/mvc "> ASP.NET MVC 3</ a > or < a href ="http://code.google.com/p/fubumvc/ "> FUBU MVC</ a > , etc.
217+ </ p >
218+ < h4 > The location configuration below hosts your webservices at custom path: < b > /servicestack</ b > </ h4 >
171219< code class ="web-config "> <location path="servicestack">
172220 <system.web>
173221 <httpHandlers>
@@ -184,23 +232,6 @@ <h4>Use the location configuration below to host webservices at the custom path:
184232 </handlers>
185233 </system.webServer>
186234</location>
187- </ code >
188-
189- < h3 > Host Web services at the root path: /</ h3 >
190- < h4 > Wildcard Handler mapping for IIS 6.0, MONO or VS.NET dev web server</ h4 >
191- < code class ="web-config "> <system.web>
192- <httpHandlers>
193- <add path="servicestack*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/>
194- </httpHandlers>
195- </system.web>
196- </ code >
197-
198- < h4 > Wildcard Handler mapping for IIS 7+</ h4 >
199- < code class ="web-config "> <system.webServer>
200- <handlers>
201- <add path="servicestack" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
202- </handlers>
203- </system.webServer>
204235</ code >
205236
206237 < h2 > 3. Creating your first Web Service</ h2 >
0 commit comments