.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to get xml messages from service broker?

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :Sql Server



i wana know how can i get your XML messages from service broker (in case of distributed brokers) and how to parse them to produce our data?



View Complete Post

More Related Resource Links

net.tcp service does not recieve messages using WCF4 routing service multicast scenario


I am trying out the WCF 4.0 multicast scenario. i have two services exposed

Service A- using NetTcpBinding,

Service B-using basichttpbinding.

A WCF 4 Routing service is used to multicast messages to both the services.

When i send a message, only the service with basichttp binding recieves it. the other does not.

I modified service A to use basichttpbinding and it started recieving messages from multicast router.

Am I missing here something that nettcp service is not recieving messages from multicasting routing service.


Service Broker Queue message activates stored Proc as SA but the stored proc is unable to access oth


I have a queue whose activation I defined as below

ALTER QUEUE SomeInitiatorQueue
PROCEDURE_NAME = usp_SomeProc,

Now I am trying to access another database in usp_SomeProc as below

Select SomeColumn SomeOtherDb.dbo.SomeTable

Here I am getting this error "The server principal "sa" is not able to access the database "SomeOtherDb" under the current security context."

It never allows unless I grant all permissions on the database to all.

what is the solution?

wcf service sending messages

can a wcf service send messages to client connected to service?2 clients can send messages to each other using the service,but how can the service send messages by its own to all attached or new clients subscribed to it?what will i have to do for that?do respond..waiting

Mumtaz Surani

how to resolve conflict when using sql service broker to do bidirectional replication?


greetings ,,

after spending days in search about the best practice to make bi-directional replication between 2 databases on 2 distributed sql server instances ,,i have found that sql server service broker is the most suitbale with my business req to use as i have a problem with the updatable subscrption replication due to leased line between networks in 1 MEGA and it will be large amount data that will be replicated and that will not work as the latency will increase ,,but i need some help to know how can i resolve these conflicts when i am using sql server broker service:

1-If you insert a record that has a key into a table on one of the servers and another record that has the same key already exists on the other servers that participate in the replication, the replication does not propagate the changes to the other servers.

2-When you update a column in a record that is updated at the same time on another server, the data may be different on the two servers.

3-When you update different columns in a record, simultaneous updates of different columns of a record may sometimes lead to conflicts.

4-When you delete a row that is being deleted at the same time on another server that is participating in the replication, the replication fails because the DELETE statement does not affect any rows on some of the subscribers.


Verifying GRANT permissions on Service Broker CONTRACT and Queue


I am setting up SqlDependency and wish to verify that the permissions have been applied correctly.

One of the commands that should be run to grant permissions is to grant references on a contract for the user:

GRANT REFERENCES on CONTRACT::[http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification]  to [sql_dependency_subscriber]

How can I check whether the user e.g. 'databaseUser' has this REFERENCES granted on this contract? Which view/stored proc. to use?

The other command is similar (also required for SqlDependency) but grants permission "RECEIVE":

GRANT RECEIVE ON QueryNotificationErrorsQueue TO [sql_dependency_subscriber]

How could I verify that the RECEIVE permission has been granted?


I have currently used this command:

sys.database_permissions AS prmssn
INNER JOIN sys.database_principals AS grantee_principal
ON grantee_principal.principal_id = prmssn.grantee_principal_id
WHERE prmssn.class = 0

With this command I can see some permissions (such as CREATE PROCEDURE, CREATE QUEUE, etc.) but the above permissions related to  the contract and queue do not seem to show in the results from sys.database_permissions.

Thankful for any advice!


Service Broker Conflict



i want to make bi-diretctional replication between 2 databases each is one sql server instance,,after searching for the best way to do bi-directional replication i found that i can use service broker to exchange messages between 2 databases ,,but i have a question about conflict detecting and resolution and i need some help,,my question is how can i detect these type of conflicts that can be occured during exchanging messages ,,for examples,,

1-updating the same rows,,if each message containg the rows that are updated on each database .
2-updating rows on 1 database that are deleted on the other,,so when the message from data base 1 will contain an update statement for the rows that have been updated but when it arrives @ database 2 and executed the result will be 0 rows affected because those rows are deleted on database 2..
and there are other conflict,,i need some help or any ideas to know how can resolve those conflict ,,,
any suggestion will be highly apperciated

thnx all

Optimizing tempdb for service broker based operations


SQL 2005 Standard.

I have an application based on Service Broker that is very very slow.

I know that service broker is based on tempdb and tried to optimize it moving on a separate disk and creating a different filegroup with new, big enough datafiles into it.
However it is still slow ..probably also due to the fact that sql server is a virtual machine with no dedicated disk.

Can you please recommend the best practices for dealing with high tempdb workload ?

Thanks !!

problems with trace.writeline not writing output messages on multiple instance/thread service



I've come across something strange and can't quite figure out what could be going wrong. I have a windows service which processes queue items in a threadpool (default 5 threads).

So, during testing, i "debug, start new instance" and spin up about 4-5 instances of the service, and on average there is about 25 threads going at same time.

My trace code:
Trace.WriteLineIf(traceOutput.TraceVerbose, string.Format("processing Item for {0}", item.id));


this seems to work for a while and writes the trace code to the output window, but after a while, the trace output just stops being output to the window.. has anyone else experienced this before or could know what might be going wrong?




How to create a WCF service that is in compliance with Soap Messages with Attachments

Hi, I know that there are many ways to send attachments, but unfortunately i need to create a webservice that follows the "SOAP messages with Attachments" specification (http://www.w3.org/TR/SOAP-attachments). This specification can be sumarrizing as and Multipart MIME message that groups a Soap Envelope and more files as attachmens in differnent MIME parts, such as SOAP with Attachments MIME envelope -Root Body MIME part --Soap Envelope ---Soap Header ---Soap Body - Mime Part 2 --First File - Mime part 3 --Second File .... Hopefully that structure can be helpful,otherwise you can easily check in the specification page. I don't know how to do that: - Creating a Contract with one parameter that will a Message that will encapsules all the information, but this means that I need to create all the MIME parts manually. and lqater in the client I'll have to split the information and deserialized in objects. Any help would be great, Thanks in advance for your help. Cheers

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

WCF Tip: Using Properties in Service Contracts

you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Realizing a Service-Oriented Architecture with .NET

This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

Web Service for uploading documents into SharePoint

WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

Creating and Using an ASP.NET Web Service in Visual Web Developer

In addition to letting you create Web pages, Microsoft Visual Studio also lets you create Web services that use ASP.NET XML. Creating a Web service in Visual Studio is similar to creating a Web page. You can also use the Microsoft Visual Web Developer Web development tool to reference and use Web services that are in a Visual Web Developer solution, on your local computer or in a local or external UDDI directory. In this walkthrough, you will create the Web service in one solution and use it in another.

Tasks illustrated in this walkthrough include:

Creating a simple XML Web service in Visual Web Developer.

Creating a separate Web site that uses the Web service.

AutoGenerateSelectButton="False" ignored when using Domain Service


Crosspost from RIA Services forum: http://forums.silverlight.net/forums/t/196466.aspx

I'm creating a Dynamic Data application in VS2010 and have recently switched to using a Domain Service to give greater control over the data presented to the client. I've noticed that the AutoGenerate<Action>Button attributes on my GridView are being ignored. The presence of the Edit and Delete buttons appear to be contingent on the existence of Update and Delete methods on the partial classes autogenerated in the Domain Service, but i'm not seeing how to control the generation of the Select button. Is there a way to control this from within the Domain Service class?

User messages without hard coding


Hi All,


How to manage user messages to avoid hardcoding messages accross the web application.





ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend