How to pass request parameters to Jitterbit Web Service Method? - jitterbit

I am new to Jitterbit.
Can any one tell me how to pass request parameters to Web Service ?
I have a function called
updateCandidate($string, $string, $mulitDarray, $array) {
..
}
I have set up this in WSDL and added WSDL in websevice method and selected this function as Operation.
What is next ?

Create a new operation of type Web Service Call. Navigation: View > Design > Right click on Operation and Create a new operation
Create a new web service method and upload a new WSDL to the server.
Use the request and response structures of the WSDL and map it to the input variables.
You need to use a script before the transformation to load the variable values and can use those variables in the transformations.

Related

Pass Parameters to a API Controller from Workflow HttpSend Control

I need to make a api call from my workflow(Method type is POST), I am using HttpSend control from Microsoft.Activities to do this. I am able to call my api but not able to send parameters from workflow to api. I tried passing a simple string type parameter through RequestContent in HttpSend but still not able to retrieve its value in my api call.
Screen Shots
Can you provide me a simple example or a link to explain how can i pass parameters from workflow to api for POST
USe the RequestContent parameter of Call HTTP Web Service action for setting payloads to submit to the service.
See this similar example from SHarePoint
https://blog.vgrem.com/2014/05/08/consuming-the-sharepoint-2013-rest-service-from-sharepoint-designer/

WCF and Data Transfer Object

I am stuck on this simple question. In my console application, I want to consume a wcf service. So I add the web reference to the project and call it. That is it.
But why I saw some examples especially using RESTSHARP, they never add web reference. They just use so called "DTO" to return object by the service and consume it.
I hope somebody can clarify the concepts for me. Is DTO used inside WCF?
sample:
private static List<ApplicationDTO> features;
RestClient client = new RestClient("http://" + baseUrl + "/FacilityData.svc");
var request = new RestRequest(Method.GET);
request.Resource = "/GetFeatures";
request.Parameters.Clear();
request.AddParameter("Id", 888);
var response = client.Execute(request);
features = JsonConvert.DeserializeObject<List<ApplicationDTO>>(response.Content);
from this post:
For REST service, it provides a generic way for WCF service consuming
which doesn't rely on the SOAP. That's why we no longer need "Add
ServiceReference..." for consuming it. REST service operations can be
accessed through standard HTTP GET/POST request, so any webrequest
enabled client can consume it. For example, you can use HttpWebRequest
to invoke a REST operation and use LINQ to XML to load and extract
values from the response XML data. It's very flexible.
DTO, usually used for Data Transfer Object - is nothing more then entity you want to pass as parameter / receive as a result.
In your example, ApplicationDTO - is probably some entity to hold Data about Application Feature object (Name, Type, ...)

Proxy generated for WCF creating Message Contracts

I'm consuming a WCF service in my project for which I've added the reference using 'Add Service Reference...'. I expected it to generate a clean proxy with a ServiceClient entity and the Interface. Instead, I see that it has created a MethodNameRequest, MethodNameRequestBody, MethodNameResponse, MethodNameResponseBody entities for each OperationContract method.
So while invoking the service methods, the proxy passes to the service method an instance of MethodNameRequest with the input parameters of the method as the properties of the RequestBody. See below an example of a call to AboutInformationGet() method which doesn't accept any parameters.
public WCFDynamicInvocation.PostingService.AboutModel AboutInformationGet() {
WCFDynamicInvocation.PostingService.AboutInformationGetRequest inValue = new WCFDynamicInvocation.PostingService.AboutInformationGetRequest();
inValue.Body = new WCFDynamicInvocation.PostingService.AboutInformationGetRequestBody();
WCFDynamicInvocation.PostingService.AboutInformationGetResponse retVal = ((WCFDynamicInvocation.PostingService.IMIGQPosting)(this)).AboutInformationGet(inValue);
return retVal.Body.AboutInformationGetResult;
}
I believe this behavior is what one would expect to see in a Webservice Proxy. Hence I suspect that the WCF service is not properly configured.
Did someone here face this issue? What would be the change to be done at the service so that the proxy generated is similar to the WCF service.
Cheers.
There is a similar post here.
Right click your service reference -> Configure service reference... -> Check if "Always generate message contracts" check box is checked. Uncheck it and hit OK to regenerate the proxy to see if you get a normal proxy.
After struggling with this for some time, I've finally found that the cause for the message contracts in the proxy was the service interface had the following attribute:
[XmlSerializerFormat(Use = OperationFormatUse.Literal, Style = OperationFormatStyle.Document)]
As I understand, I could decorate the DataContracts with the following attribute to avoid wrapping
[MessageContract(IsWrapped = false)]
but the response still gets wrapped as the OperationContract hasn't been modified.
As there were no particular need to use XMLSerializer in place of WCF's default DataContractSerializer, we would remove the XmlSeralizerFormat decoration.

