Generate client proxy returns error

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
May 5, 2008 at 6:02 PM
Not sure what gives but if I run svcutil with my host web site it does not return an error, it generates a client class.

but if I use the host model tool / generate proxy it errors out.

also if I use project explorer / add service ref that works also.

I have not looked at the code used by the generate proxy link so I do not know what it does that is failing to work.

this is the "Modeling edition for VS 2008" with VS 2008 Pro.

the 15 minute quick walk thru works.
the steps up to generate proxy all seem to work.
the web site builds and runs.

any ideas ?
Developer
May 6, 2008 at 4:43 PM
Do you have further details about the error that throws the host model proxy generation?
May 6, 2008 at 10:13 PM


charlyfriend wrote:
Do you have further details about the error that throws the host model proxy generation?


perhaps tonight or tomorow... lot's of stuff going on...
May 7, 2008 at 6:13 PM
error:
The recipe 'Add WCF Service Reference' (CreateWCFClientProxy) throw an exception while executing the action 'UpdateClientConfig'.
Error description: There was an error downloading 'http://localhost:52486/xxxxxx.Host/PostService.svc/Post'..

using srvutil makes a proxy.

can anyone shed light on what steps the GUI is doing ?
I downloaded the source and tried to find the code that is used but there are a LOT of files and folders in this package....
if I knew more about what it is doing I might be able to see if I made an error or not.
May 7, 2008 at 6:33 PM
running that URL thru the svcutil I got this:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>
<s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">
a:ActionNotSupported</faultcode>
<faultstring xml:lang="en-US">
The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher.
This may be because of either a contract mismatch
(mismatched Actions between sender and receiver)
or a binding/security mismatch betwee
n the sender and the receiver.
Check that sender and receiver have the same
contract and the same binding
(including security requirements, e.g. Message, Transport, None).
</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>

now to try and figure out what is mis-matched.

perhaps the next version of the GUI can tell us what's wrong in more detail...
May 7, 2008 at 7:22 PM
Ok I took all my data messages off the service and made other changes but still get this error.

the only warning I get when generating code is one about resx generation -- so far I thought that would not be important ? or is that a big deal ?

at this point I am ready to just go back to manual building and forget this tool, to hard to know what is wrong and I can not find anything wrong in my design.
Developer
May 8, 2008 at 1:15 AM
Did you try running the host (the above URL) ? did you get the standard description page or an error?
If you add the ?WSDL at the end of the URL you get the WSDL xml page?
May 8, 2008 at 1:19 PM


charlyfriend wrote:
Did you try running the host (the above URL) ? did you get the standard description page or an error?
If you add the ?WSDL at the end of the URL you get the WSDL xml page?


No error.

standard "front page" and yes I can see the wsdl / xml page.

if I try the URL that throws the error (as shown by VS in the GUI) then I do get an error.

so http://localhost:1234/project.name/servicename.svc works.
it can genarate a wsdl

but when I add /post then it gets errors

http://localhost:1234/project.name/servicename.svc/post
fails.

but what is the service factory doing in trying to access that url ?
what is it trying to get ?

when I look at the 15 minute "BlueYonder" sample which I did w/o any errors and compare it to my models and settings they seem to be the same.
other than my data contracts beeing different and I only have one service / method I am trying to build.

in my data and service model I amjust trying to post an order and get back a confimration of the order as "posted"
or get a fault if it failed in an "unexpected" way.

so I have a request, reply,fault

the request and reply each have a collection of details and an enum
the data model and service model and the host all validate w/o errors.

I may try starting over and see if I get the same results with some minor changes in the model.

I wish that fault message told me more detail, as it stands it looks like my settings are right so what the heck does
*"The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher.
This may be because of either a contract mismatch "*

that mean ?
Developer
May 8, 2008 at 2:21 PM
I don't see any reason why you need to add /post to your wsdl URL.
On the other hand, are you using IsWrapped property set as tru or false in your Message request/response definition?
May 8, 2008 at 2:47 PM


charlyfriend wrote:
I don't see any reason why you need to add /post to your wsdl URL.
On the other hand, are you using IsWrapped property set as tru or false in your Message request/response definition?


I was not adding that.

if you look back at my earlyer posts VS showed an error message that used that "/Post" -- as the point where it failed.

But...

I think I found the problem :--)

when first trying to create my project I somehow got one thing wrong and none of the steps untill the client proxy gave me any error messages or warnings...

"XML Namespace" I had copied in a URN:aaa.bbb.ccc.ddd format when it wanted an HTTP://subdomain.domain.tld/this/that formated string.

I used two monitors and had blueyonder open in one copy of VS and my solution in the other screen
walked thru the two and noticed that difference.

so that was the problem.

and all the "Vaidate datamodel" and "Validate Servicemodel" and "Validate Hosting model" tests did not flag / warn this as a possible problem.
I don't know right now why I put that URN in.... at least now I know what cused all this mess...
I do wish the "Validate" steps would have warned me.

Developer
May 8, 2008 at 2:59 PM
That's an interesting catch. Is wierd the need of a particular format since the XML ns is just a simple ID with a URI format like "urn:xxx" or "http://xxx".
Perhaps you had set different formats in some parts of your messages/contract and therefore you get that error. Nevertheless, a validation rule may detect this and raise some warning.
Feel free to post this issue to the "Issue tracker" section in this site so that may be fixed in a future version.

Thanks,
CF
May 8, 2008 at 8:41 PM


charlyfriend wrote:
That's an interesting catch. Is wierd the need of a particular format since the XML ns is just a simple ID with a URI format like "urn:xxx" or "http://xxx".
Perhaps you had set different formats in some parts of your messages/contract and therefore you get that error. Nevertheless, a validation rule may detect this and raise some warning.
Feel free to post this issue to the "Issue tracker" section in this site so that may be fixed in a future version.

Thanks,
CF


Yeah I will add it... and I am for sure it was the same in all places...
it may be that it was ok to have it in several places but not in others.... something about how it's processed.

also I will add a sugjestion for generating a proxy for .net CF 3.5
I am updating a system I wrote 3 years back....

I have about 60 CE handhelds and about 60+ PC's that do sales stuff and all of them use web services to send /recive data.
for .Net CF they have a NetCF version of SvcUtil that has to generate a cf compatible client proxy.
I hope as I get this ready I can keep one set of source files with just a couple of differences for desktop Vs CE
keep the interfaces / Contracts the same 100% server side code the same 100% just the client proxy a bit different.

I wish WCF had been ready in 2005 when I first built the system :--) Oh Well.