Field Service

Get Involved. Join the Conversation.

Topic

    Umesh Rao
    OFSC Inbound API (SOAP transactions)
    Topic posted September 27, 2016 by Umesh Rao 
    1199 Views, 20 Comments
    Title:
    OFSC Inbound API (SOAP transactions)
    Content:

    Hello,

    Does anyone worked on  OFSC Inbound API's (SOAP transactions)? We tried to use OFSC activity WSDL and  create activity through SOAP UI. For some reason its failing with "501 Not Implemented" error.

    Version:
    16.2

    Comment

    • Hardik Gupta

      Hello Umesh,

      I have worked with Inbound API(SOAP) and activities are created successfully.

      Please share the sample payload to debug the error.

    • Sachin Rathod

      Hi Umesh,

      Please find sample inbound interface api request to create activity.

      Regards,

      Sachin Rathod

       

       

    • Sunil Ainlod

      Thanks Sachin. Could you please let me know how to generate auth_string?

      Is it I need to copy full string "SHA256( "2014-01-10T13:56:50Z" + SHA256( "Welcome1" + SHA256(“soap”)))" and convert it into SHA256?

      Regards,

      Sunil

    • Sachin Rathod

      Please find the details from OFSC API document

      The 'user' structure is used for the request authentication. If any of the situations below occur,

      authentication fails and the relevant error is returned.

      Authentication fails if:

      1 now is different from the current time on the server and this difference

      exceeds the predefined time-window (30 minutes by default)

      2 company cannot be found in the ETAdirect

      3 login cannot be found for this company

      4 user with this 'login' is not authorized to use the current method

      5 auth_string is not equal to md5(now+md5(password))

      For example:

      'now' = "2005-07-07T09:25:02+00:00" and password = "Pa$$w0rD"

      then

      md5 (password) = "06395148c998f3388e87f222bfd5c84b"

      concatenated string =

      = "2005-0707T09:25:02+00:0006395148c998f3388e87f222bfd5c84b"

      auth_string should be:

      auth_string = "62469089f554d7a38bacd9be3f29a989"

      Otherwise authentication is successful and the request is processed further.

       

    • Sunil Ainlod

      Hi Sachin,

      I tried above approach (both md5 and sha256) but still I am getting below error:

      <result_code>33</result_code>
       <error_msg>Authentication failed</error_msg>

       

      Request Parameters used for sha256:

          <now>2016-09-28T02:09:28+05:30</now>
          <login>soap</login>
          <company>****.test</company>
          <auth_string>25BE8885071910434DDF3CCF2881D39B5487DB200A15E857ACC1B2278A48D55F</auth_string> 

      Request Parameters used for md5:

          <now>2016-09-28T02:09:28+05:30</now>
          <login>soap</login>
          <company>****.test</company>
          <auth_string>62469089f554d7a38bacd9be3f29a989</auth_string> 

      Regards,

      Sunil

    • Brett Wallace

      Hi Umesh,

      If you put the following java script at the top of your SOAP UI Request window it will generate the whole "<node> ... </node>" component for your Soap Call (including encryption etc):

      ${= import java.security.MessageDigest; import java.net.HttpURLConnection; import java.net.URL;
      context.current_time = ((demo_time = context.expand('${#Project#ENV_URL}')).indexOf('http') == 0) ? new Date( new java.net.URL(demo_time).openConnection().getHeaderFieldDate('Date', 0 ) ) : new Date(); now = String.format('%tFT%1$tT%1$tz', context.current_time);
      md = MessageDigest.getInstance("MD5");md.update( context.expand('${#Project#PASSWORD}').getBytes() );md.update( (now + new BigInteger(1, md.digest()).toString(16).padLeft(32, '0')).getBytes() );
      context.user_node = "\n<user>\n <now>"+now+"</now>\n <company>"+context.expand('${#Project#COMPANY}')+"</company>\n <login>"+context.expand('${#Project#USER}')+"</login>\n <auth_string>"+(new BigInteger(1, md.digest()).toString(16).padLeft(32, '0'))+"</auth_string>\n</user>\n";
      "";}

      To then put what is generated by the above into your Soap call use the following java script at the correct location:

            ${=context.user_node}

      Lastly you need to define the following Custom Properties at the "Project" level in Soap UI, and populate them with your values:

      USER

      COMPANY

      PASSWORD

      ENV_URL

      I have attached a file with an example call for the inbound API. 

      Regards,

      Brett

       

    • Sunil Ainlod

      Working SOAP Request for Create Activity:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:toa:activity">
         <soapenv:Header/>
         <soapenv:Body>
            <urn:create_activity>
               <user>
                  <now>2016-10-06T13:28:31+05:30</now>
                  <login>soap</login>
                  <company>***.test</company>
                  <auth_string>fa375937aaeeb3f017fd504788cb6367c83baa8314c70e8fd6928541e8a04aaa</auth_string>
               </user>
               <date>2016-10-08</date>
               <resource_id>AP_Planning</resource_id>
               <position_in_route>last</position_in_route>
               <!--Zero or more repetitions:-->
               <properties>
                  <name>aworktype</name>
                  <value>10</value>
               </properties>
               <properties>
                  <name>type</name>
                  <value>regular</value>
               </properties>
               <properties>
                  <name>cphone</name>
                  <value>9886635011</value>
               </properties>
               <properties>
                  <name>status</name>
                  <value>pending</value>
               </properties>
               <properties>
                  <name>time_zone</name>
                  <value>Eastern</value>
               </properties>
               <properties>
                  <name>language</name>
                  <value>en</value>
               </properties>
               <!--Optional Properties to be set for the activity:-->
               <properties>
                  <name>cname</name>
                  <value>Name</value>
               </properties>
               <properties>
                  <name>length</name>
                  <value>60</value>
               </properties>
               <properties>
                  <name>caddress</name>
                  <value>CV Raman Nagar</value>
               </properties>
               <properties>
                  <name>ccity</name>
                  <value>BANGALORE</value>
               </properties>
               <properties>
                  <name>cstate</name>
                  <value>Karnataka</value>
               </properties>
               <properties>
                  <name>czip</name>
                  <value>560093</value>
               </properties>
               <properties>
                  <name>appt_number</name>
                  <value>Appt_Number_1</value>
               </properties>
               <properties>
                  <name>time_slot</name>
                  <value>9AM-06PM</value>
               </properties>
            </urn:create_activity>
         </soapenv:Body>
      </soapenv:Envelope>

       

      Regards,

      Sunil

    • Kiran

      Some one please post the url for SOAP request as i'm getting javax.net.ssl.HandShakeException when i try to connect.

    • Hardik Gupta

      Hi Kiran,

      The url for Inbound API is : https://api.etadirect.com/soap/inbound/?wsdl

      Regards,

      Hardik Gupta

    • Sam Alex

      Is there any way to do the folloeing criteria using REST in field service

       

      Based on workskill can I get inside a bucket what all resources have that work skill & what activities are assigned to a resource

    • Kiran

      Hi  Hardik,

       i'm still getting the same javax.net.ssl.HandShakeException:"remote host closed connection during handshake" exception while i try to send a request using SOAP UI.

    • Sachin Rathod

      Hi Kiran,

      Please check whether the SOAP UI is enabled for TLS1.2 protocol.

      Please add the following line in your SoapUI-5.1.3.vmoptions file present in "xxxxx\SmartBear\SoapUI-5.1.3\bin"

      -Dsoapui.https.protocols=TLSv1.2

      Also, if you are using java code to connect to SOAP API then please ensure to download the certificates from the wsdl and update your jvm too.

      Regards,

      Sachin Rathod

       

       

       

    • Kiran
      Sachin Rathod said:

      Hi Kiran,

      Please check whether the SOAP UI is enabled for TLS1.2 protocol.

      Please add the following line in your SoapUI-5.1.3.vmoptions file present in "xxxxx\SmartBear\SoapUI-5.1.3\bin"

      -Dsoapui.https.protocols=TLSv1.2

      Also, if you are using java code to connect to SOAP API then please ensure to download the certificates from the wsdl and update your jvm too.

      Regards,

      Sachin Rathod

       

       

       

      View original

      Thanks Sachin, It worked 

    • Danette Beal
      Sam Alex said:

      Is there any way to do the folloeing criteria using REST in field service

       

      Based on workskill can I get inside a bucket what all resources have that work skill & what activities are assigned to a resource

      View original

      Hi Sam,

      This thread is getting a little messy in the requests. Do you mind posting this as a new thread. You want to go to to the forum board and click New Topic. This way, you can track whether or not your question has been answered and it will get better visibility with our experts.

      Regards,

      Danette, Community Manager

    • Kiran

      Hi, 

      I am getting the following error when i try to create an activity using SOAP 

       

      <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:ns1="http://toatech.com/toa-soap/1.0/" xmlns:tns="NameSpace">
         <SOAP-ENV:Body>
            <urn:inbound_interface_response xmlns:urn="urn:toatech:InboundInterface:1.0">
               <report>
                  <message>
                     <result>error</result>
                     <type/>
                     <code>60080</code>
                     <description>You don't have permission for this action. login: [user.name]</description>
                  </message>
               </report>
            </urn:inbound_interface_response>
         </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

       

      Please help me to resolve the issue,Also how do we find the current time on server so as to calculate the auth_string.