3
votes

I have wcf service with udp binding (new in WCF 4.5) and I'm trying to host it on Windows Server 2012 on Azure.

I did endpoint mapping on Azure for port I need (39901; it works for HTTP:80, I can see IIS website) and I allowed all traffic in firewall for this port. But I still can't get wsdl in web browser.

Here is app.config for console app:

<configuration>
<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior>
                <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="true" />
                <serviceThrottling maxConcurrentCalls="12" maxConcurrentInstances="56" maxConcurrentSessions="12" />
                <useRequestHeadersForMetadataAddress></useRequestHeadersForMetadataAddress>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        <service name="ServerService.UdpServiceAlpha">
            <endpoint address="soap.udp://localhost:8091" binding="udpBinding" contract="ServerService.IUdpServiceAlpha" />
            <host>
                <baseAddresses>
                    <add baseAddress="http://localhost:39901/SelfServerHost/" />
                </baseAddresses>
            </host>
        </service>
    </services>
    <protocolMapping>
        <add binding="udpBinding" scheme="soap.udp" />
    </protocolMapping>
    <bindings>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>

For localhost everything works fine... I'm new in this (azure, windows server deployment) and I tried a lot of ideas here on stackoverflow or anywhere else. But still not working.

Any idea?

EDIT1:

<services>
        <service name="ServerService.UdpServiceAlpha" behaviorConfiguration="UdpServiceAlpha.Behavior">

            <endpoint address="/" binding="udpBinding" contract="ServerService.IUdpServiceAlpha"/>
            <endpoint address="/" binding="webHttpBinding" contract="ServerService.IUdpServiceAlpha"/>
            <host>
                <baseAddresses>
                    <add baseAddress="http://xxx.cloudapp.net:39901/SelfServerHost/" />
                    <add baseAddress="soap.udp://xxx.cloudapp.net:39901/SelfServerHost/" />
                </baseAddresses>
            </host>
        </service>
    </services>
3
I'm not totally sure, but I believe there should by some property "ServiceDescription" or similar set to the metadata URL.Codor
@Codor ...and what should I do with it? which URL metadata? ... do you have some example how to set up this correctly?marcel

3 Answers

0
votes

Try changing the Azure VM Endpoint public port from 39901 to 443!

A hell lot of sys-admins and ISPs block all outgoing ports, and only allow few (outgoing port white listing). Port 80 and 443 are usually never blocked because it is usually HTTP traffic.

Change only the public port for the VM Endpoint. Leave the private port as is - 39901.

0
votes

Your configuration file seems to have a few issues:

The service behavior is missing a name:

  <serviceBehaviors>
        <behavior name="my.service.behavior"> ...

The service needs to reflect the binding configuration

<service name="ServerService.UdpServiceAlpha" behaviorConfiguration=" my.service.behavior ">
0
votes

Yeah, finally... got the solution for this. My friend (network big boss :) ) told me how port communication works... Idea was simple: "check once again server and client firewall ports", and here is that point "client firewall".

I allowed only server firewall ports, but there should be allowed communication for client. Added TCP/UDP Outbound rule in client PC and it works magically.

... and for UDP I needed to change TTL (default is 1).