Hello,
I’m trying to consume my ServiceStack web services from Eclipse using the ‘Add ServiceStack Reference’ plugin and I’m getting an exception telling me that doOutput needs to be set to true when trying to post a DTO to my server. Here are the steps I did:
- Create a new .Net project using ServiceStackVS as explained in Creating your first project
- I left the generated code as-is except that I changed the Hello request to be a POST
- Download Eclipse 4.4 (luna) and install Maven and the ServiceStack plugin
- Create a new Maven project and use the ‘Add ServiceStack Reference’ consume the service created above
- Add a Java class with a main method that does the following:
- Create an instance dto.Hello with a name
- Create an instance of JsonServiceClient
- POST the Hello request using the instance of JsonServiceClient (e.g.: client.post(helloRequest))
I’m getting an exception telling me that I need to set doOutput to true on HttpUrlConnection. I tried the above steps inside Android Studio and it works so I’m wondering what I did wrong in Eclipse. Can you tell me what I did wrong?
Side note: do you have any sample code/project (Java) where a webservice has been consumed? I would like to compare my Eclipse project to a working project.
Thanks!