|
#1
|
|||
|
|||
|
Hello,
I am using Docusign API 3.0 with Production account. I am facing a problem when I try to download the document. While debugging I found that the input stream ends (terminates) after it read 8745 bytes. Below is the code : Code:
public File downloadSignedDocument(String envelopeId, String path)
throws ServiceException
{
File f = null;
RequestPDF requestPdf = new RequestPDF();
requestPdf.setEnvelopeID(envelopeId);
try
{
RequestPDFResponse requestPDFResponse = wsApi.RequestPDF(requestPdf);
DataHandler dataHandler = requestPDFResponse.getRequestPDFResult().getPDFBytes();
File dir = new File(path);
FileUtils.forceMkdir(dir);
f = new File(dir, MiscUtil.generateTimeBasedUUID()+ ".pdf");
FileOutputStream out = new FileOutputStream(f);
IOUtils.copyLarge(dataHandler.getInputStream(),out,true);
out.close();
} catch (Exception e) {
e.printStackTrace();
throw new ServiceException("Failed to download pdf for envelopeId :" + envelopeId, e);
}
return f;
}
Thanks Swapnil |
|
#2
|
|||
|
|||
|
Hi Swapnil!
There is no such limitation on our service. Are you sure your client side config doesn't limit the size of the stream? Do you have axis config files or CXF config that you might be able to alter?
__________________
-- Mike Borozdin / DocuSign Professional Services |
|
#3
|
|||
|
|||
|
Mike,
This is the config file (axis2.xml) I am using : Code:
<?xml version="1.0" encoding="UTF-8"?> <axisconfig name="AxisJava2.0"> <module ref="addressing" /> <module ref="rampart" /> <parameter name="OutflowSecurity"> <action> <items>UsernameToken</items> <!-- Do not modify these values as they are replaced by the 'ant configure' command. --> <user>4b88101e-dbe9-4e12-bc33-f26ea637dc84</user> <passwordCallbackClass>net.docusign.wsclient.Authenticator</passwordCallbackClass> <passwordType>PasswordText</passwordType> </action> </parameter> <!-- ================================================= --> <!-- Message Receivers --> <!-- ================================================= --> <!--This is the Default Message Receiver for the system , if you want to have MessageReceivers for --> <!--all the other MEP implement it and add the correct entry to here , so that you can refer from--> <!--any operation --> <!--Note : You can override this for particular service by adding the same element with your requirement--> <messageReceivers> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" /> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" /> </messageReceivers> <!-- ================================================= --> <!-- Transport Outs --> <!-- ================================================= --> <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> <parameter name="Transfer-Encoding" locked="false"> chunked </parameter> </transportSender> <transportSender name="https" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> <parameter name="Transfer-Encoding" locked="false"> chunked </parameter> </transportSender> <phaseOrder type="InFlow"> <!-- System predefined phases --> <phase name="Transport"> <handler name="RequestURIBasedDispatcher" class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"> <order phase="Transport" /> </handler> <handler name="SOAPActionBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"> <order phase="Transport" /> </handler> </phase> <phase name="Addressing"> <handler name="AddressingBasedDispatcher" class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"> <order phase="Addressing" /> </handler> </phase> <phase name="Security" /> <phase name="PreDispatch" /> <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"> <handler name="RequestURIBasedDispatcher" class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher" /> <handler name="SOAPActionBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher" /> <handler name="RequestURIOperationDispatcher" class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher" /> <handler name="SOAPMessageBodyBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher" /> <handler name="HTTPLocationBasedDispatcher" class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher" /> <handler name="GenericProviderDispatcher" class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher" /> <handler name="MustUnderstandValidationDispatcher" class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher" /> </phase> <phase name="RMPhase" /> <!-- System predefined phases --> <!-- After Postdispatch phase module author or service author can add any phase he want --> <phase name="OperationInPhase"> <handler name="MustUnderstandChecker" class="org.apache.axis2.jaxws.dispatchers.MustUnderstandChecker"> <order phase="OperationInPhase" /> </handler> </phase> <phase name="soapmonitorPhase" /> </phaseOrder> <phaseOrder type="OutFlow"> <!-- user can add his own phases to this area --> <phase name="soapmonitorPhase" /> <phase name="OperationOutPhase" /> <!--system predefined phase--> <!--these phase will run irrespective of the service--> <phase name="RMPhase" /> <phase name="PolicyDetermination" /> <phase name="MessageOut" /> <phase name="Security" /> </phaseOrder> <phaseOrder type="InFaultFlow"> <phase name="Addressing"> <handler name="AddressingBasedDispatcher" class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"> <order phase="Addressing" /> </handler> </phase> <phase name="Security" /> <phase name="PreDispatch" /> <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"> <handler name="RequestURIBasedDispatcher" class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher" /> <handler name="SOAPActionBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher" /> <handler name="RequestURIOperationDispatcher" class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher" /> <handler name="SOAPMessageBodyBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher" /> <handler name="HTTPLocationBasedDispatcher" class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher" /> <handler name="GenericProviderDispatcher" class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher" /> <handler name="MustUnderstandValidationDispatcher" class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher" /> </phase> <phase name="RMPhase" /> <!-- user can add his own phases to this area --> <phase name="OperationInFaultPhase" /> <phase name="soapmonitorPhase" /> </phaseOrder> <phaseOrder type="OutFaultFlow"> <!-- user can add his own phases to this area --> <phase name="soapmonitorPhase" /> <phase name="OperationOutFaultPhase" /> <phase name="RMPhase" /> <phase name="PolicyDetermination" /> <phase name="MessageOut" /> <phase name="Security" /> </phaseOrder> </axisconfig> |
|
#4
|
|||
|
|||
|
Hi there! I looked around the web and I have not seen a way to set the response size... that setting is available in WCF (.NET) but of course that doesn't help right now.
There is another issue that could be affecting your situation. Are you behind some sophisticated firewall like F5? That can terminate your stream. -mb
__________________
-- Mike Borozdin / DocuSign Professional Services |
|
#5
|
|||
|
|||
|
Hello Mike,
I am not using any firewall while testing this. BTW, let me give you more details. I used axis2-1.4.1 to generate java proxy. While creating java proxy from the WSDL, I had selected "Generate a synchronous client". Is this okay? Thanks Swapnil |
|
#6
|
|||
|
|||
|
Hi!
I think this calls for a live debugging session. Why don't you contact your account manager and we will set up some live debugging. Thanks!
__________________
-- Mike Borozdin / DocuSign Professional Services |
![]() |
| Thread Tools | |
| Display Modes | |
|
|