| .NET DotNet Forum Index » ASP.NET - Webservices Forum » Need Example of Config File With WebHttpBinding and... |
|
Page 1 of 1 |
|
| Author |
Message |
| pbd22... |
Posted: Wed Sep 16, 2009 4:27 pm |
|
|
|
Guest
|
Hi.
I am having a dandy time trying to figure out how to set up my config
file for both JSON and SOAP endpoints.
Some Background - Originally, I had an error that said something to
the effect that I cannot have two endpoints listening at the same
location so I went about creating unique addresses for my endpoints.
Since the service names are the same but the addresses are unique, I
took out the "base address" and defined the address attribute in the
endpoint definition.
I am now getting this error:
The HttpGetEnabled property of ServiceMetadataBehavior is set to
true and the HttpGetUrl property is a relative address, but there is
no http base address. Either supply an http base address or set
HttpGetUrl to an absolute address.
I feel like I am just digging myself into a deeper hole - could
somebody show me an example of a config file that illustrates both
webHttpBinding and basicHttpBinding for two different service
definitions (TradeService and AuthService below).
Thank you!
<system.serviceModel>
<client>
<endpoint address="http://localhost:8080/authservice/auth.svc"
behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="MyProject.WebAPI.Authentication.IJSONAuthService"
name="MyJSONAuthEP" />
<endpoint address="http://localhost:80/authservice/auth.svc"
behaviorConfiguration="BasicHttpEPBehavior"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="MyProject.WebAPI.Authentication.ISOAPAuthService"
name="MySOAPAuthEP" />
<endpoint address="http://localhost:8081/tradeservice/trade.svc"
behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="MyProject.WebAPI.Trade.IJSONTradeService"
name="MyJSONTradeEP" />
<endpoint address="http://localhost:81/tradeservice/trade.svc"
behaviorConfiguration="BasicHttpEPBehavior"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="MyProject.WebAPI.Trade.ISOAPTradeService"
name="MySOAPTradeEP" />
</client>
<bindings>
<webHttpBinding>
<binding name="jsonWeb" maxBufferSize="1500000"
maxBufferPoolSize="1500000"
maxReceivedMessageSize="1500000">
<readerQuotas maxDepth="32" maxStringContentLength="656000"
maxArrayLength="656000"
maxBytesPerRead="656000" maxNameTableCharCount="656000" />
</binding>
</webHttpBinding>
<basicHttpBinding>
<binding name="soapWeb">
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="WebHttpEPBehavior">
<webHttp />
</behavior>
<behavior name="BasicHttpEPBehavior">
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service behaviorConfiguration="Default"
name="MyProject.WebAPI.Trade.TradeService">
<endpoint address="http://localhost:8081/tradeservice"
behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="MyProject.WebAPI.Trade.IJSONTradeService"
name="MyTradeEP" />
<endpoint address="http://localhost:81/tradeservice"
behaviorConfiguration="BasicHttpEPBehavior"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="MyProject.WebAPI.Trade.ISOAPTradeService"
name="MySOAPTradeEP" />
</service>
<service behaviorConfiguration="Default"
name="MyProject.WebAPI.Authentication.AuthService">
<endpoint address="http://localhost:8080/authservice"
behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="MyProject.WebAPI.Authentication.IJSONAuthService"
name="MyJSONAuthEP" />
<endpoint address="http://localhost:80/authservice"
behaviorConfiguration="BasicHttpEPBehavior"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="MyProject.WebAPI.Authentication.ISOAPAuthService"
name="MySOAPAuthEP" />
</service>
</services>
</system.serviceModel> |
|
|
| Back to top |
|
|
|
| pbd22... |
Posted: Wed Sep 16, 2009 5:29 pm |
|
|
|
Guest
|
On Sep 16, 7:27 pm, pbd22 <dush... at (no spam) gmail.com> wrote:
Quote: Hi.
I am having a dandy time trying to figure out how to set up my config
file for both JSON and SOAP endpoints.
Some Background - Originally, I had an error that said something to
the effect that I cannot have two endpoints listening at the same
location so I went about creating unique addresses for my endpoints.
Since the service names are the same but the addresses are unique, I
took out the "base address" and defined the address attribute in the
endpoint definition.
I am now getting this error:
The HttpGetEnabled property of ServiceMetadataBehavior is set to
true and the HttpGetUrl property is a relative address, but there is
no http base address. Either supply an http base address or set
HttpGetUrl to an absolute address.
I feel like I am just digging myself into a deeper hole - could
somebody show me an example of a config file that illustrates both
webHttpBinding and basicHttpBinding for two different service
definitions (TradeService and AuthService below).
Thank you!
system.serviceModel
<client
<endpoint address="http://localhost:8080/authservice/auth.svc"
behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="MyProject.WebAPI.Authentication.IJSONAuthService"
name="MyJSONAuthEP" /
<endpoint address="http://localhost:80/authservice/auth.svc"
behaviorConfiguration="BasicHttpEPBehavior"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="MyProject.WebAPI.Authentication.ISOAPAuthService"
name="MySOAPAuthEP" /
<endpoint address="http://localhost:8081/tradeservice/trade..svc"
behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="MyProject.WebAPI.Trade.IJSONTradeService"
name="MyJSONTradeEP" /
<endpoint address="http://localhost:81/tradeservice/trade.svc"
behaviorConfiguration="BasicHttpEPBehavior"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="MyProject.WebAPI.Trade.ISOAPTradeService"
name="MySOAPTradeEP" /
</client
<bindings
<webHttpBinding
<binding name="jsonWeb" maxBufferSize="1500000"
maxBufferPoolSize="1500000"
maxReceivedMessageSize="1500000"
<readerQuotas maxDepth="32" maxStringContentLength="656000"
maxArrayLength="656000"
maxBytesPerRead="656000" maxNameTableCharCount="656000" /
</binding
</webHttpBinding
<basicHttpBinding
<binding name="soapWeb"
</binding
</basicHttpBinding
</bindings
<behaviors
<serviceBehaviors
<behavior name="Default"
<serviceMetadata httpGetEnabled="True" /
<serviceDebug includeExceptionDetailInFaults="True" /
</behavior
</serviceBehaviors
<endpointBehaviors
<behavior name="WebHttpEPBehavior"
<webHttp /
</behavior
<behavior name="BasicHttpEPBehavior"
</behavior
</endpointBehaviors
</behaviors
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/
<services
<service behaviorConfiguration="Default"
name="MyProject.WebAPI.Trade.TradeService"
<endpoint address="http://localhost:8081/tradeservice"
behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="MyProject.WebAPI.Trade.IJSONTradeService"
name="MyTradeEP" /
<endpoint address="http://localhost:81/tradeservice"
behaviorConfiguration="BasicHttpEPBehavior"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="MyProject.WebAPI.Trade.ISOAPTradeService"
name="MySOAPTradeEP" /
</service
<service behaviorConfiguration="Default"
name="MyProject.WebAPI.Authentication.AuthService"
<endpoint address="http://localhost:8080/authservice"
behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="MyProject.WebAPI.Authentication.IJSONAuthService"
name="MyJSONAuthEP" /
<endpoint address="http://localhost:80/authservice"
behaviorConfiguration="BasicHttpEPBehavior"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="MyProject.WebAPI.Authentication.ISOAPAuthService"
name="MySOAPAuthEP" /
</service
</services
</system.serviceModel
OR... can somebody point out where I am going wrong in my current
config file?
Thanks again. |
|
|
| Back to top |
|
|
|
|