WCF: How to find out if service is called?

I have a requirement where I should write WCF service that is called by another external service, which code is not under my control. I only know that my service is called by that external service in this way:
string content = client.getData("http://localhost:1111/Service.svc", param);
My service is located at the address that is actually first parameter in external service method, which means my service was called somewhere inside the body of external service method.
So, my question is - how can I be signaled inside my service that my service was called by that external service?
1) you can create two endpoint for different clients (real client and external servise)
2) you can write specific behavior and realize functionality by additional paramert which will be only into behaviors

Calling WCF Service with no input parameters in BizTalk Orchestration

I am trying to call an IIS hosted WCF web service that simply returns the current date from a BizTalk orchestration. There are no input parameters to this service.
Please ignore the First Receive_1 and the Last Send_1 shapes as I just used them to get started with this orchestration. My Orchestration looks like:
I used the "Add Generated Items..." wizard to add the generated reference to the web service in the Orchestration. My web service definition looks like:
[ServiceContract]
public interface ICalculator
{
[OperationContract]
DateTime GetLastExecutionDate();
}
public class CalculatorService : ICalculator
{
public DateTime GetLastExecutionDate()
{
return DateTime.Now.AddMonths(-6);
}
}
After I added the generated reference to the BizTalk project, the wizard created a set of ports and Multi Part Messages like below:
I have also created local messages to transport data between these calls like below:
Now, I have read everywhere I could that I will need to construct the InputMessage in order to call a web service with no parameters.
Some forums/website say that I need to simply created a blank ConstructMessage shape with the MessageType of dateRequest Message. While doing so the project doesn't compile and I get the following error message:
And the other suggested item is to do a MessageAssignment for a blank Document. So the MessageAssginment shape in my Orchestration has the following:
xDoc = new System.Xml.XmlDocument();
xDoc.LoadXml("<GetLastExecutionDate/>");
dateRequest.parameters = xDoc;
While this compiles and get's deployed, my BizTalk instance get's suspended with the following exception:
There was a failure executing the send pipeline:
"Microsoft.BizTalk.DefaultPipelines.XMLTransmit,
Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" Source: "XML assembler" Send Port:
"REDACTED_1.0.0.0_REDACTED.ExportData_WCFPort_dace989afd9cd9c5"
URI: "http://localhost/COMPANYNAME/WCFService/Service.svc" Reason: This
Assembler cannot retrieve a document specification using this type:
"GetLastExecutionDate".
And the parameter data passed into the service is:
So my question is: How do I call a WCF Service that does not expect any input parameters.
Go to your service request message schema file from within visual studio.
Right click -> Generate Instance.
Grab the XML instance generated and replace all the double quotes with single quotes.
Then paste this into your LoadXml() in your assignment
You probably need an XML namespace in the string used in the message assignment shape. I suggest you validate your XML string against the web service schema to make sure it makes a valid message.
You could also use xsd.exe to create .NET classes from your web service schema.
See http://msdn.microsoft.com/en-us/library/aa547985(BTS.20).aspx for a complete list of ways to contruct a message in an orchestration.
You use the XMLTransmit pipeline and there could be multiple root causes for it throwing error message
"Reason: This Assembler cannot retrieve a document specification using this type: xxx"
The most likely cause is that you do not have a schema deployed matching the message you are transmitting.
But the good news is that there is no need for the XMLTransmit pipeline in this scenario. Just change the send-pipeline to PassThruTransmit and it will most likely solve at least that problem.