New post

Find

Discussion (4)1
Log in or sign up to continue
Question
· Jun 11

Base64Encode adding to SOAP Request

I am having a hard time trying to figure out the following...

Within a DTC, I was able to take the a EnsLib.HL7.Message source and using

set a= $System.Encryption.Base64Encode(source.RawContent)
set encodedMessage=$Get(a)

to take the HL7 message encode it and add it to the Data Class as a string to be sent to an Operation to be sent out as a SOAP Request. 

However to make it more universal I tried doing this within a copy of EnsLib.HL7.SOAPOperation

Method SendMessage(pMsgOut As EnsLib.HL7.Message, Output pMsgIn As EnsLib.HL7.Message, pExpectedSequenceNumber As %String) As %Status
{
 Set tSourceId=$Piece(pMsgOut.Source,$C(13))
  set CBORDRequest = ##class(osuwmc.Nutrition.OSU.CBOARDNetMenuRequest.SendMessageRequest).%New()
  set a = $SYSTEM.Encryption.Base64Encode((pMsgOut.RawContent))
  set CBORDRequest.key = ..APIKey
  set CBORDRequest.encodedMessage = $Get(a).....

I keep getting the following message from the SOAP response 

ERROR #6248: SOAP response is a SOAP fault: <Fault><Code><Value>S:Receiver</Value></Code><Reason><Text xml:lang="en">Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value</Text></Reason></Fault>

When I enable ^ISCSOAP, I am seeing the following...

<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://www.w3.org/2003/05/soap-envelope' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'>
  <SOAP-ENV:Body><SendMessage xmlns="http://www.cbord.com/msg/"><key xsi:type="s:string">"15307151340368691768"</key><encodedMessage xsi:type="s:string">16@osuwmc.Nutrition.OSU.CBOARDNetMenuRequest.SendMessageRequest</encodedMessage></SendMessage></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Could someone explain what I might be doing wrong?
 

3 Comments
Discussion (4)2
Log in or sign up to continue
Digest
· Jun 11

InterSystems Community Q&A Monthly Newsletter #49

Top new questions
Can you answer these questions?
#InterSystems IRIS
SQL Query returns with OFFSET
By Fabio Care
Take subroutines from the Deployed Mode Routine
By Ashok Kumar T
Create Python pages
By Nezla
Prompt Engineering for ollama-ai-iris
By Oliver Wilms
How can I configure InterSystems ObjectScript Source Control with a client-side workspace in VS Code?
By Ricardo Alves dos Santos
Error Handling Server to Client Side - Best Practices
By Michael Davidovich
Task manager in async mirror behavior
By Yaron Munz
%JSON.Adaptor compilation issues under array-of-streams and computed property types
By Geoffrey Lu
Duvidas sobre o uso de JWT
By Guilherme Silva
Production Validator - Case Study
By Satya Prasad Kalam
EnsLib.File.CSVService
By Saju Abraham
How to override the port used on a SOAP operation
By Ryan Hulslander
Cannot open file '/ensemble/TEST/iris.cpf_.... when trying to create a Database/Namespace
By Scott Roth
Multiselction Zen component
By Nezla
Question about database defragmentation (several TB database)
By Norman W. Freeman
Subscript indirection behaves differently in if statement
By Ashok Kumar T
%Stream files do not get purged from the /stream/ folder on the system disk
By Martin Nielsen
Poor database write performance
By Norman W. Freeman
Yet Another Performance Puzzle
By Alexey Maslov
Shared code execution speed
By Anna Golitsyna
Append a string in a update query
By Jude Mukkadayil
#Ensemble
#Health Connect
#InterSystems IRIS for Health
#HealthShare
#49Monthly Q&A fromInterSystems Developers
Discussion (0)1
Log in or sign up to continue
Announcement
· Jun 11

[Video] SMART on FHIR: Application Setup

Hey Community,

Enjoy the new video on InterSystems Developers YouTube:

⏯ SMART on FHIR: Application Setup

From this video, you'll learn the final setup step for configuring an application by editing specific files in a code editor (e.g., VS Code) to align with the previously configured servers.

🗣  Presenter@Tani Frankel, Sales Engineer Manager, InterSystems

Check out the related article: SMART on FHIR app - Sample with Hands-on Exercise/Workshop Instructions

Enjoy watching, and look for more videos! 👍

1 Comment
Discussion (1)2
Log in or sign up to continue