Error code 415: Unsupported Media Type

Version 1
    This document was generated from CDN thread

    Created by: Amy Yang on 03-10-2010 09:39:16 PM
    Hi,
     
    I am from CUPM team at Cisco.  I am trying to create a DistrilbutionList in UC.  I got error code 415.  The error message is: "= Unsupported Media Type.  The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method."  Here is the code that I passed in the Post request.  The input xmlDL to POST  = <?xml version="1.0" encoding="UTF-8" standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</Alias><DisplayName>Turtle One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletable><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts><AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmrest/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><PartitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><DistributionListMembersURI></DistributionListMembersURI></DistributionList></DistributionLists>
     
     
      try{
       JAXBContext ctx = JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.class);
       StringWriter writer = new StringWriter();
       Marshaller marshaller = ctx.createMarshaller();
       marshaller.marshal(dlsPojo, writer);
       String xmlDL = writer.toString();
       System.out.println("&&& XML DistributionList =  " + xmlDL);  
       ....
     
      try{
      //post a request
      ClientResponse restResponse = webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.class, xmlDL);
      Status status = restResponse.getClientResponseStatus();
      code = status.getStatusCode();
      
      data = restResponse.getEntity(String.class);
      }catch (ClientHandlerException chx){

    ....
     

    Subject: RE: Error code 415: Unsupported Media Type
    Replied by: Matthew Penning on 04-10-2010 04:45:19 AM
    Hi Amy - I see that you're setting the "Accept" header to "application/xml", but you may need to also set the "Content-Type" header to "application/xml". 
     
    ~ Matt
     
    Hi,
     
    I am from CUPM team at Cisco.  I am trying to create a DistrilbutionList in UC.  I got error code 415.  The error message is: "= Unsupported Media Type.  The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method."  Here is the code that I passed in the Post request.  The input xmlDL to POST  = <?xml version="1.0" encoding="UTF-8" standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</Alias><DisplayName>Turtle One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletable><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts><AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmrest/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><PartitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><DistributionListMembersURI></DistributionListMembersURI></DistributionList></DistributionLists>
     
     
      try{
       JAXBContext ctx = JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.class);
       StringWriter writer = new StringWriter();
       Marshaller marshaller = ctx.createMarshaller();
       marshaller.marshal(dlsPojo, writer);
       String xmlDL = writer.toString();
       System.out.println("&&& XML DistributionList =  " + xmlDL);  
       ....
     
      try{
      //post a request
      ClientResponse restResponse = webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.class, xmlDL);
      Status status = restResponse.getClientResponseStatus();
      code = status.getStatusCode();
      
      data = restResponse.getEntity(String.class);
      }catch (ClientHandlerException chx){

    ....
     


    Subject: RE: New Message from Matthew Penning in Cisco Unity Connection Provisioning
    Replied by: Amy Yang on 04-10-2010 05:22:33 PM
    Thanks a lot Matt.  I will do the change and try again.

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml". 

    ~ Matt


    Hi,

    I am from CUPM team at Cisco.  I am trying to create a DistrilbutionList
    in UC.  I got error code 415.  The error message is: "= Unsupported
    Media Type.  The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method."  Here is the code that I passed in
    the Post request.  The input xmlDL to POST  = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


      try{
       JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
       StringWriter writer = new StringWriter();
       Marshaller marshaller = ctx.createMarshaller();
       marshaller.marshal(dlsPojo, writer);
       String xmlDL = writer.toString();
       System.out.println("&&& XML DistributionList =  " + xmlDL); 
       ....

      try{
      //post a request
      ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
      Status status = restResponse.getClientResponseStatus();
      code = status.getStatusCode();
     
      data = restResponse.getEntity(String.class);
      }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Matthew Penning on 05-10-2010 02:08:33 AM
    Hi Amy ¿ I¿m not too familiar with the Jersey client side libraries, but ¿application/x-www-form-urlencoded¿ probably isn¿t what you want since this isn¿t a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to ¿application/xml¿, I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/2607283>
    or simply reply to this email.

    Subject: RE: New Message from Matthew Penning in Cisco Unity Connection Provisioning
    Replied by: Amy Yang on 04-10-2010 06:54:47 PM
    Hi Matt,

    I could not find a correct syntax to set the content type?  Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml". 

    ~ Matt


    Hi,

    I am from CUPM team at Cisco.  I am trying to create a DistrilbutionList
    in UC.  I got error code 415.  The error message is: "= Unsupported
    Media Type.  The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method."  Here is the code that I passed in
    the Post request.  The input xmlDL to POST  = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


      try{
       JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
       StringWriter writer = new StringWriter();
       Marshaller marshaller = ctx.createMarshaller();
       marshaller.marshal(dlsPojo, writer);
       String xmlDL = writer.toString();
       System.out.println("&&& XML DistributionList =  " + xmlDL); 
       ....

      try{
      //post a request
      ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
      Status status = restResponse.getClientResponseStatus();
      code = status.getStatusCode();
     
      data = restResponse.getEntity(String.class);
      }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 05-10-2010 01:10:47 AM
    Hi Matt,

    I have added the content-type as follows.  I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST".  I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com 
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.

    Subject: RE: New Message from Matthew Penning in Cisco Unity Connection Provisioning
    Replied by: Amy Yang on 05-10-2010 04:55:33 PM
    Hi Matt,

    Your suggestion seems resolve the error code 415.  Now I got different
    error code 400: 

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 05-10-2010 08:14:33 PM
    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly.  Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC.  The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 05-10-2010 08:45:33 PM
    Hi Matt,

    Here is the update:  I finally found a way to printout an
    EntityInputStream: 

    <?xml version="1.0" encoding="UTF-8"
    standalone="yes"?><ErrorDetails><errors><code>DATA_EXCEPTION</code><mess
    age>Missing parameter
    label.distributionlist.alias</message></errors></ErrorDetails>

    It seems complain the "alias" is not set.  But I did set it as
    <Alias>turtle_1</Alias>

    Please let me know is it an issue at CUPI or my input data is not
    correct.

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Tuesday, October 05, 2010 1:14 PM
    To: 'cdicuser@developer.cisco.com'
    Cc: Subbu Chandrasekaran (csubrama)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly.  Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC.  The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 06-10-2010 05:16:47 PM
    Hi Matt and Anil,

    Could someone from CUPI team can look at my issue here.  I got data
    exception which complain the "Alias" is not in my input data.  My input
    data does contains the alias field.  I tied UC version 7.1.3 and 8.5
    versions.  I also tried changed the alias field from " turtle_1" to
    "turtle" just in case it does not like the "_1" at the end.  This issue
    is a showstopper to our feature to CUPM 8.5 release. We need your help,
    please.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 1:46 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Here is the update: I finally found a way to printout an
    EntityInputStream:

    <?xml version="1.0" encoding="UTF-8"
    standalone="yes"?><ErrorDetails><errors><code>DATA_EXCEPTION</code><mess
    age>Missing parameter
    label.distributionlist.alias</message></errors></ErrorDetails>

    It seems complain the "alias" is not set. But I did set it as
    <Alias>turtle_1</Alias>

    Please let me know is it an issue at CUPI or my input data is not
    correct.

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Tuesday, October 05, 2010 1:14 PM
    To: 'cdicuser@developer.cisco.com'
    Cc: Subbu Chandrasekaran (csubrama)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly. Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC. The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8962>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Matthew Penning on 06-10-2010 05:19:47 PM
    In your XML that you post, it looks like you have <DistributionLists> in
    there, which is not correct.  That might be the problem - it should just
    be <DistributionList>



    ~ Matt



    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 10:17 AM
    To: cdicuser@developer.cisco.com; Anil Verma (anilve); Matthew Penning
    (mapennin)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf
    Importance: High



    Hi Matt and Anil,



    Could someone from CUPI team can look at my issue here.  I got data
    exception which complain the "Alias" is not in my input data.  My input
    data does contains the alias field.  I tied UC version 7.1.3 and 8.5
    versions.  I also tried changed the alias field from " turtle_1" to
    "turtle" just in case it does not like the "_1" at the end.  This issue
    is a showstopper to our feature to CUPM 8.5 release. We need your help,
    please.



    Thanks,

    Amy



    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 1:46 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Here is the update: I finally found a way to printout an
    EntityInputStream:

    <?xml version="1.0" encoding="UTF-8"
    standalone="yes"?><ErrorDetails><errors><code>DATA_EXCEPTION</code><mess
    age>Missing parameter
    label.distributionlist.alias</message></errors></ErrorDetails>

    It seems complain the "alias" is not set. But I did set it as
    <Alias>turtle_1</Alias>

    Please let me know is it an issue at CUPI or my input data is not
    correct.

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Tuesday, October 05, 2010 1:14 PM
    To: 'cdicuser@developer.cisco.com'
    Cc: Subbu Chandrasekaran (csubrama)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly. Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC. The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8962>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 06-10-2010 06:52:47 PM
    Hi Matt,

    Thanks a lot for the suggestion.  I will try it to make the POST method
    go.  However, for our GET, I need UC's original DistributionList.xsd to
    unmarshall a list of DistributionList.  I generate POJO by first using
    ant tool and compiler com.sun.tools.xjc.XJC2Task to compile the
    DistributionList.xsd.  It will generate DistributionList.java,
    DistributionLists.java and one ObjectFactory.java.  These three classes
    are used by JAXB to do marshalling and unmarshalling.  It is the same
    case for DistributionListMember.xsd.  Shouldn't CUPI accept the format
    that is generated based on xsd schema?  I will try your suggestion now
    to get the unit test case pass.  But we need a permanent solution for
    supporting DistributionList for UC.

    Thanks,
    Amy

    ________________________________

    From: Matthew Penning (mapennin)
    Sent: Wednesday, October 06, 2010 11:37 AM
    To: Amy Yang (amyyang); 'cdicuser@developer.cisco.com'; Anil Verma
    (anilve); Murray Mar (mmar); James Bohrer (jbohrer); Scott Holter
    (sholter)
    Cc: Shashi Arja (sarja); Raji Sridar (raji)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    There should be two elements defined in the schema - DistributionLists
    and DistributionList.   DistributionLists (plural) will be defined as a
    collection of DistributionList (singular) elements.



    I'm not sure how you are generating your POJO from that, you may need to
    look at that more closely.  One simple thing to do:   make a new xsd
    that does not have DistributionLists defined in it, just
    DistributionList.  That way whatever you are using to generate pojos
    won't get confused.



    Or you can always just create the XML yourself, it's fairly trivial too
    ...



    ~ Matt







    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 11:24 AM
    To: Amy Yang (amyyang); Matthew Penning (mapennin);
    'cdicuser@developer.cisco.com'; Anil Verma (anilve); Murray Mar (mmar);
    James Bohrer (jbohrer); Scott Holter (sholter)
    Cc: Shashi Arja (sarja); Raji Sridar (raji)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf
    Importance: High



    Hi Matt,



    If I don't add the DistributionList JAXB POJO object into the JAXB POJO
    DistributionLists, I will get JAXBException : null  The
    DistributionList.xsd does has this DistributionLists defined there.
    Therefore, it failed at marshaller.marshal(dlPojo, writer); The error is
    this JAXBException: null.  I had this error a week ago.  It took me
    sometime to figured out that I need to set the JAXB POJO
    DistributionLists with the "DistributionList".  Could you please let me
    know what other solution I could try?



    Thanks,

    Amy



    ________________________________

    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 10:33 AM
    To: Matthew Penning (mapennin); 'cdicuser@developer.cisco.com'; Anil
    Verma (anilve); Murray Mar (mmar); James Bohrer (jbohrer); Scott Holter
    (sholter)
    Cc: Shashi Arja (sarja); Raji Sridar (raji)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    Thanks a lot Matt.  I will make the change and try again.  Does the URI
    is still the distributionlists :

    https://10.77.208.26/vmrest/distributionlists  With "s" here right?  I
    only need to pass in one distributionList, but not to include this
    distributionList inside <DistributionLists> tag, right?



    Thanks,

    Amy

    ________________________________

    From: Matthew Penning (mapennin)
    Sent: Wednesday, October 06, 2010 10:20 AM
    To: Amy Yang (amyyang); 'cdicuser@developer.cisco.com'; Anil Verma
    (anilve)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    In your XML that you post, it looks like you have <DistributionLists> in
    there, which is not correct.  That might be the problem - it should just
    be <DistributionList>



    ~ Matt



    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 10:17 AM
    To: cdicuser@developer.cisco.com; Anil Verma (anilve); Matthew Penning
    (mapennin)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf
    Importance: High



    Hi Matt and Anil,



    Could someone from CUPI team can look at my issue here.  I got data
    exception which complain the "Alias" is not in my input data.  My input
    data does contains the alias field.  I tied UC version 7.1.3 and 8.5
    versions.  I also tried changed the alias field from " turtle_1" to
    "turtle" just in case it does not like the "_1" at the end.  This issue
    is a showstopper to our feature to CUPM 8.5 release. We need your help,
    please.



    Thanks,

    Amy



    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 1:46 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Here is the update: I finally found a way to printout an
    EntityInputStream:

    <?xml version="1.0" encoding="UTF-8"
    standalone="yes"?><ErrorDetails><errors><code>DATA_EXCEPTION</code><mess
    age>Missing parameter
    label.distributionlist.alias</message></errors></ErrorDetails>

    It seems complain the "alias" is not set. But I did set it as
    <Alias>turtle_1</Alias>

    Please let me know is it an issue at CUPI or my input data is not
    correct.

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Tuesday, October 05, 2010 1:14 PM
    To: 'cdicuser@developer.cisco.com'
    Cc: Subbu Chandrasekaran (csubrama)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly. Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC. The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8962>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: David Wanagel on 06-10-2010 07:03:33 PM
    Both DistributionList and DistributionLists are discrete objects and both can be marshalled or unmarhalled independently.  DistributionLists is used for a GET of the collection of all distribution lists (e.g. /vmrest/distributionlists).  In contrast a GET on a specific distribution list returns a DistributionList object (e.g. GET /vmrest/distributionlists/<object id>).  A PUT for a distribution list would use a JAXBElement<DistributionList> as created by the object factory and that marshals OK.
     
    We don't have your code here, so its hard to tell what you were trying to do at the time you got the exception, but as far as the XSD goes, it can be used as is.
     
    -Dave

    Subject: RE: New Message from David Wanagel in Cisco Unity Connection Provisioning I
    Replied by: David Wanagel on 06-10-2010 11:41:01 PM
    It's not clear to me why either, but marshaling either object should be the same.  There must be something in the dlPojo that is causing trouble.  Try getting using getCause() on the exception and look at each exception in the exception chain, one of them may have more information on why it is having trouble.

    Subject: RE: New Message from David Wanagel in Cisco Unity Connection Provisioning I
    Replied by: Amy Yang on 07-10-2010 03:11:47 AM
    Hi Dave,

    Thanks for the hint.  The cause is:

    Got JAXBException: null The clause = com.sun.istack.SAXException2:
    unable to marshal type "com.cisco.uc713.rest.dlist.DistributionList" as
    an element because it is missing an @XmlRootElement annotation

    I also tried "Partition", the result is the same:

    Got JAXBException: null The clause = com.sun.istack.SAXException2:
    unable to marshal type "com.cisco.uc713.rest.Partition" as an element
    because it is missing an @XmlRootElement annotation

    Looks like all the classes we need are missing this @XmlRootElement. We
    need "DistributionList", "DistributionListMember", "Partition", and
    "Contact".  Do I need to manually change each POJO file or I need to
    change xsd files so that the compiler can generate right format of POJO?


    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Wednesday, October 06, 2010 4:41 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from David Wanagel in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    David Wanagel in Cisco Unity Connection Provisioning I


    David Wanagel has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    It's not clear to me why either, but marshaling either object should be
    the same.  There must be something in the dlPojo that is causing
    trouble.  Try getting using getCause() on the exception and look at each
    exception in the exception chain, one of them may have more information
    on why it is having trouble.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/261
    3606>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 07-10-2010 05:39:47 AM
    Hi Dave,

    After I manually edit the POJO, DistributionList can be marshalled.
    Thank you very much for your help.  Can CUPI team change the four xsd
    files so that they can be compiled correctly into the right POJO format?

    I am now testing each field of Distribution List during creating a
    DistributionList in UC.  I got some "DATA_EXCEPTION".  I would like to
    know what kind of data violations do I hit.

    1)    In the UC, there is only one configure there.  If I pass in either
    the partition object id and/or partition uri, I got
    <errors><code>DATA_EXCEPTION</code><message>The partition must belong to
    the local system.</message></errors></ErrorDetails> What does it mean?
    Is Partition required for add a distribution list?  If I don't include
    it, the error disappear.

    2)    If I have display name as "Amy Yang", I got
    <errors><code>DATA_EXCEPTION</code><message>CK_tbl_DistributionList_Disp
    layName</message></errors></ErrorDetails> It does not like space.  I
    have to pass in AmyYang.  Is it a bug?

    3)    Whether I pass in location object id or not, I got
    errors><code>DATA_EXCEPTION</code><message>informix.ck_tbl_alias_alias_l
    ocationobjectid</message></errors></ErrorDetails> What does it mean?
    What data do I need to pass in?

    But the strange thing is that although I could not fix the error #3, and
    my test program got error code 400 from UC that "the request could not
    be understand by the server due to incorrect syntax, my test
    Distribution List "turtle_1" was created in UC.

    4)    One more thing I noted is that if I successful create a
    DistributionList (without members), I don't get anything back from
    CUPI's response message.  I am expecting a newly created
    DistributionList or its URI. I will use the URI to add members.

    We currently really need your team's help in getting the issue resolved.
    Thanks again.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Wednesday, October 06, 2010 8:12 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    David Wanagel in Cisco Unity Connection Provisioning I


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Dave,

    Thanks for the hint. The cause is:

    Got JAXBException: null The clause = com.sun.istack.SAXException2:
    unable to marshal type "com.cisco.uc713.rest.dlist.DistributionList" as
    an element because it is missing an @XmlRootElement annotation

    I also tried "Partition", the result is the same:

    Got JAXBException: null The clause = com.sun.istack.SAXException2:
    unable to marshal type "com.cisco.uc713.rest.Partition" as an element
    because it is missing an @XmlRootElement annotation

    Looks like all the classes we need are missing this @XmlRootElement. We
    need "DistributionList", "DistributionListMember", "Partition", and
    "Contact". Do I need to manually change each POJO file or I need to
    change xsd files so that the compiler can generate right format of POJO?


    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Wednesday, October 06, 2010 4:41 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from David Wanagel in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    David Wanagel in Cisco Unity Connection Provisioning I


    David Wanagel has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    It's not clear to me why either, but marshaling either object should be
    the same. There must be something in the dlPojo that is causing
    trouble. Try getting using getCause() on the exception and look at each
    exception in the exception chain, one of them may have more information
    on why it is having trouble.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/261
    3606>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/261
    3828>
    or simply reply to this email.

    Subject: RE: New Message from David Wanagel in Cisco Unity Connection Provisioning I
    Replied by: David Wanagel on 07-10-2010 09:32:11 AM
    I'm not sure why you are having trouble, the code below runs fine:
     

    public void testDl() {
      DistributionList dl = new DistributionList();
      dl.setDisplayName("foo");
     
      JAXBElement<DistributionList> j = new ObjectFactory().createDistributionList(dl);
      try {
       JAXBContext context = JAXBContext.newInstance("com.cisco.connection.xjc");        
       Marshaller marshaller = context.createMarshaller();
      
       marshaller.marshal(j, System.out);
      }
      catch (JAXBException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
      }
     
    }
     
    Console output below:



    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><DistributionList xmlns:ns2="http://www.cisco.com"><DisplayName>foo</DisplayName></DistributionList>

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 06-10-2010 05:26:33 PM
    (Included more folks from UC team)

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 9:48 AM
    To: 'cdicuser@developer.cisco.com'; Anil Verma (anilve); Matthew Penning
    (mapennin)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf
    Importance: High


    Hi Matt and Anil,

    Could someone from CUPI team can look at my issue here.  I got data
    exception which complain the "Alias" is not in my input data.  My input
    data does contains the alias field.  I tied UC version 7.1.3 and 8.5
    versions.  I also tried changed the alias field from " turtle_1" to
    "turtle" just in case it does not like the "_1" at the end.  This issue
    is a showstopper to our feature to CUPM 8.5 release. We need your help,
    please.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 1:46 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Here is the update: I finally found a way to printout an
    EntityInputStream:

    <?xml version="1.0" encoding="UTF-8"
    standalone="yes"?><ErrorDetails><errors><code>DATA_EXCEPTION</code><mess
    age>Missing parameter
    label.distributionlist.alias</message></errors></ErrorDetails>

    It seems complain the "alias" is not set. But I did set it as
    <Alias>turtle_1</Alias>

    Please let me know is it an issue at CUPI or my input data is not
    correct.

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Tuesday, October 05, 2010 1:14 PM
    To: 'cdicuser@developer.cisco.com'
    Cc: Subbu Chandrasekaran (csubrama)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly. Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC. The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8962>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 06-10-2010 05:33:33 PM
    Thanks a lot Matt.  I will make the change and try again.  Does the URI
    is still the distributionlists :

    https://10.77.208.26/vmrest/distributionlists  With "s" here right?  I
    only need to pass in one distributionList, but not to include this
    distributionList inside <DistributionLists> tag, right?


    Thanks,
    Amy

    ________________________________

    From: Matthew Penning (mapennin)
    Sent: Wednesday, October 06, 2010 10:20 AM
    To: Amy Yang (amyyang); 'cdicuser@developer.cisco.com'; Anil Verma
    (anilve)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    In your XML that you post, it looks like you have <DistributionLists> in
    there, which is not correct.  That might be the problem - it should just
    be <DistributionList>



    ~ Matt



    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 10:17 AM
    To: cdicuser@developer.cisco.com; Anil Verma (anilve); Matthew Penning
    (mapennin)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf
    Importance: High



    Hi Matt and Anil,



    Could someone from CUPI team can look at my issue here.  I got data
    exception which complain the "Alias" is not in my input data.  My input
    data does contains the alias field.  I tied UC version 7.1.3 and 8.5
    versions.  I also tried changed the alias field from " turtle_1" to
    "turtle" just in case it does not like the "_1" at the end.  This issue
    is a showstopper to our feature to CUPM 8.5 release. We need your help,
    please.



    Thanks,

    Amy



    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 1:46 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Here is the update: I finally found a way to printout an
    EntityInputStream:

    <?xml version="1.0" encoding="UTF-8"
    standalone="yes"?><ErrorDetails><errors><code>DATA_EXCEPTION</code><mess
    age>Missing parameter
    label.distributionlist.alias</message></errors></ErrorDetails>

    It seems complain the "alias" is not set. But I did set it as
    <Alias>turtle_1</Alias>

    Please let me know is it an issue at CUPI or my input data is not
    correct.

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Tuesday, October 05, 2010 1:14 PM
    To: 'cdicuser@developer.cisco.com'
    Cc: Subbu Chandrasekaran (csubrama)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly. Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC. The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8962>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Amy Yang on 06-10-2010 06:24:33 PM
    Hi Matt,

    If I don't add the DistributionList JAXB POJO object into the JAXB POJO
    DistributionLists, I will get JAXBException : null  The
    DistributionList.xsd does has this DistributionLists defined there.
    Therefore, it failed at marshaller.marshal(dlPojo, writer); The error is
    this JAXBException: null.  I had this error a week ago.  It took me
    sometime to figured out that I need to set the JAXB POJO
    DistributionLists with the "DistributionList".  Could you please let me
    know what other solution I could try?

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 10:33 AM
    To: Matthew Penning (mapennin); 'cdicuser@developer.cisco.com'; Anil
    Verma (anilve); Murray Mar (mmar); James Bohrer (jbohrer); Scott Holter
    (sholter)
    Cc: Shashi Arja (sarja); Raji Sridar (raji)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf


    Thanks a lot Matt.  I will make the change and try again.  Does the URI
    is still the distributionlists :

    https://10.77.208.26/vmrest/distributionlists  With "s" here right?  I
    only need to pass in one distributionList, but not to include this
    distributionList inside <DistributionLists> tag, right?


    Thanks,
    Amy

    ________________________________

    From: Matthew Penning (mapennin)
    Sent: Wednesday, October 06, 2010 10:20 AM
    To: Amy Yang (amyyang); 'cdicuser@developer.cisco.com'; Anil Verma
    (anilve)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    In your XML that you post, it looks like you have <DistributionLists> in
    there, which is not correct.  That might be the problem - it should just
    be <DistributionList>



    ~ Matt



    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 10:17 AM
    To: cdicuser@developer.cisco.com; Anil Verma (anilve); Matthew Penning
    (mapennin)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf
    Importance: High



    Hi Matt and Anil,



    Could someone from CUPI team can look at my issue here.  I got data
    exception which complain the "Alias" is not in my input data.  My input
    data does contains the alias field.  I tied UC version 7.1.3 and 8.5
    versions.  I also tried changed the alias field from " turtle_1" to
    "turtle" just in case it does not like the "_1" at the end.  This issue
    is a showstopper to our feature to CUPM 8.5 release. We need your help,
    please.



    Thanks,

    Amy



    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 1:46 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Here is the update: I finally found a way to printout an
    EntityInputStream:

    <?xml version="1.0" encoding="UTF-8"
    standalone="yes"?><ErrorDetails><errors><code>DATA_EXCEPTION</code><mess
    age>Missing parameter
    label.distributionlist.alias</message></errors></ErrorDetails>

    It seems complain the "alias" is not set. But I did set it as
    <Alias>turtle_1</Alias>

    Please let me know is it an issue at CUPI or my input data is not
    correct.

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Tuesday, October 05, 2010 1:14 PM
    To: 'cdicuser@developer.cisco.com'
    Cc: Subbu Chandrasekaran (csubrama)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly. Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC. The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8962>
    or simply reply to this email.

    Subject: RE: New Message from Amy Yang in Cisco Unity Connection Provisioning Interf
    Replied by: Matthew Penning on 06-10-2010 06:37:33 PM
    There should be two elements defined in the schema - DistributionLists
    and DistributionList.   DistributionLists (plural) will be defined as a
    collection of DistributionList (singular) elements.



    I'm not sure how you are generating your POJO from that, you may need to
    look at that more closely.  One simple thing to do:   make a new xsd
    that does not have DistributionLists defined in it, just
    DistributionList.  That way whatever you are using to generate pojos
    won't get confused.



    Or you can always just create the XML yourself, it's fairly trivial too
    ...



    ~ Matt







    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 11:24 AM
    To: Amy Yang (amyyang); Matthew Penning (mapennin);
    'cdicuser@developer.cisco.com'; Anil Verma (anilve); Murray Mar (mmar);
    James Bohrer (jbohrer); Scott Holter (sholter)
    Cc: Shashi Arja (sarja); Raji Sridar (raji)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf
    Importance: High



    Hi Matt,



    If I don't add the DistributionList JAXB POJO object into the JAXB POJO
    DistributionLists, I will get JAXBException : null  The
    DistributionList.xsd does has this DistributionLists defined there.
    Therefore, it failed at marshaller.marshal(dlPojo, writer); The error is
    this JAXBException: null.  I had this error a week ago.  It took me
    sometime to figured out that I need to set the JAXB POJO
    DistributionLists with the "DistributionList".  Could you please let me
    know what other solution I could try?



    Thanks,

    Amy



    ________________________________

    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 10:33 AM
    To: Matthew Penning (mapennin); 'cdicuser@developer.cisco.com'; Anil
    Verma (anilve); Murray Mar (mmar); James Bohrer (jbohrer); Scott Holter
    (sholter)
    Cc: Shashi Arja (sarja); Raji Sridar (raji)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    Thanks a lot Matt.  I will make the change and try again.  Does the URI
    is still the distributionlists :

    https://10.77.208.26/vmrest/distributionlists  With "s" here right?  I
    only need to pass in one distributionList, but not to include this
    distributionList inside <DistributionLists> tag, right?



    Thanks,

    Amy

    ________________________________

    From: Matthew Penning (mapennin)
    Sent: Wednesday, October 06, 2010 10:20 AM
    To: Amy Yang (amyyang); 'cdicuser@developer.cisco.com'; Anil Verma
    (anilve)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    In your XML that you post, it looks like you have <DistributionLists> in
    there, which is not correct.  That might be the problem - it should just
    be <DistributionList>



    ~ Matt



    From: Amy Yang (amyyang)
    Sent: Wednesday, October 06, 2010 10:17 AM
    To: cdicuser@developer.cisco.com; Anil Verma (anilve); Matthew Penning
    (mapennin)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf
    Importance: High



    Hi Matt and Anil,



    Could someone from CUPI team can look at my issue here.  I got data
    exception which complain the "Alias" is not in my input data.  My input
    data does contains the alias field.  I tied UC version 7.1.3 and 8.5
    versions.  I also tried changed the alias field from " turtle_1" to
    "turtle" just in case it does not like the "_1" at the end.  This issue
    is a showstopper to our feature to CUPM 8.5 release. We need your help,
    please.



    Thanks,

    Amy



    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 1:46 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf

    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Here is the update: I finally found a way to printout an
    EntityInputStream:

    <?xml version="1.0" encoding="UTF-8"
    standalone="yes"?><ErrorDetails><errors><code>DATA_EXCEPTION</code><mess
    age>Missing parameter
    label.distributionlist.alias</message></errors></ErrorDetails>

    It seems complain the "alias" is not set. But I did set it as
    <Alias>turtle_1</Alias>

    Please let me know is it an issue at CUPI or my input data is not
    correct.

    Thanks,
    Amy

    ________________________________

    From: Amy Yang (amyyang)
    Sent: Tuesday, October 05, 2010 1:14 PM
    To: 'cdicuser@developer.cisco.com'
    Cc: Subbu Chandrasekaran (csubrama)
    Subject: RE: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Hi Matt,

    I checked the header from the ClientResponse, it is set correctly. Here
    is the printout of header:

    {Set-Cookie=[JSESSIONIDSSO=417286726043AF09CC537FB63C77FF1E; Path=/;
    Secure, JSESSIONID=F6963826ABB6EC76C0473B84FFB4269B; Path=/vmrest;
    Secure], Content-Type=[application/xml], Transfer-Encoding=,
    Date=[Tue, 05 Oct 2010 17:42:56 GMT], Connection=, Server=[]}

    It seems to me the issue is in the xml date that I sent to UC. The
    input xml data to POST =

    <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>

    Do you see anything here not correct which cause error code 400?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Tuesday, October 05, 2010 9:56 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    Your suggestion seems resolve the error code 415. Now I got different
    error code 400:

    Status code = 400 The error message = Bad Request. The request could not
    be understand by the server due to incorrect syntax

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 7:09 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I'm not too familiar with the Jersey client side libraries, but
    "application/x-www-form-urlencoded" probably isn't what you want since
    this isn't a form post:



    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);



    Try changing that to "application/xml", I think that will help.



    ~ Matt





    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 6:11 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf



    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I have added the content-type as follows. I got the same error.

    WebResource webResource = client.resource(uri);
    Builder builder =
    webResource.type("application/x-www-form-urlencoded").accept(MediaType.A
    PPLICATION_XML_TYPE);
    ClientResponse restResponse = builder.post(ClientResponse.class,
    xmlData);

    Do you have an example for doing a "POST". I am trying to create a
    distributionList in UC.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Monday, October 04, 2010 11:55 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Amy Yang in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    Matthew Penning in Cisco Unity Connection Provisioning


    Amy Yang has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Matt,

    I could not find a correct syntax to set the content type? Any pointer
    on this?

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Sunday, October 03, 2010 9:45 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from Matthew Penning in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: Error code 415:
    Unsupported Media Type


    Matthew Penning has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Hi Amy - I see that you're setting the "Accept" header to
    "application/xml", but you may need to also set the "Content-Type"
    header to "application/xml".

    ~ Matt


    Hi,

    I am from CUPM team at Cisco. I am trying to create a DistrilbutionList
    in UC. I got error code 415. The error message is: "= Unsupported
    Media Type. The server is refusing to service the request because the
    entity of the request is in a format not supported by the requested
    resource for the requested method." Here is the code that I passed in
    the Post request. The input xmlDL to POST = <?xml version="1.0"
    encoding="UTF-8"
    standalone="yes"?><DistributionLists><DistributionList><Alias>turtle_1</
    Alias><DisplayName>Turtle
    One</DisplayName><IsPublic>true</IsPublic><Undeletable>false</Undeletabl
    e><DtmfAccessId>80001</DtmfAccessId><AllowContacts>false</AllowContacts>
    <AllowForeignMessage>false</AllowForeignMessage><PartitionObjectId>/vmre
    st/partitions/f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionObjectId><P
    artitionURI>f46a1105-1cfa-4be9-89eb-e43133add5f1</PartitionURI><Distribu
    tionListMembersURI></DistributionListMembersURI></DistributionList></Dis
    tributionLists>


    try{
    JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
    StringWriter writer = new StringWriter();
    Marshaller marshaller = ctx.createMarshaller();
    marshaller.marshal(dlsPojo, writer);
    String xmlDL = writer.toString();
    System.out.println("&&& XML DistributionList = " + xmlDL);
    ....

    try{
    //post a request
    ClientResponse restResponse =
    webResource.accept(MediaType.APPLICATION_XML_TYPE).post(ClientResponse.c
    lass, xmlDL);
    Status status = restResponse.getClientResponseStatus();
    code = status.getStatusCode();

    data = restResponse.getEntity(String.class);
    }catch (ClientHandlerException chx){

    ....


    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    1703>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    6652>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    7283>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    5657>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8621>
    or simply reply to this email.
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/260
    8962>
    or simply reply to this email.

    Subject: RE: New Message from David Wanagel in Cisco Unity Connection Provisioning I
    Replied by: Amy Yang on 06-10-2010 10:31:56 PM
    Thank Dave for your response.  Here is my code for marshalling the POJO:

      com.cisco.uc713.rest.dlist.ObjectFactory dlFactory = new
    com.cisco.uc713.rest.dlist.ObjectFactory();
      com.cisco.uc713.rest.dlist.DistributionList dlPojo =
    dlFactory.createDistributionList();
      populateDLPOJO (dlPojo, dlModel); //it gets all the values from
    dlModel (CUPM internal distributionList object) and sets them to dlPojo
      try{
       JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionList.clas
    s);
       StringWriter writer = new StringWriter();
       Marshaller marshaller = ctx.createMarshaller();
       marshaller.marshal(dlPojo, writer);

    It dies at last line of above code.  But if I change the code as below
    (highligh in pink), it marshal sucessful:

      com.cisco.uc713.rest.dlist.ObjectFactory dlFactory = new
    com.cisco.uc713.rest.dlist.ObjectFactory();
      com.cisco.uc713.rest.dlist.DistributionList dlPojo =
    dlFactory.createDistributionList();
      com.cisco.uc713.rest.dlist.DistributionLists dlsPojo =
    dlFactory.createDistributionLists();

      populateDLPOJO (dlPojo, dlModel);
      dlsPojo.getDistributionList().add(dlPojo);
     
    try{
       JAXBContext ctx =
    JAXBContext.newInstance(com.cisco.uc713.rest.dlist.DistributionLists.cla
    ss);
       StringWriter writer = new StringWriter();
       Marshaller marshaller = ctx.createMarshaller();
       marshaller.marshal(dlsPojo, writer);

    I don't understand why.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Wednesday, October 06, 2010 12:04 PM
    To: cdicuser@developer.cisco.com
    Subject: New Message from David Wanagel in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from Amy
    Yang in Cisco Unity Connection Provisioning Interf


    David Wanagel has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    Both DistributionList and DistributionLists are discrete objects and
    both can be marshalled or unmarhalled independently.  DistributionLists
    is used for a GET of the collection of all distribution lists (e.g.
    /vmrest/distributionlists).  In contrast a GET on a specific
    distribution list returns a DistributionList object (e.g. GET
    /vmrest/distributionlists/<object id>).  A PUT for a distribution list
    would use a JAXBElement<DistributionList> as created by the object
    factory and that marshals OK.

    We don't have your code here, so its hard to tell what you were trying
    to do at the time you got the exception, but as far as the XSD goes, it
    can be used as is.

    -Dave
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/261
    2946>
    or simply reply to this email.

    Subject: RE: New Message from David Wanagel in Cisco Unity Connection Provisioning I
    Replied by: Amy Yang on 07-10-2010 09:13:04 PM
    Hi Dave,

    The problem is not in marshalling data, but in device side.  When I POST
    the request to create a new Distribution List in Unity Connection
    device, if the Display Name string has space, it gave error last night.
    I figured out today, it is not the space that CUPI does not like.
    Actually, Display Name has to be unique in the system.  In my test last
    night, I only changed the alias but not the display name in my data.

    Thanks,
    Amy

    ________________________________

    From: Cisco Developer Community Forums
    [mailto:cdicuser@developer.cisco.com]
    Sent: Thursday, October 07, 2010 2:32 AM
    To: cdicuser@developer.cisco.com
    Subject: New Message from David Wanagel in Cisco Unity Connection
    Provisioning Interface (CUPI) - CUPI Questions: RE: New Message from
    David Wanagel in Cisco Unity Connection Provisioning I


    David Wanagel has created a new message in the forum "CUPI Questions":
    --------------------------------------------------------------
    I'm not sure why you are having trouble, the code below runs fine:


    public void testDl() {
    DistributionList dl = new DistributionList();
    dl.setDisplayName("foo");

    JAXBElement<DistributionList> j = new
    ObjectFactory().createDistributionList(dl);
    try {
    JAXBContext context =
    JAXBContext.newInstance("com.cisco.connection.xjc");       
    Marshaller marshaller = context.createMarshaller();

    marshaller.marshal(j, System.out);
    }
    catch (JAXBException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    }

    Console output below:



    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><DistributionList
    xmlns:ns2="http://www.cisco.com"><DisplayName>foo</DisplayName></Distrib
    utionList>
    --
    To respond to this post, please click the following link:
    <http://developer.cisco.com/web/cupi/forums/-/message_boards/message/261
    4125>
    or simply reply to this email.