VENTAS: 1-800-867-1389

 none
windows azure wcf problems using an asmx file with logic in an svc

    Pregunta

  • Hi,

    Currently in the company there is a service that is running in windows azure, I did some changes that needs to go to production but the service is not working properly when I run this in the Azure Emulator. 

    In the visual studio solution it looks something similar to this:

    -Service1.svc.cs //<-- It has all the implemented methods

    -Service1.svc 

    -Service1.asmx//<-- It uses the logic in Service1.svc.cs

    My problem is that if I run this not using windows azure it works perfect, but if I run this from windows azure emulator it does not work properly, the result is opened in another window using a different port.

    For example:

    If i am calling a method in the following address

    http://127.0.0.1:81/Service1.asmx

    When I execute the method it returns something like this

    http://127.0.0.1:82/Service1.asmx/CurrentVersion

    I read that for previous versions it existed  a problem with WCF and the load balancers, but in this case I am using .Net 4.0 and Azure 1.7

    En el webconfig del servicio tambien agregue la configuracion que muestro abajo pero no me funciono.

    In the webconfig I also added some configuration that in other forums says that it would solve the problems with the balancers.

     <behaviors>
          <serviceBehaviors>
            <behavior name="DefaultServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <!-- Test from microsoft -->
              <useRequestHeadersForMetadataAddress>
                <defaultPorts>
                  <add scheme="http" port="81" />
                  <add scheme="https" port="444" />
                </defaultPorts>
              </useRequestHeadersForMetadataAddress>
            </behavior>
          </serviceBehaviors>
        </behaviors>

    Does anyone know how should I tackle the problem?

    Below is an example of my code:

       public class Service1 : IService1
        {

            public string CurrentVersion(string accountcode)

            {
                SiteServiceConfiguration sitecfg = GetSiteServiceConfiguration(accountcode);
                return sitecfg.CurrentVersion;
            }

     }

        [ServiceContract]
        [WebService(Name = "Service1")]
        [WebServiceBinding(Name = "ServiceSoap1", ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = false)]
        public interface IService1
        {
            [OperationContract]
            [WebMethod]
            string CurrentVersion(string accountcode);

        }

    Other info:

    This webservice is called from an application written in .net 1.1, while this is upgraded to a newer version I need to make the service to work.

    Any help is appreciated.

    Thanks


    Jose Luis

    viernes, 07 de septiembre de 2012 23:14

Respuestas

  • Hi,

    This issue should only happen in simulator. For testing purpose you can debug service first. Get the port number and update port number in the client configure file, then start client.


    Allen Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marcado como respuesta jlglezArmenta lunes, 10 de septiembre de 2012 16:34
    lunes, 10 de septiembre de 2012 9:58
    Moderador

Todas las respuestas