 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
 |
|
 |
Is there a way to prevent all of the web methods from being displayed when browsing to an non RIA services WCF service?
Thanks,
Steve Holdorf
|
|
|
|
 |
|
 |
I have a wcf service setup for windows authentication. I have a silverlight application that allows users to navigate the web pages based on Active Directory windows authentication and there group roles. The problem I am having is that my wcf service does not allow for role based group security. Because of this, any active directory user is able to call any of the wcf service's web method no matter what their group role is. I need to setup my wcf service to only allow users in certain roles to call a subset of the services web methods. Please help.
Thanks,
Steve Holdorf
|
|
|
|
 |
|
 |
sounds like you might have to extend/override the RoleProvider and lookup the AD User groups yourself in code? yuck!
|
|
|
|
 |
|
 |
If I build up a proxy for a client and at some point the actual service extends one of the DataContracts will it break the receiving client?
For example say I have a service that has a method of public Team GetTeam(int teamID); and then lets define Team like this:
[DataContract]
public class Team
{
[DataMember]
public Employee[] Members {get; set;}
[DataMember]
public Employee Leader {get; set;}
}
and we will define (at first) Employee like this:
[DataContract]
public class Employee
{
[DataMember]
public string Name {get; set;}
}
******************************
So we can 'Extend' in 2 ways (well that I see and want to know about)
First:
[DataContract]
public class Employee
{
[DataMember]
public string Name {get; set;}
[DataMember]
public int ID {get; set;}
}
Second instead of the ID being in the Employee we decide to make a base
[DataContract]
public class Person
{
[DataMember]
public int ID {get; set;}
}
And have Employee inherit from it.
[DataContract]
public class Employee : Person
{
[DataMember]
public string Name {get; set;}
}
*******************************
In either case I am wondering will the client still receive the Employee object as it knows it (i.e. there is not an ID property)? Or will one of the cases or maybe both, cause the Employee object to fail construction and not return anything (i.e. receive a Null even though the service populates it)?
Thak you.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
|
|
|
|
 |
|
 |
DataMember has Properties which can change the behavior.
Read this and drill down into referenced articles as well.
http://msdn.microsoft.com/en-us/library/ms733832.aspx[^]
That said you should also consider what is likely to happen rather than trying to adjust to all possible outcomes. Normally you are unlikely to do more than add new attributes to existing entities. More significant changes should require a version (specified via the base url) change.
Other than that I would consider your base class example (Employee/Person) suspect because it should only occur if someone badly messed up the original architecture.
|
|
|
|
 |
|
 |
Thanks for the reference. I am not wanting to version for such minor changes. Looks like I can append 'Optional' and it should work... I will give it a try.
jschell wrote: Other than that I would consider your base class example (Employee/Person)
suspect because it should only occur if someone badly messed up the original
architecture.
This is not at all true. An object that is published in a webservice can be used with in the system publishing the service. If that system decides to extend the object for whatever reason it should be allowed to with out breaking its publishing, thus having to version etc.
It is the base idea of extend do not modify, yet what you are somewhat saying, is that wether one extends or modifies they must version and force upgrades.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
|
|
|
|
 |
|
 |
Collin Jasnoch wrote: This is not at all true. An object that is published in a webservice can be used
with in the system publishing the service. If that system decides to extend the
object for whatever reason it should be allowed to with out breaking its
publishing, thus having to version etc.
That however is not what I said.
The fact that something is possible doesn't mean that all possible scenarios that lead to that possibility are good.
Your example demonstrates something that in all likelyhood started with a poor design and someone attempts to 'correct' it (hopefully not just making the original bad design worse.)
|
|
|
|
 |
|
 |
My example was merely that, an example. It was a dumbed down classic 'employee' and I would hardly say that if someone decided to add a FK relationship to their internal design it is a poor design.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
|
|
|
|
 |
|
 |
