facebook

Web Service Client Wizard Error

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #282489 Reply

    Daniel Ray
    Member

    I implemented a web service that takes an org.codehaus.xfire.attachments.Attachment as a parameter. I used the web service explorer to view this web service and all seemed well, but I couldn’t test this method because I see no way of attaching a file through the explorer.

    I decided to use the web service client wizard so that I could attach a file and test with, but ran into a problem when generating the code. Any thoughts of wisdom?

    src-resolve. 4.2: Error resolving component ‘ns1:Attachment’. It was detected that ‘ns1:Attachment’ is in namespace ‘http://attachments.xfire.codehaus.org’, but components from this namespace are not referenceable from schema.

    My web service method is a snippet I found on another post in these forums.

    
    public String testAttachment(Attachment file) {
            try {
                MessageContext ctx = AbstractInvoker.getContext();
                AttachmentUtil util = new AttachmentUtil();
                Attachment attachment = util.getAttachment(file.getId(), ctx
                        .getInMessage());
                DataHandler handler = attachment.getDataHandler();
                InputStream input = handler.getInputStream();
                // read the attachment from the input...
                return "Found " + input.available() + " bytes.";
            } catch (Exception ex) {
                return ex.getMessage();
            }
        }
    

    MyEclipse Enterprise Workbench

    Version: 6.0.1 GA
    Build id: 6.0.1-GA-200710

    #282494 Reply

    Daniel Ray
    Member

    Just an FYI. I can pass a byte[] instead of an Attachment and all seems to work just fine.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Web Service Client Wizard Error

You must be logged in to post in the forum log in