Skip to content

DocumentConversion media type not supported #119

@PromedDeveloper

Description

@PromedDeveloper

Hi,
I'm testing DocumentConversion API and I get the following exception:

nov 18, 2015 11:05:26 AM com.ibm.watson.developer_cloud.service.WatsonService execute
SEVERE: https://gateway.watsonplatform.net/document-conversion-experimental/api/v1/convert_document, status: 415, error: The media type is not supported
Exception in thread "main" com.ibm.watson.developer_cloud.service.UnsupportedException: The media type is not supported

Document is in Word format, it contains text, not images.
The java test code is the following:

service = new DocumentConversion();
service.setUsernameAndPassword(credentials.getUser(), credentials.getPassword());
File docfile = new File("/watson/input_docs/test/test2.doc");
String content = service.convertDocumentToHTML(docfile , "application/msword");

When I try same document using curl, it WORKS FINE (I have masked user/password):

curl -u "{user}":"{pasword}" -o "/cygdrive/c/watson/input_docs/test/test2.html" \
-F 'config={"conversion_target":"NORMALIZED_HTML"};type=application/json' \
-F file="@/cygdrive/c/watson/input_docs/test/test2.doc;type=application/msword" \
"https://gateway.watsonplatform.net/document-conversion-experimental/api/v1/convert_document"

Could you give me any advice on this?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions