Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I have an issue which has been causing me a headache for a few days now. It is the implementation of a Web Service Client using C#, .NET 4.5 and Visual Studio 2012

I can access the Web Service Endpoint and create the Service Reference. However the following warnings are generated:

XML
Warning 1   Custom tool warning: Unreachable policy detected.
A WS-Policy element embedded in WSDL is missing a fragment identifier. This policy cannot be referenced by any WS-PolicyAttachment mechanisms.
XPath://wsdl:definitions[@targetNamespace='http://www.somecompany.com/schema/fulfilment/deployment/edi/inbound/v2/']/wsdl:definitions[@name='EDI10somecompanyService']  C:\ALPHAHSEDI10\somecompanyServiceSend\somecompanyServiceSend\Service References\EDI10HSS2\Reference.svcmap 

Warning 2   Custom tool warning: The following Policy Assertions were not Imported:
  XPath://wsdl:definitions[@targetNamespace='http://www.somecompany.com/schema/fulfilment/deployment/edi/inbound/v2/']/wsdl:binding[@name='EDI10somecompanyServiceSOAP']/wsdl:operation[@name='UpdateJob']/wsdl:input
  Assertions:
    <sp:SecurityToken xmlns:sp='http://schemas.xmlsoap.org/ws/2002/12/secext'>..</sp:SecurityToken>
    <sp:SupportingTokens xmlns:sp='http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512'>..</sp:SupportingTokens>
    C:\ALPHAHSEDI10\somecompanyServiceSend\somecompanyServiceSend\Service References\EDI10HSS2\Reference.svcmap

I *think* that the unreachable policy is having a knock on effect when building and using this through the service reference.

When instantiating a class instance thus:

SomecompanySend.EDI10SC.EDI10ComeCompanyServiceClient edi10sc = new EDI10ComeCompanyServiceClient(configurationname, remoteaddress);

the following exception is thrown:

Could not find endpoint element with name 'EDI10SomeCompanyService' and contract 'EDI10SC.EDI10ComeCompanyService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.

I am pretty sure the remote address and endpoint values are correct. I used them to access the wsdl and build the service reference.

Now I don't know if the two issues are related, I am hoping there is a Web Service etc. Guru on here who can shed some light. My experience with Web Services is not great; I have done a couple of services in the past but never encountered this.

The problem I have in resolving this is that the web service I am trying to build for is at a completely different company and my contact there knows not much more than me about this stuff :-(

Any help much appreciated.
Posted
Updated 23-Apr-14 1:36am
v2

1 solution

This is resolved!

Talk about a rookie mistake .. I had the Classname and Namespace name set to be the same thing. This confuses the hell out of Visual Studio without giving you a warning.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900