Soap API question

Discuss problems installing or using TrackStudio.

Soap API question

Postby province-sud » Mon Apr 22, 2013 12:05 am

Hi,
We are currently having a problem with the task creation method through the Java soap API (v 3.5).

1.It is working while using the basic creation method (4 parameters) followed by the update method to set the remaining parameters:
Code: Select all
java.lang.String createTask(java.lang.String sessionId,java.lang.String parentTaskId,java.lang.String categoryId,java.lang.String name)

void updateTask(java.lang.String sessionId,java.lang.String taskId,java.lang.String shortName,java.lang.String name, java.lang.String description, double budget,long deadline,java.lang.String priorityId,java.lang.String parentTaskId,
      java.lang.String handlerUserId,java.lang.String handlerGroupId, boolean sendMail, java.lang.String[] udfNames,java.lang.String[] udfValues)
                throws java.rmi.RemoteException



2. It is failing using the full parameter method with the appropriate parameters (apparently ):
Code: Select all
java.lang.String createTask(java.lang.String sessionId,java.lang.String categoryId,java.lang.String shortname,java.lang.String name, java.lang.String description,
                            double budget,long deadline,java.lang.String priorityId,java.lang.String parentId,
                            java.lang.String handlerUserId,java.lang.String handlerGroupId,java.lang.String[] udfNames,java.lang.String[] udfValues)


//Code
Code: Select all
public void create(String uTSSubmitterUserId, String uObjet, String uIntitule, String uTSDescription, String uCategid, String uParentTask){
        try {
            String uHandlerUserId = "1";//root
            System.out.println( "create uTSSubmitterUserId="+uTSSubmitterUserId+ " uObjet="+uObjet+" uIntitule="+uIntitule
                    +" uTSDescription="+uTSDescription + " uCategid="+uCategid +" uParentTask="+uParentTask);

            // 2 STEP CREATION : CREATION FOLLOWED BY UPDATE => OK : the task is created and then updated
            String taskId = dp.getTaskService().createTask(sessionId, uParentTask, uCategid,uIntitule);
            dp.getTaskService().updateTask(sessionId, taskId,uObjet, uIntitule,uTSDescription, 0, -1, null, uParentTask, uHandlerUserId, null, false, null, null);

            System.out.println( "CREATION FOLLOWED BY UPDATE SUCCESSFULL taskId="+ taskId);

            // ONE STEP CREATION : FAILS : see exception trace below
            taskId = dp.getTaskService().createTask(sessionId, uCategid , "NEW"+uObjet, "NEW"+uIntitule, "NEW"+uTSDescription, 0,-1, null, uParentTask , uHandlerUserId, null,  null, null) ;

            System.out.println( "ONE STEP CREATION SUCCESSFULL taskId="+ taskId);

        }  catch (RemoteException e) {
            e.printStackTrace();
        }catch (Exception e) {
            e.printStackTrace();
        }
    }


//Exception trace

Code: Select all
create uTSSubmitterUserId=8a8186843c50dbc1013c8a658fd821ee uObjet=MATERIEL uIntitule=CAPS: porte  uTSDescription=Description de la demande uCategid=8a8186843ccc5703013d0f64ee0b2897 uParentTask=8a8186843ccc5703013d0f4489332072
CREATION FOLLOWED BY UPDATE SUCCESSFULL taskId=8a818f853dadcad6013e1a959dc63a06
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
 faultString: org.xml.sax.SAXException: Bad types (double -> class java.lang.String)
faultActor:
 faultNode:
 faultDetail:
                {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Bad types (double -> class java.lang.String)
                at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:286)
                at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
                at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
                at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
                at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
                at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
                at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:81)
                at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
                at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
                at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
                at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
                at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
                at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
                at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
                at com.trackstudio.soap.TSAxisServlet.doPost(TSAxisServlet.java:19)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
                at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:130)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                at org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:359)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
                at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:419)
                at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:378)
                at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
                at java.lang.Thread.run(Thread.java:662)


Regards.
province-sud
 
Posts: 23
Joined: Thu Jan 08, 2009 11:58 pm

Re: Soap API question

Postby Petr » Mon Apr 22, 2013 9:21 am

Hello.
You have a cast case exception. You should try to replace 0 to 0d and -1 to -1d. I guess SOAP client tries to convert it to String.

Please report if it works.
Учи Java и ищи работу вместе с www.job4j.ru
Petr
 
Posts: 2914
Joined: Wed Aug 12, 2009 4:38 pm

Re: Soap API question

Postby province-sud » Tue Apr 23, 2013 3:31 am

Hi,
Thanks for reply.

I tried this :

Code: Select all
taskId = dp.getTaskService().createTask(sessionId, uCategid , "NEW"+uObjet, "NEW"+uIntitule, "NEW"+uTSDescription, 0d,-1d, null, uParentTask , uHandlerUserId, null,  null, null) ;

Code: Select all
taskId = dp.getTaskService().createTask(sessionId, uCategid , "NEW"+uObjet, "NEW"+uIntitule, "NEW"+uTSDescription, 0d,-1l, null, uParentTask , uHandlerUserId, null,  null, null) ;


Same error.
Any idea ?

Regards.
province-sud
 
Posts: 23
Joined: Thu Jan 08, 2009 11:58 pm

Re: Soap API question

Postby Petr » Tue Apr 23, 2013 7:20 am

I am going to repeat this case in local environments and then I can assist you.
Учи Java и ищи работу вместе с www.job4j.ru
Petr
 
Posts: 2914
Joined: Wed Aug 12, 2009 4:38 pm

Re: Soap API question

Postby Petr » Tue Apr 23, 2013 8:09 am

Code: Select all
package com.trackstudio.soap.example;

import gran.trackstudio.DevPack;

public class TaskUtil {
    public static void main(String[] args) throws Exception {
        DevPack devPack = new DevPack("http://localhost:8888/TrackStudio/services");
        String sessionId = devPack.getUserService().authenticate("root", "root");
        String categoryId = "402881850aa7444c010aa792b39e0144";
        String parentId = "40288199143b11ea01143b1da8080017";
        devPack.getTaskService().createTask(
                sessionId, categoryId, "test", "test", "test",
                0d, -1l, null, parentId,
                "1", null, null, null);
    }
}

It works correctly. Well I guess you should send your backup so I can check it in my PC.
This is an one more detail. What did the server logs say about this error?
Учи Java и ищи работу вместе с www.job4j.ru
Petr
 
Posts: 2914
Joined: Wed Aug 12, 2009 4:38 pm

Re: Soap API question

Postby province-sud » Thu May 02, 2013 7:35 am

Thanks for reply.

We have still the problem.
Are you using the 3.5 version ?

Regards.
province-sud
 
Posts: 23
Joined: Thu Jan 08, 2009 11:58 pm

Re: Soap API question

Postby Petr » Thu May 02, 2013 2:59 pm

I tested my code in TS3.5.
Can you send me your db backup?
Учи Java и ищи работу вместе с www.job4j.ru
Petr
 
Posts: 2914
Joined: Wed Aug 12, 2009 4:38 pm


Return to TrackStudio Support

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 1 guest

cron