Hi Vivekananthan,
Did you tried without Quotation mark[1]. it's may be the reason for getting
as string. or write a script to convert[2]
[1] <parameter name="duration" value= {ctx:salesforce.duration} />
[2]
http://stackoverflow.com/questions/19539730/how-to-do-addition-of-two-numbers-in-wso2esb
On Fri, Feb 19, 2016 at 11:50 AM, Vivekananthan Sivanayagam <
[email protected]> wrote:
> Hi Malaka ,
>
> As we discussed in the meeting, I've changed the endpoint name as
> "org.wso2.carbon.connector.salesforce.salesforceEndPoint" and now it finds
> the endpoint template, but the problem is that it shows error like
> "EndpointDefinitionFactory Endpoint timeout duration expected as a number
> but was not a number".
>
> [1] *salesforceEndPoint Template*
>
> <?xml version="1.0" encoding="UTF-8"?>
> <template name="salesforceEndPoint" xmlns="http://ws.apache.org/ns/synapse
> ">
> <parameter name="initialDuration"/>
> <parameter name="progressionFactor"/>
> <parameter name="maximumDuration"/>
> <parameter name="duration"/>
> <parameter name="responseAction"/>
> <endpoint name="SALESFORCE">
> <default format="soap11">
> <suspendOnFailure>
> <initialDuration>$initialDuration</initialDuration>
>
> <progressionFactor>$progressionFactor</progressionFactor>
> <maximumDuration>$maximumDuration</maximumDuration>
> </suspendOnFailure>
> <timeout>
> <duration>$duration</duration>
> <responseAction>$responseAction</responseAction>
> </timeout>
> </default>
> </endpoint>
> </template>
>
> [2]*called within connector*
>
> <call blocking="true">
> <endpoint name="EP" template="
> *org.wso2.carbon.connector.salesforce.salesforceEndPoint*">
> <parameter name="initialDuration"
> value="{ctx:salesforce.initialDuration}" />
> <parameter name="progressionFactor"
> value="{ctx:salesforce.progressionFactor}" />
> <parameter name="maximumDuration"
> value="{ctx:salesforce.maximumDuration}" />
> <parameter name="duration"
> value="{ctx:salesforce.duration}" />
> <parameter name="responseAction"
> value="{ctx:salesforce.responseAction}" />
> </endpoint>
>
> *Error*
>
> ERROR - EndpointDefinitionFactory Endpoint timeout duration expected as a
> number but was not a number
> [2016-02-19 11:46:33,276] INFO - LogMediator To:
> /services/Salesforce_Create, MessageID:
> urn:uuid:eb3880a6-1306-4a28-9906-e1fe43275eaf, Direction: request, MESSAGE
> = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE =
> Endpoint timeout duration expected as a number but was not a number,
> Payload: {
> "username":"[email protected]",
> "password":"XXXXXXWeK49TGh8jNfAzBmww9Se97T",
> "loginUrl":"https://login.salesforce.com/services/Soap/u/27.0",
> "sobject":"Account",
> "initialDuration":20000,
> "progressionFactor":1.0,
> "maximumDuration":3000,
> "responseAction":"fault",
> "duration":600000
> }
>
> On the other hand, I tested with hard coded value in endpoint template[3]
> and called it within connector definition, It is working as we expected.
>
> [3] *salesforceEndPoint Template*
>
> <?xml version="1.0" encoding="UTF-8"?>
> <template name="salesforceEndPoint" xmlns="http://ws.apache.org/ns/synapse
> ">
> <parameter name="initialDuration"/>
> <parameter name="progressionFactor"/>
> <parameter name="maximumDuration"/>
> <parameter name="duration"/>
> <parameter name="responseAction"/>
> <endpoint name="salesforce_endpoint">
> <default format="soap11">
> <suspendOnFailure>
> <initialDuration>2000</initialDuration>
> <progressionFactor>1.0</progressionFactor>
> <maximumDuration>3000</maximumDuration>
> </suspendOnFailure>
> <timeout>
> <duration>60000</duration>
> <responseAction>fault</responseAction>
> </timeout>
> </default>
> </endpoint>
> </template>
>
>
>
>
> *Thank youVivekananthan Sivanayagam*
>
> *Associate Software Engineer | WSO2*
>
> *E:[email protected] <e%[email protected]>*
> *M:+94752786138 <%2B94752786138>*
>
> On Wed, Feb 17, 2016 at 10:07 PM, Vivekananthan Sivanayagam <
> [email protected]> wrote:
>
>> Hi Malaka,
>>
>> I debugged [1] and [2], it got deployed.
>>
>> [1]
>> https://github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/libraries/model/LibraryArtifact.java
>>
>> [2]
>> https://github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/deployers/LibraryArtifactDeployer.java
>>
>> I will debug that you mentioned above and update the status.
>>
>>
>>
>>
>> *Thank youVivekananthan Sivanayagam*
>>
>> *Associate Software Engineer | WSO2*
>>
>> *E:[email protected] <e%[email protected]>*
>> *M:+94752786138 <%2B94752786138>*
>>
>> On Wed, Feb 17, 2016 at 9:35 PM, Malaka Silva <[email protected]> wrote:
>>
>>> Vivekananthan try debugging [2] when you enable the connector. May be we
>>> need to patch esb for this.
>>>
>>> Check updateStatus method.
>>>
>>> [1]
>>> https://github.com/wso2/carbon-mediation/blob/master/components/mediation-admin/org.wso2.carbon.mediation.library/src/main/java/org/wso2/carbon/mediation/library/service/MediationLibraryAdminService.java
>>>
>>> On Wed, Feb 17, 2016 at 6:15 PM, Vivekananthan Sivanayagam <
>>> [email protected]> wrote:
>>>
>>>> (-) support-dev
>>>> (+) dev
>>>>
>>>>
>>>>
>>>>
>>>> *Thank youVivekananthan Sivanayagam*
>>>>
>>>> *Associate Software Engineer | WSO2*
>>>>
>>>> *E:[email protected] <e%[email protected]>*
>>>> *M:+94752786138 <%2B94752786138>*
>>>>
>>>> On Wed, Feb 17, 2016 at 6:12 PM, Vivekananthan Sivanayagam <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi ,
>>>>>
>>>>> I am working on endpoint templates within the connector definition and
>>>>> pass the parameters when calling connector operations.
>>>>>
>>>>> For that I created endpoint template[1] within connector and called it
>>>>> within connector method[2]. When I called, I got these error[3].
>>>>> I followed this doc[4]. Any suggestions?
>>>>>
>>>>> [1] salesforceEndPoint Template
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <template name="salesforceEndPoint"
>>>>> xmlns="http://ws.apache.org/ns/synapse">
>>>>> <parameter name="initialDuration"/>
>>>>> <parameter name="progressionFactor"/>
>>>>> <parameter name="maximumDuration"/>
>>>>> <parameter name="duration"/>
>>>>> <parameter name="responseAction"/>
>>>>> <endpoint name="SALESFORCE">
>>>>> <default format="soap11">
>>>>> <suspendOnFailure>
>>>>> <initialDuration>$initialDuration</initialDuration>
>>>>>
>>>>> <progressionFactor>$progressionFactor</progressionFactor>
>>>>> <maximumDuration>$maximumDuration</maximumDuration>
>>>>> </suspendOnFailure>
>>>>> <timeout>
>>>>> <duration>$duration</duration>
>>>>> <responseAction>$responseAction</responseAction>
>>>>> </timeout>
>>>>> </default>
>>>>> </endpoint>
>>>>> </template>
>>>>>
>>>>>
>>>>> [2]*INIT method*
>>>>>
>>>>> <template name="init" onError="fault"
>>>>> xmlns="http://ws.apache.org/ns/synapse">
>>>>> <parameter name="username"/>
>>>>> <parameter name="password"/>
>>>>> <parameter name="loginUrl"/>
>>>>> <parameter name="forceLogin"/>
>>>>> <parameter name="blocking"/>
>>>>> <parameter name="initialDuration"/>
>>>>> <parameter name="progressionFactor"/>
>>>>> <parameter name="maximumDuration"/>
>>>>> <parameter name="duration"/>
>>>>> <parameter name="responseAction"/>
>>>>>
>>>>> <sequence>
>>>>> <class
>>>>> name="org.wso2.carbon.connector.salesforce.SetupLoginParams"/>
>>>>> <filter xpath="get-property('operation','salesforce.login.done')
>>>>> = 'true'">
>>>>> <then>
>>>>> <property name="Connection" value="Already login to
>>>>> Salesforce ....."/>
>>>>> </then>
>>>>> <else>
>>>>> <enrich>
>>>>> <source clone="true" type="body"/>
>>>>> <target property="ORIGINAL_MSG_PAYLOAD"
>>>>> type="property"/>
>>>>> </enrich>
>>>>> <property expression="$func:loginUrl"
>>>>> name="uri.var.salesforce.url"/>
>>>>> <header name="Action"
>>>>> value="urn:partner.soap.sforce.com/Soap/loginRequest"/>
>>>>> <payloadFactory>
>>>>> <format>
>>>>> <soapenv:Envelope
>>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>>>>
>>>>> xmlns:urn="urn:partner.soap.sforce.com">
>>>>> <soapenv:Body>
>>>>> <urn:login>
>>>>> <urn:username>$1</urn:username>
>>>>> <urn:password>$2</urn:password>
>>>>> </urn:login>
>>>>> </soapenv:Body>
>>>>> </soapenv:Envelope>
>>>>> </format>
>>>>> <args>
>>>>> <arg expression="$func:username"/>
>>>>> <arg expression="$func:password"/>
>>>>> </args>
>>>>> </payloadFactory>
>>>>> <log level="custom">
>>>>> <property name="Connection" value="Login to
>>>>> Salesforce ....."/>
>>>>> </log>
>>>>> <property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
>>>>> <property name="messageType" scope="axis2"
>>>>> value="text/xml"/>
>>>>> <property value="true" name="FORCE_ERROR_ON_SOAP_FAULT"/>
>>>>> <property name="HTTP_METHOD" scope="axis2" value="POST"/>
>>>>> <property name="Accept-Encoding" scope="transport"
>>>>> action="remove"/>
>>>>> <header name="To"
>>>>> expression="$ctx:uri.var.salesforce.url"/>
>>>>>
>>>>> <call>
>>>>> <endpoint name="EP" template="salesforceEndPoint">
>>>>> <parameter name="initialDuration"
>>>>> value="{ctx:salesforce.initialDuration}" />
>>>>> <parameter name="progressionFactor"
>>>>> value="{ctx:salesforce.progressionFactor}" />
>>>>> <parameter name="maximumDuration"
>>>>> value="{ctx:salesforce.maximumDuration}" />
>>>>> <parameter name="duration"
>>>>> value="{ctx:salesforce.duration}" />
>>>>> <parameter name="responseAction"
>>>>> value="{ctx:salesforce.responseAction}" />
>>>>> </endpoint>
>>>>> </call>
>>>>>
>>>>> <property name="FORCE_ERROR_ON_SOAP_FAULT" value="false"/>
>>>>> <property name="SALESFORCE_BLOCKING"
>>>>> expression="$func:blocking"/>
>>>>> <property name="salesforce.duration"
>>>>> expression="$func:duration"/>
>>>>> <property name="salesforce.progressionFactor"
>>>>> expression="$func:progressionFactor"/>
>>>>> <property name="salesforce.maximumDuration"
>>>>> expression="$func:maximumDuration"/>
>>>>> <property name="salesforce.duration"
>>>>> expression="$func:duration"/>
>>>>> <property name="salesforce.responseAction"
>>>>> expression="$func:responseAction"/>
>>>>>
>>>>> <property
>>>>> expression="//ns:loginResponse/ns:result/ns:sessionId/text()"
>>>>> name="salesforce.sessionId" scope="operation"
>>>>> type="STRING"
>>>>> xmlns:ns="urn:partner.soap.sforce.com"/>
>>>>> <property
>>>>> expression="//ns:loginResponse/ns:result/ns:serverUrl/text()"
>>>>> name="salesforce.serviceUrl" scope="operation"
>>>>> type="STRING"
>>>>> xmlns:ns="urn:partner.soap.sforce.com"/>
>>>>> <property name="salesforce.login.done" scope="operation"
>>>>> type="STRING" value="true"/>
>>>>> <enrich>
>>>>> <source clone="true" type="body"/>
>>>>> <target property="SALESFORCE_LOGIN_RESPONSE"
>>>>> type="property"/>
>>>>> </enrich>
>>>>> <enrich>
>>>>> <source clone="true" property="ORIGINAL_MSG_PAYLOAD"
>>>>> type="property"/>
>>>>> <target type="body"/>
>>>>> </enrich>
>>>>> </else>
>>>>> </filter>
>>>>> </sequence>
>>>>> </template>
>>>>>
>>>>> [3] *Error*
>>>>>
>>>>> INFO - LogMediator Connection = Login to Salesforce .....
>>>>> [2016-02-17 17:59:19,164] WARN - *TemplateEndpoint Couldn't retrieve
>>>>> the endpoint template with the key:salesforceEndPoint*
>>>>> [2016-02-17 17:59:19,164] INFO - LogMediator To:
>>>>> https://login.salesforce.com/services/Soap/u/27.0, WSAction: urn:
>>>>> partner.soap.sforce.com/Soap/loginRequest, SOAPAction: urn:
>>>>> partner.soap.sforce.com/Soap/loginRequest, MessageID:
>>>>> urn:uuid:cbbcdcc8-600e-495e-8620-ab0fbe18e2b7, Direction: request, MESSAGE
>>>>> = Executing default 'fault' sequence, ERROR_CODE = 305100, ERROR_MESSAGE
>>>>> =*
>>>>> Couldn't find the endpoint with the name EP & template :
>>>>> salesforceEndPoint*,
>>>>> Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
>>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>>>> xmlns:urn="urn:partner.soap.sforce.com
>>>>> "><soapenv:Body><urn:login><urn:username>[email protected]
>>>>> </urn:username><urn:password>xxxxxxxxxxxxx</urn:password></urn:login></soapenv:Body></soapenv:Envelope>
>>>>>
>>>>> [4] https://docs.wso2.com/display/ESB490/Endpoint+Template
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *Thank youVivekananthan Sivanayagam*
>>>>>
>>>>> *Associate Software Engineer | WSO2*
>>>>>
>>>>> *E:[email protected] <e%[email protected]>*
>>>>> *M:+94752786138 <%2B94752786138>*
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> Best Regards,
>>>
>>> Malaka Silva
>>> Senior Tech Lead
>>> M: +94 777 219 791
>>> Tel : 94 11 214 5345
>>> Fax :94 11 2145300
>>> Skype : malaka.sampath.silva
>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>> Blog : http://mrmalakasilva.blogspot.com/
>>>
>>> WSO2, Inc.
>>> lean . enterprise . middleware
>>> http://www.wso2.com/
>>> http://www.wso2.com/about/team/malaka-silva/
>>> <http://wso2.com/about/team/malaka-silva/>
>>> https://store.wso2.com/store/
>>>
>>> Save a tree -Conserve nature & Save the world for your future. Print
>>> this email only if it is absolutely necessary.
>>>
>>
>>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Thank you
Best Regards
*Rajjaz HM*
Associate Software Engineer
WSO2 Inc. <http://wso2.com/>
lean | enterprise | middleware
Mobile | +94752833834
Email | [email protected]
LinkedIn | Blogger | WSO2 Profile
<http://wso2.com/about/team/mohammer_rajjaz/>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev