I want BizTalk to send signed soap messages using WS-Security without encryption.
My orchestration is using a dynamic send port. I have tried both, trying to configure a WCF-WSHttp Send Port like this: (temporarily altered my orchestration to use this port rather than a dynamic port) as well as doing it within my orchestration.
However I only manage to get my message send out encrypted, or in plain text without being signed or encrypted.
Configuring a Send Port.
Result: Message gets encrypted:
Doing it within my Message Assignment Shape:
Result: Message gets encrypted:
myMessage_Request(WCF.TransportProtectionLevel)="Sign";
myMessage_Request(WCF.MessageClientCredentialType)="Certificate";
myMessage_Request(WCF.TransportClientCredentialType)="Certificate";
myMessage_Request(WCF.OpenTimeout)= "00:10:00";
myMessage_Request(WCF.CloseTimeout)= "00:10:00";
myMessage_Request(WCF.SendTimeout)= "00:10:00";
myMessage_Request(WCF.MaxReceivedMessageSize)= 2147483647;
myMessage_Request(WCF.SecurityMode)="Message";
myMessage_Request(WCF.BindingType)="customBinding";
myMessage_Request(WCF.Action)="http://MySoapAction";
myMessage_Request(BTS.Operation)=”MySoapOperation”;
myMessage_Request(WCF.ClientCertificate)="xxxxxxxx";
myPort(Microsoft.XLANGs.BaseTypes.Address) = http(s)://targeURI
myPort(Microsoft.XLANGs.BaseTypes.TransportType) = "WCF-WSHttp";
If I change the above property WCF.TransportProtectionLevel from “Sign” to “None” the message doesn't get encrypted and also not signed.
Related
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.
Scenario:
- An application want to send a push to a list of device.
- so she sends information to my mule application which must be listening to the arrived information.
- My application will send this information via web service to the application which will send the push and then my application will wait for a response which is a json file with content: success: 0/1 failed: 0/1,
- according to this answer my mule application will send email which i take from the database, if the device concerned didn't receive the push.
I have done the last part of this scenario. from the receipt of the answer of the push. Now I have some questions about the first part:
I guess that the application sends a json file that contains a list of information of each device.
How processed the list of information devices. I must loop on the contents of the json file. any example of this?
How to put my application in listening for the arrivals request for sending push?
is the http connector sufficient? if so how to configure the path variable.
I'm using mule 3.5.0 CE, Thank you in advance.
Lets break this down, to the various components:
Sender Application - this is the service that needs to communicate with the devices.
Device Controller - this is the application that talks to the hardware devices.
Proxy - this is what you are developing on the Mule ESB. It will connect to both the Sender Application, and the Device Controller and transfer the request from Sender to Controller; and then send the results from the Controller back to the Sender.
The flow would look something like this:
Sender Application needs to communicate with devices.
Sender Application transmits information using JSON.
Proxy receives this JSON request.
The Proxy then contacts the Device Controller over HTTP.
The Device Controller only talks to the Proxy, and returns a result of 0 or 1 depending on the result from the physical device.
The Proxy then needs to communicate this result to the Sender Application.
At first, you might think to develop your Proxy over HTTP (using the HTTP Connector). This connector creates a web service endpoint (a website, basically) that can listen and respond to requests.
The Sender Application connect to this endpoint over HTTP and submits the JSON document containing the commands to be executed.
Your proxy then immediately contact the Device Controller (again, over HTTP using the same connector).
The device controller talks to the devices, and then returns the response to your Proxy (over HTTP).
You take this response and then send it back as the response to the original HTTP request (from the Sender Application).
The problem here is if there is any delay between your connection and the Device Controller (or the Device Controller and the physical devices), the connection will remain blocked on both sides (since you need to send a response).
If there is a large delay the HTTP connection between your Proxy and Sender Application may terminate.
This is the same when some site is overloaded and doesn't respond - eventually the browser will timeout.
To avoid this scenario, split your integration into three separate flows.
The first flow will create a normal HTTP connection to which the Sender Application will upload the JSON document. It will take the JSON document and convert each entry into a message using the batch module (note: this is only available in the Enterprise edition - for the CE version you'll have to code this logic yourself). Next, take this message and put them in a separate queue. Return the unique ID of this message as a JSON response back to the Sender Application.
Your second flow is listening on this queue and whenever a message arrives, it connects to the Device Controller and gets the response. The response is then written to another queue.
Your third and final flow listens on this results queue, takes each message on this queue and converts it to JSON/XML. It then has a HTTP connector where it can be queried for results for each command.
In the above setup, your Sender Application can drop a large JSON file of commands to be executed; for each command, a unique ID will be returned to the Sender Application.
It will then query the result endpoint (what your last flow exposes) and send it the message ID. The result endpoint will then check the status of this request and respond with the appropriate code.
Here is an example of how this would work (from the point of view of the Sender Application):
I is the input to your flow, O is the result sent.
Step 1 - send a request for commands to be executed:
I: Sender Application > http://localhost:8080/input-commands?device=1&command=Y
O: <command><req-status>OK</req-status><id>1234-123</id></command>
Step 2 - Query results:
I: Sender Application > http://localhost:8080/result?id=1234-123
O: <command><id>1234-123</id><result>0</result></command>
I have hit upon a weird problem when trying to use content based routing in BizTalk 2013.
If I have a WCF-BasicHTTP static one-way send port that is subscribing to a message returned from a WCF-BasicHTTP static solicit/response send port, it works fine - my web service is executed as expected.
However, if I have a WCF-BasicHTTP static solicit/response send port that is subscribing to a message returned from a WCF-BasicHTTP solicit/response send port, the webservice executes as expected, but the returning message does not appear. There is no corresponding tracked message event for the expected receive. I have debugged the destination webservice and can confirm that it executes and returns the xml document as expected.
In both instances, I am using the XMLTransmit and XMLReceive pipelines.
Furthermore, I have noticed that any send port that subscribes to a message returned from another send port does not have it's adapter details displayed within it's corresponding transmission tracked message event, the adapter value is blank. I am not sure if this is a clue, but it doesn't seem right.
Can content based routing be used in this way?
Thanks in advance
If you have a solicit/response port subscribing to the request of another solicit/response port, then the response of the subscribing solicit/response port should automatically be routed back to the original port. You should not need to subscribe to the response of the second solicit/response port.
I am using Spring Integration in my project.
Endpoints used in application are in-bound gateway, header based router, transformer, spliter, service activator.
In case of success flow(not any exception), in-bound gateway reply-channel getting desired response and client gets that response which is fine but in case of any exception, I want to send customized error response which is not working as per my requirement.
I am using error-channel to accomplish above requirement but not succeeding in that.
Please find my configuration of in-bound gateway, error channel etc.
I have not use any chain in configuration.
<int-http:inbound-gateway id="inboundGateway"
supported-methods="GET, POST" request-channel="requestChannel"
path="/services/tylv/{requestParam}" reply-channel="responseChannel"
error-channel="errorChannel">
</int-http:inbound-gateway>
<int:transformer ref="errorHandler"
input-channel="errorChannel" method="generateErrorResponse"
output-channel="responseChannel" />
<bean id="errorHandler"
class="com.csam.wsc.enabling.integration.transformer.ErrorHandler" />
In case of exception , com.csam.wsc.enabling.integration.transformer.ErrorHandler.generateErrorResponse(ErrorMessage) successfully called.This API handle exceptions, generate Error Response Packet but it is not being sent to client, just only HTTP Status Code 200 sent.
Ideally it should be sent because transformer's output-channel is reply-channel of inbound-gateway which is already sending response packet along with status code 200 in case of success (no any exception).
I think in case of error-channel , in-bound gateway reply-channel is not working, but I am not sure.
Please help me in configuring error-channel.
You should store the message's headers before the error reaches the error channel and then you should create a new message with the stored headers and route that new message to response channel.
MessageBuilder.fromMessage(errorResponseMessage).copyHeadersIfAbsent(storedHeaders).build();
I am currently limited to the usage of Tomcat with Axis2 and its EmailWS-1.6 webservice to send an email. This has to be an HTML mail.
This is the configuration of EmailWS.properties
Email Service Configuration
(This configuration requires EmailWS-1.6 or later)
contentType=text/html;charset=utf-8
returnAddress=
mail.transport.protocol=smtp
mail.host=
mail.smtp.port=465
mail.smtp.auth=true
mail.smtp.socketFactory.port=465
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback=false
mail.smtp.starttls.enable=true
mail.smtp.quitwait=false
authUsername=
authPassword=
I can succesfully send an email, but it seems to arrive as plain text. The email client does not translate it to HTML. What is the proper configuration of Tomcat/Axis2 to do this?
Tomcat Axis2 Email webservices also contains an operation which enables you to send an xml-based email message. By using this operation, I was able to send the HTML email. It was also received as HTML.