Page 1 of 1

add User as author via Webservice

Posted: Fri Sep 24, 2010 10:39 am
by k-pax
Hello,
I´m trying to add an author to a workitem over a C# forms application.
It "seems" to work fine (without any exception), but in the Polarion application the author remains to be the logged in user.
Here´s my code:

...
string uri = access.TrackerService.createWorkItem(item);
...
item = new WorkItem();
item.author = new User();
item.author.id = username; //I also tried, item.author.name and other possibilities like the getuser() method, but same result
item.author.uri = uri;
...
item.uri = uri;
access.TrackerService.updateWorkItem(item);
...

Maybe I´m missing something. I´m creating the users about the forms application and do know, that they´re "disabled" on default.

But enabling and/or adding the user to the project doesn´t work, too. (in polarion)
The logs aren´t really helpful.
I hope I´ll find an answer here.

Greetz

Re: add User as author via Webservice

Posted: Tue Sep 28, 2010 9:39 am
by k-pax
Does nobody from the support know how I can solve this problem?
Or do you need additional information ?

greetz

Re: add User as author via Webservice

Posted: Fri Oct 01, 2010 1:29 pm
by NickEntin
Hello,

our support colleagues will take a look on your request.
Anyway - you should write to support and then to forum, if you need some assistence from Polarion.
I can't directly answer to you, because I don't remember if author of workitem is extracted from a field of workitem, or actually retrieved from SVN (the one, who committed the item).

Best regards,
Nick

Re: add User as author via Webservice

Posted: Tue Oct 05, 2010 11:25 am
by ChernikovaEkaterina
Hello,

The author has to be set during creation of the work item.
Attempts to set read only fields are ignored silently, therefore there is no error message.

Setting the user like this should work fine:
WorkItem item = new WorkItem();
item.author = [User loaded from ProjectService or new User object with at least uri set properly];
access.TrackerService.updateWorkItem(item);

Best Regards,
Ekaterina Chernikova
Polarion Support Team

Re: add User as author via Webservice

Posted: Tue Oct 05, 2010 2:50 pm
by k-pax
Hello,
thx, but one little correction. (in case someone else has a similar problem).
replacing the method "updateWorkItem()" with "createWorkItem()" works. :)

greetz

Re: add User as author via Webservice

Posted: Fri Oct 08, 2010 9:54 am
by k-pax
Just for information. (maybe for your developement?)

The solution will be problematic, when you have to add an author to a comment, because when adding a comment with trackerservice.createcomment(uri, content) you need an uri from an existing workitem. You´re forced to use the updateWorkitem function.

Re: add User as author via Webservice

Posted: Mon Nov 15, 2010 2:58 pm
by SorrowEyes
When I tried the trackerService.createComment function I get the following error message:

Nov 15, 2010 9:55:34 AM org.apache.axis.encoding.ser.BeanSerializer serialize
SEVERE: Exception:
java.io.IOException: Non nillable element 'type' is null.
at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:215)
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
at org.apache.axis.Message.saveChanges(Message.java:631)
at org.apache.axis.handlers.HandlerChainImpl.postInvoke(HandlerChainImpl.java:208)
at org.apache.axis.handlers.HandlerChainImpl.handleRequest(HandlerChainImpl.java:154)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:143)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.polarion.alm.ws.client.tracker.TrackerWebServiceSoapBindingStub.createComment(TrackerWebServiceSoapBindingStub.java:3273)
at com.polarion.example.importer.Importer.createWorkItem01(Importer.java:609)
at com.polarion.example.importer.Importer.Process01(Importer.java:454)
at com.polarion.example.importer.Importer.main(Importer.java:347)
Nov 15, 2010 9:55:34 AM org.apache.axis.Message saveChanges
SEVERE: Exception:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
at org.apache.axis.Message.saveChanges(Message.java:631)
at org.apache.axis.handlers.HandlerChainImpl.postInvoke(HandlerChainImpl.java:208)
at org.apache.axis.handlers.HandlerChainImpl.handleRequest(HandlerChainImpl.java:154)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:143)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.polarion.alm.ws.client.tracker.TrackerWebServiceSoapBindingStub.createComment(TrackerWebServiceSoapBindingStub.java:3273)
at com.polarion.example.importer.Importer.createWorkItem01(Importer.java:609)
at com.polarion.example.importer.Importer.Process01(Importer.java:454)
at com.polarion.example.importer.Importer.main(Importer.java:347)

{http://xml.apache.org/axis/}hostname:VVT0LTDHM8VK1

java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:317)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
at org.apache.axis.Message.saveChanges(Message.java:631)
at org.apache.axis.handlers.HandlerChainImpl.postInvoke(HandlerChainImpl.java:208)
at org.apache.axis.handlers.HandlerChainImpl.handleRequest(HandlerChainImpl.java:154)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:143)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.polarion.alm.ws.client.tracker.TrackerWebServiceSoapBindingStub.createComment(TrackerWebServiceSoapBindingStub.java:3273)
at com.polarion.example.importer.Importer.createWorkItem01(Importer.java:609)
at com.polarion.example.importer.Importer.Process01(Importer.java:454)
at com.polarion.example.importer.Importer.main(Importer.java:347)
Caused by: java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:275)
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
... 15 more
Nov 15, 2010 9:55:34 AM org.apache.axis.encoding.ser.BeanSerializer serialize
SEVERE: Exception:
java.io.IOException: Non nillable element 'type' is null.
at org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:215)
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
at org.apache.axis.SOAPPart.getContentLength(SOAPPart.java:229)
at org.apache.axis.Message.getContentLength(Message.java:510)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:371)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
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.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.polarion.alm.ws.client.tracker.TrackerWebServiceSoapBindingStub.createComment(TrackerWebServiceSoapBindingStub.java:3273)
at com.polarion.example.importer.Importer.createWorkItem01(Importer.java:609)
at com.polarion.example.importer.Importer.Process01(Importer.java:454)
at com.polarion.example.importer.Importer.main(Importer.java:347)
java.io.IOException: java.io.IOException: Non nillable element 'type' is null.
[Ljava.lang.StackTraceElement;@1d23e75

Does anyone know why?

When I create a work item, and use the workItem.setComments() I also get an exception.

Re: add User as author via Webservice

Posted: Tue Nov 23, 2010 10:10 am
by NickEntin
Hello,

please quote your code.

Best regards,
Nick