Collin Jasnoch wrote: My example was merely that, an example. It was a dumbed down classic 'employee'
and I would hardly say that if someone decided to add a FK relationship to their
internal design it is a poor design.
You started with an exposed entity that did not use inheritance and then hypothesized that the future update added inheritance.
That scenario suggests a poor design.
|
|
|
|
 |
|
 |
I merely covered all bases for 'extending' an object. If an object inherits nothing it is by default inheriting from object. By then having it inherit from a user defined object you are extending it with all public properties and methods of that object. Much as if you added it directly to the object itself. In fact, for all purposes that is how it will be serialized. This is in fact common refactoring practice (not poor design adjustments). Maybe you want to argue now that if someone refactors they had a poor design
As for me hypothesizing that the future update added the inheritance, I in fact eluded to the opposite. That it would be missing the inheritted properties and methods, and asked if instead the serializer would null the entire object out because the contract was missing some properties.
Please read posts more carefully before critizing someones 'simple' example as a poor design. There was no design in it. It was meant to be an example for clear question that would obtain a clear answer.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
|
|
|
|
 |
|
 |
Collin Jasnoch wrote: In fact, for all purposes that is how it will be serialized. This is in fact
common refactoring practice (not poor design adjustments).
I know how inheritance works.
They way I read this entire thread was that the FIRST version (where you used "at first" in the OP) of the web interface would have a data object which did not use inheritance.
Then the SECOND version of the web interface, where I assumed it was second because you said "will the client still receive", was adding inheritance.
Thus one started with a public facing design for the first version and it was released that way. Then the decided that the second version would use inheritance, in the public facing api.
A public facing interface is not a simple implementation and should be given a thorough review BEFORE implementing to it. To rework it in version two with the specific semantics suggested with the expectation that version 1 clients should still consume it, strongly suggests that the original design was poorly thought out.
The most important factor in the above is not whether inheritance or not should be used but rather that it is public API.
But regardless of that inheritance should be used carefully in all code and most of the time a public web interface should not be using it (just as mos code should not use it.) This also is another factor that suggests that the sequence (design of 1 leading to 2) is somehow flawed.
Collin Jasnoch wrote: Please read posts more carefully before critizing someones 'simple' example as a
poor design. There was no design in it. It was meant to be an example for clear
question that would obtain a clear answer.
Huh?
First I didn't claim that it was absolutely a poor design but rather it likely was. And I was referring to a real implementation of such a design and NOT just the example.
Second, it appears that you are distancing yourself from the fact that it is a represents a design in the first place.
So let me make it more clear what I said...
If such an implementation existed in version one of a public API and if ones follow up solution in version two was to use inheritance then that suggests that there is a design flaw either in version one, two or both.
|
|
|
|
 |
|
 |
Meh. Stop trolling.
You couldn't give a straight answer so you keep comming back an critisizing my straightforward question.
You critisize 'design' when the post clearly said 'simple example'. Who the frak cares about poor design or any design for that matter in this thread? (I think I said it multiple times) I did not ask about best practices, I simply asked what will happen in either of the 2 cases.
To which you did not answer but provided a link. Useful link, but still not an actual answer. Move along, nothing to see here.
You are the same type of person that when asked a question as simple as "Say you have 5 peanuts and eat 2 how many do you have?" your reply is "Oh I am alergic to peanuts so I can not eat them. This is a bad question. Please change it for me."
Again, stop trolling.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
|
|
|
|
 |
|
 |
Collin Jasnoch wrote: To which you did not answer but provided a link. Useful link, but still not an
actual answer. Move along, nothing to see here.
To be clear actually I also said
"DataMember has Properties which can change the behavior."
My first inclination was to post just the properties but I thought that link was better since it was the one I used to base the standards on which my company, based on their practices, needs and expectations, moves forward in adopting to new versions of web interfaces.
Other companies have different needs and as such they should come up with their own approach. One can't do based solely on the need to use a web interface, but rather it must also take into account the business needs of the company.
Collin Jasnoch wrote: Who the frak cares about poor design or any design for that matter in this
thread?
Still not clear...you are both defending the design and claiming that it isn't a design.
As I made clear several times if that was a design then it suggests a problem. So you are stating it isn't a design thus you do not need to defend it as such.
|
|
|
|
 |
