My WCF project is OK, no errors, I try browse SVC file, it works well.
But when I add this WCF references, it throw errors :
There was an error downloading 'http://MyIPAddress/BKKService/BService.svc/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://MyIPAddress/BKKService/BService.svc'.
There was no endpoint listening at http://MyIPAddress/BKKService/BService.svc that could accept the message.
Please help me to solve this issue.
This is my web.config file
<services>
<service name="BKKService.BService">
<endpoint address="BKKService" binding="basicHttpBinding"
bindingConfiguration="basicHttp" contract="BKKService.IBService"/>
<host>
<baseAddresses>
<add baseAddress="http://MyIPAddress/BKKService/BService.svc"/>
</baseAddresses>
</host>
</service>
</services>
You can specify an absolute address for each endpoint associated with the service or you can provide a base address for the ServiceHost of a service and then specify an address for each endpoint associated with this service that is defined relative to this base address.
When hosting with IIS, you do not manage the ServiceHost instance yourself. The base address is always the address specified in the .svc file for the service when hosting in IIS. So you must use relative endpoint addresses for IIS-hosted service endpoints.
So "http://MyIPAddress/BKKService/BService.svc" would not work, you need to use the .svc file address. If you use IIS express, the address for adding service reference should be the url when you browse the svc file. If you use IIS, it is the address specified for .svc file in IIS.
Related
When I Self hosting the WCF service using console application, It will successfully hosted. But i am trying to use in windows forms client application the below exception should be thrown.
System.ServiceModel.Security.SecurityNegotiationException: 'A call to SSPI failed, see inner exception.'
Win32Exception: The system cannot contact a domain controller to service the authentication request. Please try again later.
WCF service:
<services>
<service behaviorConfiguration="MessageBehavior" name="WcfService.MessageService">
<endpoint address="MessageService" binding="netTcpBinding" contract="WcfService.IMessageService" />
<host>
<baseAddresses>
<add baseAddress="localhost:80" />
<add baseAddress="net.tcp://localhost:8090" />
</baseAddresses>
</host>
</service>
</services>
My Base endpoint is : http://localhost:8080
Any help in this ?
Nettcpbinding secures the communication with message security mode by default, and authenticates the client with window authentication.
NetTcpBinding binding = new NetTcpBinding();
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
Therefore, we need to provide windows credentials to call the service.
ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
//the windows credentials are the window accounts on the server-side which hosts the service.
client.ClientCredentials.Windows.ClientCredential.UserName = "administrator";
client.ClientCredentials.Windows.ClientCredential.Password = "123456";
var result = client.Add(34, 56);
Console.WriteLine(result);
Feel free to let me know if the problem still exists.
I am creating an API with URI template patient/{name} and production URL to http://localhost:8888/patient/{uri.var.name} in WSO2 APIM. Also adding this sequence
<sequence xmlns="http://ws.apache.org/ns/synapse" name="TestSequence">
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>
</sequence>
The target URL is not being invoked with this. Can you please let me know what is the issue?
This error can occur due to Invalid URI provided by you, make sure you are using valid endpoint url for the Production Endpoint.
I have a web service which works fine. I'm trying to build a client to consume this service.
One constraint that I have is that my call has to go via a proxy server for logging (third party hosting provider). My problem is that I can specify the proxy as the WSDL location and that works fine. The resulting WSDL that is returned specifies the original service address:
I have configures my WSDL location at the proxy:
http://[proxy ip address]/csp/sql/ws.Booking.BookingService2.cls?wsdl=1
The WSDL shows:
<service name="Booking">
<port name="BookingSoap" binding="s0:BookingSoap">
<soap:address location="https://alpha2.premier.com:443/
csp/sql/ws.Booking.BookingService2.cls"/>
</port>
</service>
I want to call this service using the proxy address (192.168.98.45).
Does anyone have an idea how to call a custom service location? In the generated CXF code I can specify a WSDL location and a service name but not service location.
Thanks in advance.
Al
I have managed to find a/the solution for this.
I changed the ENDPOINT_ADDRESS_PROPERTY on the binding provider or the port. Here is my code to instantiate the web service that was generated by CXF:
com.micro.bartws.booking.Booking ss = new com.micro.bartws.booking.Booking(wsdl);
BookingSoap port = ss.getBookingSoap();
/* Set NEW Endpoint Location */
String endpointURL = hubProperties.getProperty("intouchservicelocation");
BindingProvider bp = (BindingProvider)port;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
So the WSDL is imported and afgter we change the End point. IT works a treat.
Thanks
I am a very beginner in ESB. So, kindly excuse me for this basic question.
Currently we have web services created with Apache CXF and Spring running. Now, we need to create proxy services for these in WSo2 ESB. Can someone please let us know how can we do this?
I created Pass Through proxy and use wsdl definition as from URL, but when i use try it option i get he endpoint reference (EPR) for the Operation not found is /services/ and the WSA Action = null.
If this EPR was previously reachable,please contact the server administrator.
Since ESB 4.6, pass-through transport is enabled by default : The message body is not build so, SOAP Body based dispatching is not supported => in this case, the error you're speaking about is thrown
One solution could be to add this parameter in your proxy conf : <parameter name="disableOperationValidation" locked="false">true</parameter>
Have a look there for other options : Using WSO2 ESB PassThrough Proxy on WebLogic (Spring) Web Service
How did you create the proxy service? If you have the wsdl of the Backend service you can use it to create the proxy service like follows.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="testProxy2" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<wsdl service="SimpleStockQuoteService"
port="SimpleStockQuoteServiceHttpSoap11Endpoint"
uri="http://localhost:9000/services/SimpleStockQuoteService?wsdl"/>
</endpoint>
</target>
<description/>
</proxy>
The ESB gets the endpoint url from the Service name and Port defined in the WSDL. For SOAP 1.1 the WSA action will be the SOAPAction header and for SOAP 1.2 the WSA action goes with the action element of Content-Type header. For example,
Content-Type: application/soap+xml;charset=UTF-8;action="TheSoapAction"
Try to use a SOAP client like SOAPUI to test your proxy service.
My silverlight application is currently hosted in IIS and is set up to only use HTTPS.
the silverlight web project is the root of the IIS website and the webservices project is a seperate web application mapped to /Services.
I can navigate to my site by using "" and ""
but if I use the second option the site loads fine but I get an error when attempting to access any of my services.
An error occurred while trying to make
a request to URI
'https://localhost/Services/Services/Authentication.svc'.
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
I have Crossdomain.xml and clientaccesspolicy.xml files in the root of my Web Services application and also within the root of the Silverlight Web project.
Crossdomain.xml
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain- policy.dtd">
<cross-domain-policy>
<allow-access-from domain="https://*" secure="true" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
clientaccesspolicy.xml
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from>
<domain uri="https://*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
I'm not really sure what the problem is.
Thanks
Edit
The following is the what fiddler shows after calling the service. .
With fiddler set up to decode https IE didn't show any extra entries, but with chrome I get the following output
As the error message says, "This could be due to attempting to access a service in a cross-domain way..." Try using some tool such as Fiddler in the client to see what is the actual response from the server. That will give you more information about the issue.
As shown by fiddler your reference file for the service are having pointers to localhost:444 this usually happens when you have both projects in same solution and add the service reference.
I resolved this by right clicking on the frontEnd.Web part of my solution, going to properties and then the Web tab, instead of using an auto assign port option, I changed it to use local IIS server. This got rid of the error.