Question

3
Replies
239
Views
CONBM Member since 2011 11 posts
PEGA
Posted: 5 years ago
Last activity: 5 years 3 months ago
Closed
Solved

Why is only one element allowed in a SOAP header?

Pega 7.1.7

I have a customer who is providing a SOAP service for my Pega application to connect to, so I am creating a SOAP Connector for my Pega application to connect with.

The customer';s SOAP service requires basic authentication - I must have a SOAP header called AuthenticationInfo, and in this I require two elements called username and password. This is what the customer's service requires from me:

<soapenv:Header>

<ns1:AuthenticationInfo xmlns:ns1="urn:IntegrationRequestR8A">

<ns1:username>Pega7Account</ns1:username>

<ns1:password>opensesame</ns1:password>

</ns1:AuthenticationInfo>

</soapenv:Header>

Problem is, no matter how I construct the xml stream rule that generates the message, the SOAP header created and sent by the Pega7 system only contains ONE element, and it is always the first element of the header irrespective of what that element might be.

For example, my xml stream rule for the soap header is called CreateOneTMAuthentication . MapFrom, abd in the XML tab I have unchecked the 'Auto-generated XML' box and manually entered the following piece of xml:

<ns1:AuthenticationInfo xmlns:ns1="urn:IntegrationRequestR8A">

<ns1:userName>Pega7Account</ns1:userName>

<ns1:password>opensesame</ns1:password>

</ns1:AuthenticationInfo>

And this is what I receive in SoapUI when testing the Connector using a mockService:

<soapenv:Header>

<ns1:AuthenticationInfo xmlns:ns1="urn:IntegrationRequestR8A">

<ns1:username>Pega7Account</ns1:username>

</ns1:AuthenticationInfo>

</soapenv:Header>

Notice that only the username was sent. The connector fails to connect to the customer's system with an authentication failure, due to no password.

Even more strangely, even if the first element is only a comment, then that comment is all that will get sent. For example my XML stream rule contains the following:

<ns1:AuthenticationInfo xmlns:ns1="urn:IntegrationRequestR8A">

<!-- You cannot be serious -->

<ns1:userName>Pega7Account</ns1:userName>

<ns1:password>opensesame</ns1:password>

</ns1:AuthenticationInfo>

And this is what I receive in SoapUI when testing the Connector using a mockService:

<soapenv:Header>

<ns1:AuthenticationInfo xmlns:ns1="urn:IntegrationRequestR8A">

<!-- You cannot be serious -->

</ns1:AuthenticationInfo>

</soapenv:Header>

I have tried all permutations I can think of with regard to the Connector configuration and the XML stream rule configuration, and no matter what I try I only ever get one element in a soap header. And that is no good, I need both username and password.

Does anyone have any suggestions? This is a blocker.

Thanks and regards

***Updated by moderator: Marissa to close post***

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Data Integration
Moderation Team has archived post
Share this page LinkedIn