cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in passing xstring data from abap to webservice method.

Former Member
0 Kudos

Hi,

I want to upload the document from ABAP to Microsoft SharePoint. So for that i have created the webservice in .net for uploading the document in SharePoint.

Now in Abap i have consumed this service by creating proxy class. The web service has one method as Upload_File which takes byte[] as paramerter, so in wsdl file this parameter get converted into s:base64Binary and in abap it get converted into RAWSTRING.

Now, when i try to upload the file with very small content (less than 54 character mean the rawstring variable which contain the file content has length less than 108 ), file gets uploaded with no problem, but when the file has content more than 54 character, it give error like "SOAP:1.032 SRT: Wrong Content-Type and empty HTTP-Body received"

And also one thing when i have created the proxy class it gives warning that "The XSD type base64Binary does not exactly correspond to the ABAP type RAWSTRING"

What can be the problem? how to pass file content to external web service?

Thanks,

Vikram

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

convert the string to binary using the utility class CL_ABAP_CONV_OUT_CE.

anton

bruno_esperanca
Contributor
0 Kudos

Hi Anton,

Thanks so much for this.

I'm looking into the class documentation however and it seems this doesn't exactly fit my requirement.

I'm expecting to receive a file (any format, for example .jpg or .pdf) through a webservice into SAP, and I want to store it in DMS just the same as I receive it. So I'm guessing I'm going to receive it in the RAWSTRING format and I want to convert it to binary format so that I can store it in the appserver through the regular OPEN DATASET statement.

If you could guide me through this it would be much appreciated!

Thanks!

Regards,

Bruno

Former Member
0 Kudos

Vikram,

I think this should be handled as SOAP attachment and the attachment content type will have to be binary.

But I don't know how to expose a .net service that accepts attachment as well as whether an ABAP proxy to consume such web service is possible or not.

Regards,

Vandana.

i807822
Advisor
Advisor
0 Kudos

Hi,

Try this:

The data type String with 0 length. Also check if the XSD attribute is equal to xsd:string.

This is theoretical.

Tell me if it works. Nick.

Edited by: Nick Archontis on Aug 20, 2008 5:01 PM

Former Member
0 Kudos

Hi Nick,

Yes, when i declare the data type as string in XSD it get converted into xsd:string.

I have already tried using String as parameter in WebService method instead of byte[].

But then in .Net, I need to write some code for converting the string variable ( which content the file content in hexadecimal format) into byte array and for that there is a method provided by .Net framework but when I use it, it write the hexadecimal content in file.

So I have written my own code for converting hexadecimal content which string variable content to byte array.

By doing this, it working fine and all type of file getting uploaded in SharePoint but when I try to open the file only .TXT file get open properly and other type of file give me some error.