Bloqueada Expose a Metadata Endpoint to my servicebus

  • viernes, 01 de julio de 2011 9:12
     
     

    Hello,

    I wrote a little sample wcf service which can be accessed over Azure AppFabric ServiceBus. Now I want to use this service as service reference in another Visual Studio project. How can I expose a metadata endpoint to my servicebus?

     

    This is how I created the service:

    WebServiceHost host = new WebServiceHost(typeof(HeckleService), new Uri("http://localhost:7777/helloworld"));

    host.AddServiceEndpoint(typeof(IHeckle), new WebHttpBinding(), String.Empty);

     

    var address = ServiceBusEnvironment.CreateServiceUri("http", "secretnamespace", "helloworld");

    var binding = new WebHttpRelayBinding();

     

    binding.Security.RelayClientAuthenticationType = RelayClientAuthenticationType.None;

    binding.Security.Mode = EndToEndWebHttpSecurityMode.None;

     

    var contract = typeof(IHeckle);

     

    var tokenProvider = new TransportClientEndpointBehavior();

    tokenProvider.CredentialType = TransportClientCredentialType.SharedSecret;

    tokenProvider.Credentials.SharedSecret.IssuerName = username;

    tokenProvider.Credentials.SharedSecret.IssuerSecret = usersecret;

     

    var cloudEP = host.AddServiceEndpoint(contract, binding, address);

    cloudEP.Behaviors.Add(new WebHttpBehavior());

    cloudEP.Behaviors.Add(tokenProvider);

     

    var srs = new ServiceRegistrySettings();

    srs.DiscoveryMode = DiscoveryType.Public; 

    cloudEP.Behaviors.Add(srs);

     

    host.Open();

    Console.WriteLine("Listening:");

    host.Description.Endpoints.ToList().ForEach(ep => Console.WriteLine(ep.Address));

    Console.WriteLine();

    Console.ReadLine();

    host.Close();

     

    Thanks for your help and best regards,

    Timo

Todas las respuestas

  • viernes, 01 de julio de 2011 16:29
     
     Respondida

    I'm a little confused about your questions.

    can you give more details?

    are you asking how to create a custom service and display it on designer?

     

    maybe you can refer to the sample code on this page.

    http://www.microsoft.com/download/en/details.aspx?id=17691

     or maybe some sample code I pasted here

    http://social.msdn.microsoft.com/Forums/en-US/appfabricctp/thread/ece8db28-41c5-4510-801b-555a900a85ed

    Please let me know if this is not what you are looking for.


    • Marcado como respuesta TimoMeier martes, 12 de julio de 2011 9:14
    •  
  • lunes, 04 de julio de 2011 14:38
     
     

    I want to add a wsdl interface to my serivce.

    It works on localhost but not in the cloud.

    The service in the cloud works fine  but Iam to stupid to add a wsdl interace.

  • martes, 05 de julio de 2011 3:58
     
     

    are you talking about svcutil.exe  /wsdl doensn't work for your service ?




  • martes, 05 de julio de 2011 13:05
     
     

    svcutil http://XXX.servicebus.windows.net/SV/http/mex works fine

    but I want to get WSDL Information with the webbrowser by calling this url. When I open the URL in firefox i receive:

    <Error>
    <Code>500</Code>

  • martes, 05 de julio de 2011 18:24
     
     

    it's a little strange.

    can you send me your repro app?

     

    sophy_yuye@hotmail.com

     

    and also give me the url you try to open in firefox?

  • miércoles, 06 de julio de 2011 1:53
     
     

    Hello - You can take a look at the MetadataExchange sample for ServiceBus. You can find the sample here -  

    http://servicebus.codeplex.com/

     

    Thanks

    Pradnya

     


    Lead Software Design Engineer / Test, AppFabric Platform Services