Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Invoke webserice with attachment

Avatar

Former Community Member

Hi,

I am strugling with simple scenario. I have two short-lived processes. One for document transformation, in this case, it will simply take document as input and as output string with basename of the input variable. One setValue step can handle this.

Than I have another process, that has document as input parameter and as the wsdl notes, it consists of base64 data and content type (this is what I get from outside livecycle app that will call this second process). I tried to construct the SOAP envelope with attachmentID and attachment as variable part0 with no luck. I also tried to fetch base64 data as string in there to see if I get it working, but no luck too.

The error I get is :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server.userException</faultcode>
         <faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
         <detail>
            <faultData>
               <ns1:exception xsi:nil="true" xmlns:ns1="http://adobe.com/idp/services"/>
               <ns2:message xmlns:ns2="http://adobe.com/idp/services">SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</ns2:message>
            </faultData>
            <ns3:hostname xmlns:ns3="http://xml.apache.org/axis/">D-Adobe</ns3:hostname>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

I am not sure if I should post pictures of one or two step process here. The idea is that external application will pass a document to process A, the process A will take that document and pass it to process B which will convert the file to PDF and returns that document to process A for furhter work.

Thanks for any advices.

J.

3 Replies

Avatar

Former Community Member

This is example of that SOAP envelope I have used:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://adobe.com/idp/services">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:invoke>
          <ser:dokument>
               <ser:contentType>             
                     plain/text         
                  </ser:contentType>                
               <ser:binaryData>              
                   dGVzdG92YWNpIHN0cmluZw==         
                  </ser:binaryData>              
          </ser:dokument>
     </ser:invoke>
   </soapenv:Body>
</soapenv:Envelope>

And if I dont get error, I get empty output value from process B.

With remoteURL parameter, it works fine:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://adobe.com/idp/services">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:invoke>
         <ser:dokument>
            <ser:remoteURL>http://help.adobe.com/en_US/livecycle/es/overview.pdf</ser:remoteURL>
         </ser:dokument>
      </ser:invoke>
   </soapenv:Body>
</soapenv:Envelope>

response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <invokeResponse xmlns="http://adobe.com/idp/services">
         <vysledky>overview.pdf</vysledky>
      </invokeResponse>
   </soapenv:Body>
</soapenv:Envelope>

Thanks

J.

Avatar

Level 4

Add '&blob=base64' (without the quotes) to your WDSL url.

Example: http://your:server:8080/soap/services/YOURSERVICE?WSDL&blob=base64.

I should work.

Avatar

Former Community Member

Hi,

thanks for the input. Problem was that the filename had to be passes as a separate variable. The file did get through the SOAP, however conversion didnt went through as there was no filename associated with the attachment (??? wierd, I know)

J