I have found the issue and it is related to non microsoft SOAP proxy
generators. I doubt all but certainly the main ones I have used i.e.
wsimport for Java and wsdl2php (a colleague used not me).
If you type in "duplicate "message" entity" into google, you only get
about 2 pages of results and some of the answers are not helpful. One
of the forums which I cam across was this one:
http://old.nabble.com/-Issue-841--New----ERROR--duplicate-%22message%22-entity:-%22PingRequest%22-td27931461.html
And reading down the posts I came across two interesting leads being:
1) FQDN
2) seRequestHeadersForMetadataAddress
Now the 2) is specific to .NET 4 and not available for earlier
releases, and is a common behaviour config for the
system.serviceModel. It sounds like this also would have solved my
issue. You will see an example inside that forum thread but anyway it
looks like this:
<commonBehaviors>
<serviceBehaviors>
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<add port="443"
scheme="https"/>
</defaultPorts>
</useRequestHeadersForMetadataAddress>
</serviceBehaviors>
</commonBehaviors>
The one which lead me to solve my issue was 1) relating to FQDN (Fully
qualified domain name) . When I saw the definition of this I
immediately thought of something which I could not understand earlier
in the day. I am using IIS to test my services and as per usual I
would navigate to said service like :
http://localhost/Services/Service.svc
Cool, only when I get there, the address for the wsdl which appears in
the default .svc page from microsoft has the following address:
http://d8l10g4j.ad.xxxxxxxxxxxxxx.com/Services/Service.svc?wsdl
No, i had not given this much thought earlier and so in the wsimport
bat file I made I was trying the following addresses to generate it:
http://127.0.0.1/Services/Service.svc?wsdl
http://localhost/Services/Service.svc?wsdl
http://10.0.2.40/Services/Service.svc?wsdl
None of which worked, but which I thought should and would work. :-S
So as I say after I read the definition of the FQDN I thought I wonder
if I need to put in the url which is generated on the .svc page for
the wsdl and as it turns out, I did have to do that. Now I get the
proxy generating just fine.
Although I can get this to work, I am going to still try and find out
what is causing the url to resolve to FQDN as opposed the url which I
used to navigate to the service.
Anyway, thought I would post in case others get the same issue.
Cheers for now,
Andy