4 Replies Latest reply: Feb 9, 2011 10:02 AM by irgei RSS

    Webservice: method GET to WSDL url is OK - DocumentError: HTTP 405 on method PUT

    irgei

      Hi Folks

       

      I just installed the "LiveCycle ES" Trial  VMWare-image for ESX-Server (which uses JBoss) and tried to call the  ReaderExtensionsServiceClient webservice using the java sample and  always get this exception:

      ...

      Caused by: com.adobe.idp.DocumentError: 405: HTTP method PUT is not supported by this URL

      ...

       

      I sticked to the adobe webservice client sample as shown in the source below. The sniplet does not show the real IP address.

      The WSDL-url works fine for GET in the browser: http://server-ip-address:8080/soap/services/ReaderExtensionsService?wsdl&lc_version=9.0.0

      The  services are all activated in the Trial VMWare-image. I did not import  ReaderExtensions credentials, as I was unable to find the view for this  in the AdminUI, but the Trial VMWare-image should have some  ReaderExtensions credentials preinstalled.

       

      Any hints welcome what to change to get this working.

      best regards

      irgei

       

       

        Properties connectionProps = new Properties();
         connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAUL T_SOAP_ENDPOINT, "http://server-ip-address:8080");
         connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSP ORT_PROTOCOL,
            ServiceClientFactoryProperties.DSC_SOAP_PROTOCOL);
         connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER _TYPE,
            ServiceClientFactoryProperties.DSC_JBOSS_SERVER_TYPE);
         connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDEN TIAL_USERNAME, "Administrator");
         connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDEN TIAL_PASSWORD, "password");

         UsageRights usageRights = new UsageRights();
         usageRights.setEnabledComments(true);
                
         ReaderExtensionsOptionSpec options = new ReaderExtensionsOptionSpec(usageRights, "my usage rights message");


         ServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);
          ReaderExtensionsServiceClient service = new ReaderExtensionsServiceClient(factory);
         Document inDocument = new Document(new File(testBaseDir, "test-input.pdf"), false);

         Document rightsApplied = service.applyUsageRights(inDocument, "", "", options);
         rightsApplied.copyToFile(new File(testBaseDir, "test-output.pdf"));

        • 1. Re: Webservice: method GET to WSDL url is OK - DocumentError: HTTP 405 on method PUT
          Hodmi techies

          Okay, there's a lot going on in your post, let's try to break it down:

           

          1 - You NEED a Reader Extensions credential.  With out a valid credential you will not be able to RE any documents

           

          2 - To do a quick test to see if Reader Extensions is up and running, start with the built in verification sample:

          http://{yourServer}:{port}/ReaderExtensions/  for example

          http://localhost:8080/ReaderExtensions/

           

          Login using administrator/password

          If you can convert using that tool, then at least we know Reader Extensions is working properly

           

          3 - You need to pass in the RE credential's alias as a parameter to the web service call.  I belive that this is the second parameter for the applyUsageRights method call

           

           

          You may want to have a look at the examples that are provided in the Quick Start Guides:

          http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=000299.html

          • 2. Re: Webservice: method GET to WSDL url is OK - DocumentError: HTTP 405 on method PUT
            irgei Community Member

            Hello Hodmi

             

            Many thanks for the password hint. It is unbelievable. I had mixed up the text files after uncompressing the zip files...

             

            The browser based ReaderExtensions are working fine at http://{yourServer}:{port}/ReaderExtensions/

            The processed PDFs support commenting also with Adome Reader Verison 8.

             

            I applied the suggested changes to the webservice client sourcecode:

              Document rightsApplied = service.applyUsageRights(

                      inDocument, "SAMPLEREADEREXTENSIONSCREDENTIAL" , "vHcZIJ9Pt?", options);

             

            The request still results in a HTTP 405: HTTP method PUT is not supported by this URL

             

            Might it this be due to the MTOM / Base64 / etc. settings ?

             

            I recorded the HTTP request in Wireshark:

            PUT /soap/services/ReaderExtensionsService/dsc/upload?serviceName=ReaderExtensionsService&ret urnContext=true HTTP/1.1
            Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==
            User-Agent: Java/1.5.0_22
            Host: server-ip-address:8080
            Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
            Connection: keep-alive
            Content-Length: 85886

             

            thanks for your effort

            irgei

            • 3. Re: Webservice: method GET to WSDL url is OK - DocumentError: HTTP 405 on method PUT
              Hodmi techies

              The HTTP Put error is a little odd.  I've always thought the web service calls used HTTP Post or Get.

               

              Having said that:

               

              How are you passing your PDF to LiveCycle?  As you say, LiveCycle will take the binary file in various formats including MTOM, base64 and a few others.  You have to "tell" LiveCycle what method you are using however.  This is done by appending a blob parameter to the end of the request URL.

               

              For example if you are going to send your PDF as a base64 encoded string, you append: ?blob=base64 to the service URL.  Then you would read the binary object into the blob's setBinaryData method.

               

              If you are using MIME/DIME or MTOM then you need to set the attachment and then pass its reference to the blob object.

               

              If you set nothing, then LiveCycle assumes that you are passing the file by reference.  In that case you are not actually passing the document, but you are setting the blob object with the URL of the document.  Similarly, LiveCycle will return a URL to the Reader Extended document.

               

              I wrote an article on calling LiveCycle using Java and SOAP a while ago.  It doesn't include MTOM (older versions of LC didn't support it), but the general idea is the same.

              • 4. Re: Webservice: method GET to WSDL url is OK - DocumentError: HTTP 405 on method PUT
                irgei Community Member

                Hmmm !

                 

                I can't tell what made the difference, but my webservice client (adobe sample) is now sending HTTP POST-requests.

                everything is working fine.

                 

                thanks for all the effort!