cancel
Showing results for 
Search instead for 
Did you mean: 

Issue to get conent vlaue in java mapping

12-19-2019 12:42 PM
Binod_Thakur Participant
1125 views 5 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi All,

I am uplaoding the file to vendor system through SoapUI, after opening the uploadByteArrayFile method it has three values to pass

1. FileName -> I can read file name dynamically and pass it

2. Content ->every time when i import wsdl in sopaui new content vlaue is coming, this value is always gettign changed,

3. Destination ->it's user id, so no issue

I have issue for content value, ohter two i can handle in java mapping, how can i get content value from java code so that i can pass it.content-issue.png

Please help me to get the content value ?

i am not sure, might be need to call the wsdl url or somting.

Regards,

Binod

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor
0 Likes

Hi!

As far as I could understand your requirement, you should get byte array from your source file and convert it to Base64-encoded string.

Regards, Evgeniy.

Binod_Thakur
Participant
0 Likes

Thanks Evgeniy,

I saw yout ocmment on one of the thread, there same logic you had implemented, get byte array from source file and convert it to Base64-encoded, but i didn't try this.

My issue got resolved, after seeing the content value carefully i got to know every time it contains 12 digits no starting with "cid:" like cid:<12 digits no>.

So I tried creating random no which contians 12 digits and pass it to content value dynamically and it worked as expected.

But let me try your logic and will update on this.

Thanks

former_member190293
Active Contributor
0 Likes

Hi Binod!

If you're talking about testing with SOAP UI after re-importing WSDL definition, value like "cid:*" is used by deafult as template value for "xsd:base64Binary" data type. In real scenarios such elements usually contain binary or Base64-encoded data.

Regards, Evgeniy.

Binod_Thakur
Participant
0 Likes

    Hi Evgeniy,

    It's working in this way as well, fileobject ->byte array ->convert to base64 and pass this value to content field.

    I used import java.util.Base64; code got compiled successfully, but when i import jar file in ESR then it's throwing error

    NoClassDefFoundError: java/util/Base64, MappingClassNotFoundException: java/util/Base64.class

    don't know why, i used jre1.8 for compilation and PO is 7.4 single stack and using jdk 1.6

    Regards,

    Binod

    Binod_Thakur
    Participant
    0 Likes

    Hi Evgeniy,

    Thanks for your help, it's working now as expected.

    Same code i tried with java 6 in NWDS and imported it in ESR message got sent successfully.

    I am closing the thread now.

    Regards,

    Binod

    Answers (0)