There is a problem with encoding using WCF detailed described here : blog post
WCF: Text Message Encoding and ISO-8859-1 Encoding
I'm getting similar error in response :
A message sent to adapter "WCF-BasicHttp" on send port "XXXX" with URI "http://XXXXXXXX:8080/index.php" is suspended.
Error details: System.ServiceModel.ProtocolException: The content type text/xml; charset=ISO-8859-1 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.
I'd like to create a simple proxy WS in BizTalk Environment. I created 1 Receive Location using WCF-BasicHttp / WCF-Custom (neither worked) adapter and send port (SOAP WCF-BasicHttp). Send port is subscribing Receive Location as mentioned here:
Best approach to simple proxy on BIZTALK
I created endpoint in the BizTalk process mentioned here: Codit Blog Hosting WCF HTTP receive location inside BizTalk, without using IIS.
I cannot set other textEncoding than UTF-8, while trying to set ISO-8859-1 I get the error:
"The text encoding ISO-8859-1 used in the text message format is not supported. Parameter name: encoding"
Is there any way to run this using some custom encoders in BizTalk environment?
I managed to do it myself.
I deleted textMessageEncoding binding from Receive and Send WCF-Custom adapter
and instead of it I put customMessageEncoder binding with soap11 and proper iso encoding. Note that httpTransport should be last on binding list.
Related
Let me explain my configuration:
ActiveMQ 5.12.0
AnyPoint Studio 5.2.1
Mule 3.6.1
Flow of application:
I am using FunctionalTestCase to post and retrieve a message from queue.
MuleClient client = muleContext.getClient();
String productAsJson = "{\"name\":\"Widget\", \"price\":9.99, \"weight\":1.0, \"sku\":\"abcd-12345\"}";
client.dispatch("http://localhost:8081/products", productAsJson, null);
MuleMessage result = client.request("jms://products", RECEIVE_TIMEOUT);
What is happening is the message is getting posted but when I try to retrieve it, I get the string "{NullPayLoad}".
After stepping back through the flow, I have discovered the message payload, when using the Mule Client, is not making the queue. While looking through the admin console for ActiveMQ, I discovered the message details is "{NullPayload}". When I check using the Advance Risk Client, the JSON message is getting posted correctly.
Any suggestions would be greatly appreciated.
Russ
It's NullPayload when using the MuleClient because by default the http operation will be GET and wont be expecting a body to parse.
The MuleClient is more suited to working with Mule transport infrastructure such as the JMS transport or the old http transport. I don't think it plays nice with the new http listener module.
Normally with the transports you can set the method via a property but that doesnt seem to work with the http:listener:
MuleMessage message = getTestMuleMessage();
message.setPayload(productAsJson);
message.setProperty("http.method", "POST", PropertyScope.INBOUND);
client.send("http://localhost:8089/products", message);
I would suggest using a standard HTTP client such as Apache HTTP client etc. and set the method to POST/PUT or whatever method you need to use that expects a body.
I am attempting to receive JSON messages into BizTalk using the bLogical REST Start Kit for BizTalk (http://biztalkrest.codeplex.com/).
I am able to successfully receive a message, transform it, and return a response from my Orchestration, but when I transform the response back out through the BizTalkRESTResponseHandler, the HTTP Content-Type is being forced back to 'application/xml', even though I'm explicitly setting it to 'application/json'. The Content-Type is confirmed by tracing the Request and Response in Fiddler, as well as SoapUI.
The Accept: value on the Request is 'application/json'
Any ideas how I can trace further into the Wcf-Custom adapter stack to see where the Content-Type is being reset?
You can solve this by adding a HttpResponseMessageProperty before returning the message in the IDispatchMessageInspector. You can either do this directly in the BizTalkRESTResponseHandler IDispatchMessageInspector or in a separate one.
To do it in the BizTalkRESTResponseHandler get the source and add the following 3 lines of code in the BeforeSendReply method just above the "reply = newReply" in the end.
HttpResponseMessageProperty prop = new HttpResponseMessageProperty();
newReply.Properties.Add(HttpResponseMessageProperty.Name, prop);
prop.Headers.Add("Content-Type", "application/json;charset=utf-8");
Now instead of getting:
You will get this:
I've got a WCF Service, which calls a webservice, running on my development IIS server (IIS 7). I've added it as a service reference to a C# Website Project and it adds fine.
However, when I try to call any of the service contracts, I get the following error:
The content type text/html
of the response message does not match
the content type of the binding
(text/xml; charset=utf-8). If using a
custom encoder, be sure that the
IsContentTypeSupported method is
implemented properly. The first 1024
bytes of the response were:
'Blocked Web
Page
thanks in advance
BB
The error message says it clearly: you're getting back an HTML page instead of your service response. Looking at the fragment of that page listed in the error message, you're probably not authroized to use that service.
Try to connect to the service URL in a browser - you should probably see a page explaining that you're not allowed to access the page. Most likely, this is a permissions issue.
You need to configure WCF Tracing and find out what's happening on the server side.
I am trying to consume WCF based Sharepoint 2010 claim-based. I am getting the following error message: Thank you for any advice.
System.ServiceModel.CommunicationException
"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). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 b..."
Whenever you get HTML from a web service, it means you're getting an error message. Look at the network traffic using Fiddler or something to see what the service is trying to tell you.
https://tbe.taleo.net/MANAGER/dispatcher/servlet/rpcrouter
the above is from Taleo's API guide.
I'm trying to create a WCF Client
(e.g.: " Creating Your First WCF Client"
http://channel9.msdn.com/shows/Endpoint/Endpoint-Screencasts-Creating-Your-First-WCF-Client/ )
The tbe.taleo... link is from Taleo's API documentation.
Likely my understanding is flawed. My assumption is that when the
link from Taleo is entered into the vs2010 "Add Service Reference"
dialog and GO is clicked, then vs2010 should retrieve
a proper WSDL/SOAP envelope back from the Taleo link.
That does not happen; instead an error occurs.
Fiddler2 (http://fiddler2.com) displays the status code 500
"HTTP/1.1 500 Internal Server Error". [FULL DETAILS BELOW]
"WcfTestClient.exe" gives a similar error: [WcfTestClient DETAILS BELOW]
QUESTION: is it me, or is the Taleo link flawed?
Thank you,
Gerry
[FULL DETAILS "Add Service Reference"]
The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'https://tbe.taleo.net/MANAGER/dispatcher/servlet/rpcrouter'.
The content type text/xml;charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 544 bytes of the response were: '
SOAP-ENV:Protocol
Unsupported content type "application/soap+xml; charset=utf-8", must be: "text/xml".
/MANAGER/dispatcher/servlet/rpcrouter
'.
The remote server returned an error: (500) Internal Server Error.
If the service is defined in the current solution, try building the solution and adding the service reference again.
[WcfTestClient DETAILS]
Error: Cannot obtain Metadata from https://tbe.taleo.net/MANAGER/dispatcher/servlet/rpcrouter If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: https://tbe.taleo.net/MANAGER/dispatcher/servlet/rpcrouter Metadata contains a reference that cannot be resolved: 'https://tbe.taleo.net/MANAGER/dispatcher/servlet/rpcrouter'. The content type text/xml;charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 544 bytes of the response were: 'SOAP-ENV:ProtocolUnsupported content type "application/soap+xml; charset=utf-8", must be: "text/xml"./MANAGER/dispatcher/servlet/rpcrouter'. The remote server returned an error: (500) Internal Server Error.HTTP GET Error URI: https://tbe.taleo.net/MANAGER/dispatcher/servlet/rpcrouter The HTML document does not contain Web service discovery information.
Browsing to the Taleo link, I get
SOAP RPC Router
Sorry, I don't speak via HTTP GET- you
have to use HTTP POST to talk to me.
My suspicion is that both Visual Studio and Fiddler do an HTTP GET to retrieve the WSDL (a description of the Web Service). Instead, they're getting an HTML error message.
Adding "?WSDL" to the URL didn't help. So I'd say the Taleo link is not intended to be used in this manner, but instead is designed for SOAP RPC.
Sadly, I can only blame myself. I watched the excellent free Pluralsight videos.
I tried to sort it out from Taleo's documentation, Google, msdn, et cetera.
I should have used this:
http://tbe.taleo.net/wsdl/DispatcherAPI.wsdl
from here:
http://tbe.taleo.net/products/TBE_API_Guide.pdf from
http://www.taleo.com/solutions/taleo-business-edition-web-integration-api
Thanks to all who gave some thought to this issue.
g.
You are not to be blamed. The Taleo documentation is a bit confusing. Especially with respect to the URL to be used.
For a detailed description check out Taleo Integration in Drupal