|
 |
jschell wrote: Still not clear...you are both defending the design and claiming that it isn't a
design.
Let me be totally clear here as to what I said.
Collin Jasnoch wrote: For example
Collin Jasnoch wrote: lets define Team like this:
Collin Jasnoch wrote: and we will define (at first) Employee like this:
Collin Jasnoch wrote: So we can 'Extend' in 2 ways (well that I see and want to know about)
Collin Jasnoch wrote: First:
Collin Jasnoch wrote: Second instead of the ID being in the Employee we decide to make a base .... And have Employee inherit from it.
It does not take a rocket scientist to realize I just stepped you through a trivial example. Yet here you are still talking about design.
And since you need someone to hold your hand I have emphasized what I actually asked bellow.
Question 1:
Collin Jasnoch wrote: In either case I am wondering will the client still receive the Employee object
as it knows it (i.e. there is not an ID property)?
Question 2:
Collin Jasnoch wrote: Or will one of the cases or maybe both, cause the Employee object to fail
construction and not return anything (i.e. receive a Null even though the
service populates it)?
jschell wrote: DataMember has Properties which can change the behavior. Read this
and drill down into referenced articles as well. http://msdn.microsoft.com/en-us/library/ms733832.aspx[^]
Which does not provide an answer. I was still forced to go through building up my services and testing them. Thank you for waisting my time Mr. Troll.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
|
|
|
|
 |
|
 |
Collin Jasnoch wrote: Which does not provide an answer. I was still forced to go through building up my services and testing them. T
Presumably with inheritance...good luck with that then.
|
|
|
|
 |
|
 |
ACtually if you really must know, I was more on the other side. I.e. I am building a client that uses someones service. And I was curious when they would be 'breaking' that.
But whatever. Obviously you got so stuck on stupid details, you still could not provide an answer.
Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.
|
|
|
|
 |
|
 |
I'm trying to run a very simple WCF service. Everything's written, but when I run it, I get
WCF Service Host cannot find any service metadata. This may cause the client application to run improperly. Please check if metadata is enabled. Do you want to exit?
Here's my config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
<service name="WcfServiceLibrary1.CustomerService"
behaviorConfiguration="Metadata">
<endpoint address=""
binding="wsHttpBinding"
contract="WcfServiceLibrary1.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Metadata">
<serviceMetadata httpGetEnabled="true" />
</behavior>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
What's wrong here???
Everything makes sense in someone's mind
|
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
I have a Silverlight application using WCF. Now, I can get the wcf service to talk to the application with Anonymous Authentication enabled; however, I do not want Anonymous Authentication enabled as I want to use Windows Authentication. I have tried making changes to the WCF web.config and the Silverlight References.ClientConfig but nothing seems to work. If possible please provide as much details as possible. Thanks in advance.
Steve Holdorf
|
|
|
|
 |
|
 |
I assume your WCF service is hosted in IIS7? if so, you need to disable the anonymous authentication of your site and only enable windows authentication.
If it's not IIS7, please provide more information on your hosting environment and if the call is a cross-domain call
|
|
|
|
 |
|
 |
Hello All,
I need to write an WCF service which would be accessed from iPhone/Android phone application.
WCF service should provide chat functionality and other required end point methods to the installed phone application.
Here I have few queries:
1. Can we implement duplex communication for this, between wcf service and iphone / android application?
2. What would be better solution, hitting a WCF webservice from phone application after some interval of time or putting some callback in phone device?. As i need some chatting kind behaviour in phone where two phone user should chat to each other through the connected WCF service.
Can you please suggest approach and helpful links for same.
Thanks in Advance.
|
|
|
|
 |