i am trying to upload image files(jpg, png, etc..) to SharePoint 2013 from an java applet via SOAP(http://msdn.microsoft.com/en-us/library/copy.copy.copyintoitems%28v=office.12%29.aspx), but i am alway getting the same exception:

 Exception in thread "main" javax.xml.ws.WebServiceException: class com.microsoft.schemas.sharepoint.soap.CopyIntoItemsResponse do not have a property of the name return


public class SharePoint {

public static void main(String[] args) throws IOException {
    CopySoap temp = getPort("username", "password");

public static CopySoap getPort(String username,String password){
    Copy service = new Copy();
    CopySoap port = service.getCopySoap();

    BindingProvider bp = (BindingProvider)port;
    bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
    bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://example.sharepoint.com/sites/dev/_vti_bin/copy.asmx");

    return port;

public static void CreateDocument(CopySoap port) throws IOException {
    String url = "https://example.sharepoint.com/sites/dev/SiteAssets/test.jpg";
    String sourceUrl = "http://media-cache-ec0.pinimg.com/736x/1c/c3/4e/1cc34e4e0aaeff76484b3ae963bfc701.jpg";//<-- for example

    DestinationUrlCollection urls = new DestinationUrlCollection();

    URL Iurl = new URL(sourceUrl);
    Image image = ImageIO.read(Iurl);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ImageIO.write((RenderedImage) image, "jpg", baos);
    byte[] content = baos.toByteArray();

    FieldInformation titelInfo = new FieldInformation();
    titelInfo.setValue("test img");

    FieldInformationCollection infos = new FieldInformationCollection();

    CopyResultCollection results = new CopyResultCollection();

    Holder<CopyResultCollection> resultHolder = new Holder<CopyResultCollection>(results);
    Holder<Long> longHolder = new Holder<Long>(new Long(-1));




I have already taken a look at this: How can I upload a file to a Sharepoint Document Library through SOAP web services using Java? , but it throws the same exception.

1 Answer 1


The Solution can be found here: In this article Joe Chandler explains exactly how to consume the SharePoint SOAP api through Java, if you can't get your code to work you maybe want to take a look at this.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.