An error occurred when verifying security for the message
Can someone provide with with an example
Can someone provide with with an example
Your question is a bit too vague. If you mean how does a stand-alone application call a web service implemented in WCF follow the following steps and look at the samples in the Windows SDK.
1) Use the context menu on the "References" entry in your project to add a web reference.
2) In the dialog select the URL for your service and it will import the WSDL and create the client stub for the service named <service>Client.
3) The stub will have methods on it that let you call the web service operations on the service.
The XML page cannot be displayed The document at the url http://localhost:8080/InOut was not recognized as a known document type.
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
XML document must have a top level element. Error processing resource 'http://localhost:8080/InOut'. The box on the upper right reported:
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'Root element is missing.'.
- Report from 'WSDL Document' is 'There is an error in XML document (0, 0).'.
This happened because the SOAP server was pinged without a XML document. The tool just apparently pinged the SOAP server without any data.
Is there a way in which I can get around this.
Better yet, is there a way in which I can do this manually.
Could someone send me an example of an annotation of to reference a non-WCF SOAP server (how to reference the call with a servicecontract and an operation contract, and the necessary config code. Could someone please send me an example of such a client ?
You may have to do it form first principals , if it the service does not support retreiving the wsdl . This is more in the .NEt world anyway ( real programers code all XML and web services proxies by hand ;-) )
Please note i had the same issue with a WCF server that it crashed when there was an empty message so i changed the server . Supporting proxies is crtical unless you want to spend a month doing it from scratch.
You really need to get a hold of the wsdl of the server either as a file or sometimes you can go 'http://localhost:8080/InOut?wsdl ' this works on .NET asmx web services and WCF web services,
If you have the wsdl as a file you can use the wsdl.exe tool to create a proxy from it.
Regards,
Ben
What features does the service use - what binding, etc.
If you are using the wsHttpBinding then that uses features that the standard SOAP proxy (SoapHttpClientProtocol) doesn;t support - you will need to install WCF on the client machine - then you can use Add Service Reference rather than Add Web Reference.
Also, is the service serving metadata? RC1 of WCF removed the automatic generation of metadata by the service and this has to be enabled via a serviceMetadata behavior
Regards
Richard Blewett
Simple scenario: I want non-WCF clients (wsdl.exe-generated clients) to be able to call my WCF service, using username tokens. I've got my basicHttpBinding set up as follows:
<basicHttpBinding>
<binding name="basicHttpBindingConfiguration">
<security mode="TransportWithMessageCredential">
<transport />
<message clientCredentialType="UserName"/>
</security>
</binding>
The WCF client works like a champ using hte basicHttpBinding. WSDL-based clients blow up with the "An error occurred when verifying security for the message" message. I am handling the ServicePointManager.ServerCertificateValidationCallback to handle my imperfect makecert-made certificate.
Abhishek
Hi Jason,
Do you need TransportWithMessageCredential ? most non WCF clients only support transport (https) as basic http binding is not WS compliant. This is the error you got... the client did not include the information. Pre WS there was no support for any authentication/user identification so i used to just put it in a SOAP header.
What clients are you trying to get up and running ? You mention wsdl is generating the proxy is this .NET1.0 , 2.0 , WSE or WCF . Only WSE and WCF support username authentication for web services.
Regards,
Ben
Hi Abhishek,
I am also trying to use an ASP.Net application to communicate with a WCF service. I am able to reference the web service in my client. But when I invoke the WCF service, it just times out.
Do you have the solution for this problem?
Thanks & Regards
Shweta
1. Use svcutil.exe on the command line to create the web proxy file and the app.config file.
2. Rename the app.config file to web.config file.
3. Copy the web.config file into the Visual studio application.
4. Copy the web proxy file into the webreference folder in your application.
Let me know if that works.
Abhishek