• Send Attach to Web Service

    By Cristina Baraldi 7 years ago

    Hi,

    I have to develop a Web Service client with notes 7.

    Stubby is very usefull and from the wsdl I created all the java classes needed to call the service.

    But the web service developers told to me that the web service (developed with axis) need a file attached that is not one of the web service parameter.

    I find online the way to attach a file:

    String filePath="C:\Temp\DIP55304-AN-E-1.pdf.p7m";

    DataHandler dh = new DataHandler(new FileDataSource(filePath));

    _call.addAttachmentPart(part);



    I tried to insert the above code in the classes generated from stubby but it doesn't work. the message that I receive is:



    WebServiceEngineFault

    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException

    faultSubcode:

    faultString: java.lang.RuntimeException: No support for attachments

    faultActor:

    faultNode:

    faultDetail:



    java.lang.RuntimeException: No support for attachments

    at lotus.domino.axis.AxisFault.makeFault(Unknown Source)<br/>
    at lotus.domino.axis.client.Call.invoke(Unknown Source)<br/>
    at lotus.domino.axis.client.Call.invoke(Unknown Source)<br/>
    at lotus.domino.axis.client.Call.invoke(Unknown Source)<br/>
    at samples.attachments.EchoAttachmentsServiceSoapBindingStub.verificaP7M(EchoAttachmentsServiceSoapBindingStub.java:156)<br/>
    at JavaAgent.NotesMain(JavaAgent.java:55)<br/>
    at lotus.domino.AgentBase.runNotes(Unknown Source)<br/>
    at lotus.domino.NotesThread.run(Unknown Source)<br/>
    

    Caused by: java.lang.RuntimeException: No support for attachments

    at lotus.domino.axis.client.Call.setRequestMessage(Unknown Source)<br/>
    ... 7 more<br/>
    



    Could you help me?

    Thank in advance

    Cristina

    • Not much you can do

      By Julian Robichaux 7 years ago

      I'm afraid there's probably not much you can do there. If the base code has no support for attachments, then there's no support for attachments.



      You could always try using Axis as an external library and importing the classes in. See this article for an example:



      http://www.ibm.com/developerworks/lotus/library/domino-webservices/

      • Developer Works Article

        By Cristina Baraldi 7 years ago

        Thanks for the info.

        following the article I was able to create the Web Service Client.



        Ciao

        Cristina