0

I have a wcf webservice which is up and running. I have also visual studio 2012. I try to follow these tutorial to consume the wcf webservice in a console application:

http://www.csharptutorial.in/2012/01/cnet-how-to-consume-wcf-web-service-in.html#.UxxME_6x6JA

One of the first step is to running this SvcUtil.exe commando:

C:\WcfFiles>"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\SvcUtil.exe" http s://service.mycompany.nl/PortalService.svc?wsdl

I got this error:

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648]
Copyright (c) Microsoft Corporation.  All rights reserved.

Attempting to download metadata from 'https://service.mycompany.nl/PortalServic
e.svc?wsdl' using WS-Metadata Exchange or DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot obtain Metadata from https://service.mycompany.nl/PortalService.s
vc?wsdl

If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess.  For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.


WS-Metadata Exchange Error
    URI: https://service.mycompany.nl/PortalService.svc?wsdl

    Metadata contains a reference that cannot be resolved: 'https://service.mycompany.nl/PortalService.svc?wsdl'.

    The HTTP request is unauthorized with client authentication scheme 'Anonymou
s'. The authentication header received from the server was 'Basic realm="service
.mycompany.nl"'.

    The remote server returned an error: (401) Unauthorized.


HTTP GET Error
    URI: https://service.mycompany.nl/PortalService.svc?wsdl

    The document was understood, but it could not be processed.
  - The WSDL document contains links that could not be resolved.
  - There was an error downloading 'https://sehapp01.dmz.rubicongroup.local/SEHP
ortalService.svc?wsdl=wsdl0'.
  - The underlying connection was closed: Could not establish trust relationship
 for the SSL/TLS secure channel.
  - The remote certificate is invalid according to the validation procedure.

If you would like more help, type "svcutil /?"

C:\WcfFiles>
Ola
  • 1,188
  • 5
  • 16
  • 35
  • You can also try enabling Anonymous Authentication on the IIS application running/hosting the service. – Tim Mar 09 '14 at 18:07
  • How can I authorize my self? I have the username/password but dont know where to use them! – Ola Mar 10 '14 at 07:41

1 Answers1

0

Try the WcfTextClient to consume the Wcf.

Is in the following path: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE

And there you wil lfind the WcfTestClient.

Open it, run your Wcf and then start the service in the WcftextClient, there you will be able to consume and call the methods ;)

Oscar Bralo
  • 1,912
  • 13
  • 12
  • 1
    This doesn't really answer the OP's question. – Tim Mar 09 '14 at 18:06
  • I did already but it gives me the same error. The webservice has credentials, but I dont know where to use them to consuming. – Ola Mar 10 '14 at 07:40