Self-service wcf on azure vm windows server

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

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

Here is the app.config for the 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 to this (azure, windows server deployment) and I've tried a lot of ideas here on stackoverflow or elsewhere. But still doesn't work.

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


source to share


3 answers


Yes finally ... got a solution for this. A friend of mine (the main boss of the network :)) told me how the port communication works ... The idea was simple: "check the server and client firewalls again", and this item is "client firewall".

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



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

0


source


Try changing the shared port of the Azure VM endpoint from 39901 to 443!

Many of the sys admins and ISPs block all outgoing ports and only allow a few (whitelisted outgoing port). Port 80 and 443 are usually not blocked as this is usually HTTP traffic.



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

0


source


There are several issues with your config file:

Service behavior is missing name:

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

      

The service should reflect the binding configuration

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

      

0


source







All Articles