add User as author via Webservice

Description
k-pax
Posts: 4
Joined: Thu Sep 23, 2010 11:09 am

add User as author via Webservice

Postby k-pax » Fri Sep 24, 2010 10:39 am

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

k-pax
Posts: 4
Joined: Thu Sep 23, 2010 11:09 am

Re: add User as author via Webservice

Postby k-pax » Tue Sep 28, 2010 9:39 am

Does nobody from the support know how I can solve this problem?
Or do you need additional information ?

greetz

NickEntin
Posts: 472
Joined: Tue Oct 24, 2006 10:27 am
Location: Polarion Software GmbH, Stuttgart
Contact:

Re: add User as author via Webservice

Postby NickEntin » Fri Oct 01, 2010 1:29 pm

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

ChernikovaEkaterina
Posts: 15
Joined: Mon Dec 07, 2009 9:08 pm

Re: add User as author via Webservice

Postby ChernikovaEkaterina » Tue Oct 05, 2010 11:25 am

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

k-pax
Posts: 4
Joined: Thu Sep 23, 2010 11:09 am

Re: add User as author via Webservice

Postby k-pax » Tue Oct 05, 2010 2:50 pm

Hello,
thx, but one little correction. (in case someone else has a similar problem).
replacing the method "updateWorkItem()" with "createWorkItem()" works. :)

greetz

k-pax
Posts: 4
Joined: Thu Sep 23, 2010 11:09 am

Re: add User as author via Webservice

Postby k-pax » Fri Oct 08, 2010 9:54 am

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.

SorrowEyes
Posts: 16
Joined: Fri Nov 05, 2010 6:57 pm

Re: add User as author via Webservice

Postby SorrowEyes » Mon Nov 15, 2010 2:58 pm

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.

NickEntin
Posts: 472
Joined: Tue Oct 24, 2006 10:27 am
Location: Polarion Software GmbH, Stuttgart
Contact:

Re: add User as author via Webservice

Postby NickEntin » Tue Nov 23, 2010 10:10 am

Hello,

please quote your code.

Best regards,
Nick


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 7 guests