B2B handling SOAP Message but there is no response - ibm-datapower

Dears,
I developed my first datapower b2b solution, it must handle soap messages, the sender is sending soap message and the b2b service must retrieve soap also.
and I did the following :
I created an external Profile ExternalParter_hub and internal Partner IntrenalPartner_hub.
I set the destination for IntrenalPartner_hub to soap web service as a back-end.
IntrenalPartner_hub I made the response type SOAP.
I created B2BGW service and i added the Profiles above and i created HTTP Front Side handler for it.
In the B2BGW service that i created , i used the Document Routing Preprocessor in Advanced tab and I set the xsl document to assign sender and reciever data.
I created MPGW service and routes to the B2BGW service.
I tested the service using soapui by calling MPGW url as endpoint,
the soapui response panel is empty and the header section tells me that everything is ok. When Opening debug probe it tells that the soap service returns success soap message...
but MPGW service doesn't recieves any response from B2BGW service!!
and B2B Transaction Viewer show that message result is success ??
what is the missing part !!!!

The B2BGW in DataPower can't return any Response data other than its own "signals", eg. AS2 MDN or ebMS receipts.
You have to either create/fetch your Response data in the MPGW "proxy" and attach that as the Result to the HTTP 200 Response from the B2BGW or use a url-open() (XSLT or GWS) in the Response (server-to-client) rule of the internal B2B partner.
So, there is no missing part, only a limitation in DataPower B2BGW...

Related

XI52 IBM Websphere DataPower

I have a service like this
MPGW <===> WSP <===> Backend
On the response, I have an attachment which I was expecting the type to be 'XOP' but instead I'm getting 'MIME' . Is there any way I can over ride to XOP?
FYI...when I hit the service directly the back-end (by passing datapower), I'm getting XOP attachment type.
Processing MTOM with SOAP 1.1 is not supported in DataPower so make sure you are using SOAP 1.2.
You need to check if it is the WSP (likely) or the MPGW that is changing the response. This you can do using the Probe.
You can handle the attachments in a MTOM Policy for the service. Also use pass-through if possible for the MPGW to make sure it is not changing the payload.

Mediation sequence for DELETE method in wso2 not working

I have a SOAP web service for delete action, with endpoint URL
http://some-ip-address:my-port/bank/websrv/delcus
And can be invoked only by POST method.
I have published this API and added DELETE resource for invoking this service.
So the URL becomes
https://my-apim-endpoint/public/customer/{customer-id}
And I added mediation sequence for DELETE action. So whenever this API is invoked, it will go through the mediation sequence and send POST request to the endpoint
http://some-ip-address:my-port/bank/websrv/delcus
But when I invoke the API, the endpoint URL is getting replaced with the following URL.
Here is how the send mediator looks like,
<send>
<endpoint>
<http method="post" uri-template="http://some-ip-address:my-port/bank/websrv/delcus"/>
</endpoint>
</send>
http://some-ip-address:my-port/bank/websrv/100000023
Instead of
http://some-ip-address:my-port/bank/websrv/delcus
And giving me error response. Please anyone can help?
When you use http type endpoint, the resource path get appended to the endpoint url. for example say you have an endpoint http://test.com/path and if you have defined a /resource/{id} resource, then the request will be sent to http://test.com/path/resource/{id} kind of a url. That is the default behavior.
To call a SOAP service instead of using http type endpoint, you can use use address endpoint type. when you create endpoint with address type, you can define whether it is a soap11 or soap12. (format option in advanced options section in the implement tab). this will send a soap payload to http://test.com/path. (you do not have to build soap headers etc. only message body) .

In BizTalk 2013 R2, how to create response schema of web api as I need this response in BizTalk orchestration to update some tables in database

In BizTalk 2013 R2, I want to POST JSON request/string to web API. I used WCF-Web Http adapter and JSON decoder/encoder pipeline to create a JSON request. But I am unable to find how to create response schema as I need this response in BizTalk orchestration to update some tables in database. Have anyone worked on it?
As stated in the comments.
Capture the JSON response by having your inbound pipeline initially set the PassThru
Have a Send Port subscribing to the response on the send port and write it to a file
Use the JSON wizard to create a schema from the response file.
Deploy the response schema to BizTalk
Change the inbound pipeline to a custom pipeline with the JSON Decoder.
To Capture the HTTP Status from the REST Service see this article BizTalk Server: REST Services Error Handling. Which involves having the create a custom service behavior to capture the HTTP Status and inject it into the message context property.

Can't get authentication token from web api 2

I am new to Web Api 2. I am trying to build a project to explore token authorization. I created a new project in VS 2013 and selected the WebApi2 template and used Fiddler to emulate http requests. I didn't change anything in the template, just ran it as it was and tried to play with it with Fiddler. I successfully created a user by issuing request to /api/account/register but I can't login by issuing a POST request to the /Token endpoint. The request is:
http://localhost:YYYY/token?grant_type=password&password=admin123456&username=admin
(i also tried to pass the parameters as a json object in the request body).
I get back this:
{"error":"unsupported_grant_type"}
From other posts such as ASP.NET WEB API 2 OWIN Authentication unsuported grant_Type I learned that I needed to enable CORS for web api and at the token endpoint, but that hasn't worked for me.
Are you sure that you are sending POST request message and not GET?
If you simply go to the URL with query string (or open connection to this URL from your code) you are sending GET message by default. It's not what WebAPI with "/token" path is listening for.
If you are calling web service from same place, CORS is not needed. The error "unsupported_grant_type" could be in the format of the data you are passing server in post action.
Try sending with Content-Type application/x-www-form-urlencoded

BizTalk sending custom WCF headers with message level security

I'm attempting to have BizTalk broker the communication to a WCF service that maps some of its data within the response message's header and not the body portion. After researching, the solution was to write the header data to the OutboundCustomHeaders message context property and then the BizTalk WCF adapter will inject it into the outgoing message. This worked perfectly until I enabled message level security using a certificate. In this case, the header still gets included within the response message but AFTER the message is encrypted. This causes the receiving client to throw a MessageSecurityException with the message 'required message part was not encrypted."
Is there a way to configure BizTalk to write the OutboundCustomHeaders before encryption occurs or another way to inject my header in the response?
I'm not sure how much it helps or complicates the answer, but the receive location in BizTalk is using the ws2007HttpRelayBinding to create an Azure endpoint for the client connections.
The solution for this problem was found by creating a custom behavior that adds the required header to the channel protection requirements and attaching it to the ws2007HttpRelayBinding.
I used the following link as a reference to my solution: WCF custom messages security

Resources