[Date Prev] [Date Next] [Prev in Thread] [Next in Thread] [Date Index] [Thread Index]

passing attachments in via Web Service with Perl CGI



**

All,

Ok here’s another one that I’ve been looking at for a couple of days now.

I’ve got a Web Service/XML page that is setup to handle Attachments.

 

When Remedy built the XML page it set the Attachment Data element as type: XSD:Base64Binary

I have a Perl CGI script to consume the WebService.

I can get it to work when I’m not passing an attachment.

The problem is I can’t seem to get the Attachment Data converted to the correct Data Type.

 

I can get the file name and Size, just not the Data Type

I keep getting the error:

Fault :ERROR (8962): Unexpected element encountered in the input XML document; Faultcode :soapenv:Server.userException Faultdetail :hostname<SERVER NAME>

 

I’ve tried passing just the file,

The file handle,

Opening the File and reading all the lines into a buffer, and passing that.

I’ve tried to encode it:

open(FILE,$upload_filehandle) or die "$!";

   while (read(FILE, $buf, 60*57)) {

                $Attach_Data.= encode_base64($buf);

#             print encode_base64($buf);

   }

close(FILE);

 

and none of those have worked.

I’m starting to look at using the Pack function to convert it to a Binary Array,

But can’t quite figure out how to do that, yet.

 

Has anyone been able to setup a Perl CGI to consume a Web Service and pass an attachment through?

Any suggestions on how I can get the Perl CGI to convert that Attachment Data to the correct format?

 

Thanks in Advance

Matt P.

_attend WWRUG10 www.wwrug.com ARSlist: "Where the Answers Are"_