Hi Vivek,

This is where the aforementioned error is thrown [1],

if (duration != null) {
    String d = duration.getText();
    if (d != null) {
        try {
            long timeoutMilliSeconds = Long.parseLong(d.trim());
            definition.setTimeoutDuration(timeoutMilliSeconds);
        } catch (NumberFormatException e) {
            handleException("Endpoint timeout duration expected as a " +
                    "number but was not a number");
        }
    }
}

You can try debug at this point in EndpointDefinitionFactory.java and make
sure what value is going to be parsed in to Long. Then we can identify what
the actual root cause here before we go ahead.

Regards,

*Nadeeshaan Gunasinghe*
Software Engineer, WSO2 Inc. http://wso2.com
+94770596754 | nadeesh...@wso2.com | Skype: nadeeshaan.gunasinghe <#>
<http://www.facebook.com/nadeeshaan.gunasinghe>
<http://lk.linkedin.com/in/nadeeshaan>  <http://twitter.com/Nadeeshaan>
<http://nadeeshaan.blogspot.com/>
Get a signature like this: Click here!
<http://ws-promos.appspot.com/r?rdata=eyJydXJsIjogImh0dHA6Ly93d3cud2lzZXN0YW1wLmNvbS9lbWFpbC1pbnN0YWxsP3dzX25jaWQ9NjcyMjk0MDA4JnV0bV9zb3VyY2U9ZXh0ZW5zaW9uJnV0bV9tZWRpdW09ZW1haWwmdXRtX2NhbXBhaWduPXByb21vXzU3MzI1Njg1NDg3Njk3OTIiLCAiZSI6ICI1NzMyNTY4NTQ4NzY5NzkyIn0=&u=235191155923530>

On Fri, Feb 19, 2016 at 2:00 PM, Vivekananthan Sivanayagam <
vivekanant...@wso2.com> wrote:

> Hi Rajjaz ,
>
> I already tried[1] , it could not work. May I know more about trying [2] .?
>
>
>
>
> *Thank youVivekananthan Sivanayagam*
>
> *Associate Software Engineer | WSO2*
>
> *E:vivekanant...@wso2.com <e%3avivekanant...@wso2.com>*
> *M:+94752786138 <%2B94752786138>*
>
> On Fri, Feb 19, 2016 at 12:34 PM, Rajjaz Mohammed <raj...@wso2.com> wrote:
>
>> 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 <
>> vivekanant...@wso2.com> 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":"vsvivevi...@gmail.com",
>>>   "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:vivekanant...@wso2.com <e%3avivekanant...@wso2.com>*
>>> *M:+94752786138 <%2B94752786138>*
>>>
>>> On Wed, Feb 17, 2016 at 10:07 PM, Vivekananthan Sivanayagam <
>>> vivekanant...@wso2.com> 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:vivekanant...@wso2.com <e%3avivekanant...@wso2.com>*
>>>> *M:+94752786138 <%2B94752786138>*
>>>>
>>>> On Wed, Feb 17, 2016 at 9:35 PM, Malaka Silva <mal...@wso2.com> 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 <
>>>>> vivekanant...@wso2.com> wrote:
>>>>>
>>>>>> (-) support-dev
>>>>>> (+) dev
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *Thank youVivekananthan Sivanayagam*
>>>>>>
>>>>>> *Associate Software Engineer | WSO2*
>>>>>>
>>>>>> *E:vivekanant...@wso2.com <e%3avivekanant...@wso2.com>*
>>>>>> *M:+94752786138 <%2B94752786138>*
>>>>>>
>>>>>> On Wed, Feb 17, 2016 at 6:12 PM, Vivekananthan Sivanayagam <
>>>>>> vivekanant...@wso2.com> 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>vsvivevi...@gmail.com
>>>>>>> </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:vivekanant...@wso2.com <e%3avivekanant...@wso2.com>*
>>>>>>> *M:+94752786138 <%2B94752786138>*
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Dev mailing list
>>>>>> Dev@wso2.org
>>>>>> 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
>>> Dev@wso2.org
>>> 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   | raj...@wso2.com
>> LinkedIn | Blogger | WSO2 Profile
>> <http://wso2.com/about/team/mohammer_rajjaz/>
>>
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to