I have a WCF web service created, the service uses wshttbinding and is working fine when i try invoking by adding service reference (with certificates supplied).When i try invoking it from soapUI i am getting an error. I tried disabling the security mode but found out that the following line of code is causing the issue.
string certInfo = OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name;
I am getting the above value as null. Is there any way i can pass this context from within soapUI
In soapUI, you need to specify the Outgoing WSS, which specifies which project-level outgoing WS-Security configuration to apply to outgoing requests.
The following links should provide sufficient background information:
http://www.soapui.org/SOAP-and-WSDL/applying-ws-security.html
http://www.soapui.org/SOAP-and-WSDL/authenticating-soap-requests.html
Related
We have an existing wcf service, and I created a new project. I want to use it. I hit add service reference, pop in the URL, press OK, and it adds it as a service reference but there is no config generated.
I also tried svcutil.exe /language:cs /out:GeneratedProxy.cs /config:app.config [url] but no config is generated, only the proxy cs.
I'm using VS 2013 / .NET 4.0
My question is, is this a sign that the SVC itself has some missing data that is required to build the contracts, or is the problem with adding the service reference?
For the record I have tried unchecking the reuse types option which some questions on here have reported as fixing the problem.
Bonus question, do you think if I can't get this working that manually adding some generic default bindings and endpoint code to the web config will work?
First, the reason that why the Adding service reference generates nothing is that the WCF service is rest style service. By default, the proxy-based invocation of rest style WCF services is complex.
https://en.wikipedia.org/wiki/Representational_state_transfer
https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/wcf-web-http-programming-model
Calling the WCF rest style service with the client proxy is uncommon. Generally, we construct an Http request by using an HTTP client library to call the service, such as HttpClient, WebClient.
How to fix "ERR_ABORTED 400 (Bad Request)" error with Jquery call to C# WCF service?
Besides, calling the WCF rest style service with the client proxy is feasible. Please refer to my previous link.
WCF: There was no endpoint listening at, that could accept the message
Feel free to let me know if there is anything I can help with.
Am trying to invoke a CMIS repository webservice URL from a WCF service. I need to ensure that I have WCF binding (basicHttp) on invoking that webservice (to mutually exchange certificates between client and Data power). Hence i used the below code:
DotCMIS - Code Snippet:
Parameters[SessionParametet.WebServicesWCFBinding] = "myWCFServiceBindingName";
Note: "myWCFServiceBindingName" is the name of basicHttpBinding defined in the web.config related to the WCF service.
There is no error when the above code is executed but it throws the below error message when instantiating a session to perform operations on the repository.
Error Message:
No elements matching the key 'myWCFServiceBindingName' were found in the configuration element collection.
Could someone share your thoughts on this issue ?
I have a few questions about setting up and running a WCF service after done coding it.
I've created my service. I'm able to right-click it in VS and choose to run it in the browser and it comes up.
Now I want to test tie service by creating a new C# project and adding a service reference to my service (.svc).
When I try to add the service reference it can't find it (e.g. http://localhost:55129/Cars.svc).
So do I need to have my service project running in order to add it?
And would I need to set it up in IIS? Or are people mainly running it from within VS, running the WCF project itself?
Here is the error I get when trying to add that service endpoint:
There was an error downloading http://localhost:55129/Cars.svc/_vti_bin/ListData.svc/$metadata.
The request failed with HTTP status 400: Bad Request.
Metadata contains a reference that cannot be resolved: http://localhost:55129/Cars.svc.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:55129/Events.svc. The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.
If you're using the development web service, it has to be running for you to generate client proxies.
Hosting in IIS is more convenient in this respect as it is always running even if you don't have your solution open.
I have one worflow service named GetDataWorkflowService.xamlx that I want to use in Silverlight.
When I add a service reference to my application, it gives a message 'This Operation is not supported for the relative URI.' It still adds the reference, however.
When I use the referece:
Servicelient proxy=new ServiceClient();
proxy.GetDataCompleted += (o, a) => Debug.WriteLine("Result is " + a.Result);
proxy.GetDataAsync(123);
I get the following error:
An error occurred while trying to make a request to URI 'http://localhost:1234/GetDataWorkflowService.xamlx'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.
I don't understand what's happening.
A few things:
What happens if you use the WCF Test Client to call GetData()? Do you get an error or does that work just fine. If you get an error here concentrate on the server parts.
What happens if you set a service reference from a console application and call your workflow service. Same error or does that work?
Is the workflow service hosted in the same web site as the Silverlight client? If not do you have the cross domain policy files setup correctly.
Assuming the WCF Test Client works. Open up fiddler and compare the request from your Silverlight client with that from the WCF Test Client. What is different?
Enable tracing on the server to see if there are any exceptions or warnings that might provide more insight to what is wrong.
Check your startup project to be sure you are starting a web project and not the Silverlight project. For more details see Troubleshooting Workflow Services / Silverlight on my blog
I created one wcf service lets called as "myService.svc". From my service I am calling client service lets say "clientService.svc". This client service return data to my wcf service.
Today I start getting exception like "There was no endpoint listening at http://clientService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details...."
So where is this problem probably present inside client service or my service as both service are up so I am not able to figure ut out?
Please help me out.
you web.config has the wrong URL for the client service. Change it to "http://localhost/clientservice.svc".
Check your endpoint configuration... http://clientService.svc is an invalid uri.
Did you try accesing the WSDL via browser?
It seems like the url is wrong maybe in the client, i think it should be something like http://nameofthehost/clientService.svc
to access the wsdl you should add ".wsdl" at the end of the url
How are you running those services? If you are using asp.net development server, its possible, that you got your services running at different ports today. Your inner service's proxy is configured at some address which isn't valid any more. Check the setting and try refreshing the service (right clicking at solution explorer) and possibly change the address or generate proxy again.