content type issue with SOAP::Lite - wcf

When I'm trying connect to server I got below error msg:
Cannot process the message because the
content type 'text/xml' was not the
expected type 'application/soap+xml;
charset=utf-8'
I read it connect to server (implemented in WCF), but can I fix it also with my side (the client) implemented in Perl using the SOAP::Lite module?

The exception means that client expects the response from Webservice using message version Soap 1.1 and thus, expecting content-type of the message to be 'text/xml'. However, it's sending the messages to the service endpoint using Soap 1.2 message version.
If perl/Soap Lite supports Soap 1.2, it can communicate with WCF on this endpoint.
HTH,
Amit

I am still struggling to get my perl application to consume a WCF based web service but I was able to get past the error you are referrign to in your post.
To change the content type use this command.
$SOAP::Constants::DEFAULT_HTTP_CONTENT_TYPE = 'application/soap+xml';

Related

Unable to sucessfuly post from client to WCF WSDL service

I have created a WSDL service with WCF with 3 service contracts-methods, I´m able to test it with soap application and all 3 service methods work as expected.
I´m trying to post data to the Getcallback service contract, from soap application the method works, but while trying to test with postman it did error with HTTP 415
From what I have found on possible causes this can be because the server is not expecting to receive the data, but from all, I have read I feel is correct.
I need to retrieve a string value from the client, this is why I´m using JS to post to the server method expecting a string value.
[Service contracts 1
Sample JS call to soap service
Sample post-call from client to server
I have also tried to make the call with pure js, but the same issue.
I appreciate anyone helps on this matter
Error from client call
Postman error
This was fix by adding SOAPAction and Content-Type to request.

WCF endpoint binding for SOAP 1.1

I am consuming a third party Soap service in a .NET application and I keep getting this error -
The content type text/html; charset=UTF-8 of the response message does
not match the content type of the binding (text/xml; charset=utf-8).
I checked the configuration.svcinfo and the binding seems to be basicHttpBinding. From the soap response it appears to be Soap 1.1. I am able to get this response using a downloaded Soap client but when called from .NET application, I get this error. I have checked many articles and some of them pointed to issues related to Soap 1.2 which I don't think is the case here. The endpoint configuration matches whats in the configuration.svcinfo

WCF: Catching Response that is not SOAP

I am have been setting up a WCF Client to connect to a Service that I do not have control of (I think the service is implemented in Java).
The service requires Certificate security and I got all the certificates setup but I get the following error when I connect to the endpoint
An HTTP Content-Type header is required for SOAP messaging and none was found.
I have setup SchemaValidationMessageInspector (http://msdn.microsoft.com/en-us/library/aa717047.aspx) to catch the Request and Response.
I can see that the Request is caught but not the response.
As I understand it is because the response is not of the SOAP format meaning that the Validation method is not triggered.
I expect that the real error is a 404, 403, 500 or something like that.
I have been using Wireshark to inspect the packets but it's all encrypted since it's too early in the "stack". I need the response right after the https decryption have occurred.
How can I catch the none SOAP responses so I can see the error in a clear format?
Use Fiddler or WCF Trace http://blogs.msdn.com/b/madhuponduru/archive/2006/05/18/601458.aspx to see the raw message. If you want to do this from code use a WCF custom messgae encoder http://msdn.microsoft.com/en-us/library/ms751486.aspx.

Receiving default website when invoking web service

I have created a web service and can invoke the methods using the WCF Test Client when the service is running on my local server (ASP.NET Development Server).
However, when I publish the web service to QA server and invoke one of the methods, again with the Test Client, I get the following error message:
The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8).
Upon inspection of the request using Fiddler I see that what I am getting back is the default page as if I had visited the mywebservice.svc:
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
I do not understand why the default page would be returned instead of invoking the method. Do I need to do anything on the server to allow the method to be invoked? Do I need to set up any MIME types?

The request failed with HTTP status 415

I am getting an exception when I try to call method from WCF...I am consuming WCF in windows application using framework 2.0 and my WCF uses the BasicHttpBinding option...
The request failed with HTTP status
415: Cannot process the message
because the content type 'text/xml;
charset=utf-8' was not the expected
type 'multipart/related;
type="application/xop+xml"'
The client application is failing as it sends data on an Endpoint which is expecting MTOM messages. However, the client application just sends plain Soap messages (Soap1.1). If you can't upgrade your client application to use .Net Framework 3.5, you can use WSE 3.0 which allows to use MTOM with .net framework 2.0.
If you can upgrade application to 3.5, you can use WCF to communicate to service.
Regards,
Amit Bhatia