Highlighted

Modify a WSDL generated by URL with specific one (no 'Element')

Avatar

Avatar

salvdangelo

Avatar

salvdangelo

salvdangelo

25-01-2018

Hi,

I have generated a WSDL from this URL https://<myserver>/nl/jsp/schemawsdl.jsp?schema=nms:rtEvent for the Message Center
After, I've imported the XML file in a SOAP UI proejct and modified pushEvent request in a semi-customized request.

I will have SOAP requestS written like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:nms:rtEvent">

   <soapenv:Header/>

   <soapenv:Body>

      <urn:PushEvent>

         <urn:sessiontoken>user/pwd</urn:sessiontoken>

         <urn:domEvent>

            <rtEvent type="nameEvent" email="name.surname@mail.com">

            <ctx>

                 <param1>stringField</param1>

                 <param2>intergerField</param2>

                 <param3>dateField</param3>

            </ctx>

            </rtEvent>

         </urn:domEvent>

      </urn:PushEvent>

   </soapenv:Body>

</soapenv:Envelope>

All the SOAP requests will be similar to this one, but each request will have a different number of parameters inside <ctx></ctx>

I was asked to modify the original WSDL (fragment below) since "Element" is too generic:

<s:complexType name="Element">

     <s:sequence>

          <s:any processContents="lax"/>

     </s:sequence>

</s:complexType>

<s:element name="PushEvent">

     <s:complexType>

          <s:sequence>

               <s:element name="sessiontoken" type="s:string" minOccurs="1" maxOccurs="1"/>

                    <s:element name="domEvent" type="tns:Element" minOccurs="1" maxOccurs="1"/>

          </s:sequence>

     </s:complexType>

</s:element>

How should I modify che initial WSDL properly?
Does it exist an automatic way to do this thing?

Thank you in advance!

Salvatore

Jean-Serge Biron

@nkur

Adhiyan

kirti.rawat

inactiveforumnotifier

Amy_Wong

Woojin

Debbie

Adobe Campaign

Replies

Highlighted

Avatar

Avatar

david_garcia1

MVP

Avatar

david_garcia1

MVP

david_garcia1
MVP

25-01-2018

I am not sure I completely understand what you are asking... do you want to pass some parameters through the ctx context?

            <ctx>

                 <param1>stringField</param1>

                 <param2>intergerField</param2>

                 <param3>dateField</param3>

            </ctx>

Highlighted

Avatar

Avatar

salvdangelo

Avatar

salvdangelo

salvdangelo

25-01-2018

Hi David,

Yes the technical team will pass some parameters put inside <ctx></ctx> depending on the particular delivery template.

Example:

<ctx>

     <firstName>Salvatore</firstName>

     <gender>male</gender>

     <birthdate>01/01/1990</birthdate>

</ctx>

The technical team told me that the AS need a WSDL more specific and "Element" cannot be accepted.

The actual WSDL is that one I got from the URL https://<myserver>/nl/jsp/schemawsdl.jsp?schema=nms:rtEvent

I need to customize the WSDL, but sincerely I do not know how.

S.

Highlighted

Avatar

Avatar

david_garcia1

MVP

Avatar

david_garcia1

MVP

david_garcia1
MVP

25-01-2018

First create an event type in the "eventType" itemized list which will be mapped against a transactional template.

1403281_pastedImage_3.png

Create a transactional template and under properties map the event type created, hence, when the SOAP call contains that particular event type, this transactional template will be triggered.

1403282_pastedImage_4.png

The soap call must contain the event type as below in order to pass the soap to the corresponding template mapped.

            <rtEvent type="welcome123" mobilePhone="111222333444" email="myemail@email.com" externalId="12345" origin="someIPhere">

<ctx>

  <firstName>DAVID GARCIA</firstName>

  <memberName>DAVID_MEMBER123</memberName>

</ctx>

            </rtEvent>

Then in the html content of the email you can pull the params passed through the ctx context accordingly;

Hello <%=rtEvent.ctx.firstName>

I don't think you need to modify the wsdl for this kind of purpose unless I don't understand the requirements.

Highlighted

Avatar

Avatar

salvdangelo

Avatar

salvdangelo

salvdangelo

25-01-2018

Everything you wrote was already clear, but it's not what I asked.

Highlighted

Avatar

Avatar

david_garcia1

MVP

Avatar

david_garcia1

MVP

david_garcia1
MVP

25-01-2018

You can define your own methods in the rtEvent schema extension

    <method library="gg:PushNotificationEvent" name="PushNotificationEvent" static="true">

      <help>Insert a PushNotificationEvent event</help>

      <parameters>

        <param desc="Event XML" inout="in" name="domEvent" type="DOMDocument"/>

        <param desc="Technical identifier of the inserted event" inout="out" name="id"

              type="string"/>

      </parameters>

    </method>

1403284_pastedImage_3.png

Then they will be generated in the wsdl

1403283_pastedImage_2.png

Highlighted

Avatar

Avatar

salvdangelo

Avatar

salvdangelo

salvdangelo

26-01-2018

Hi David,

Suppose that I have this 'PushEvent'

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:nms:rtEvent">

   <soapenv:Header/>

   <soapenv:Body>

      <urn:PushEvent>

         <urn:sessiontoken>user/pwd</urn:sessiontoken>

         <urn:domEvent>

            <rtEvent type="nameEvent" email="name.surname@mail.com">

            <ctx>

                 <param1>stringField</param1>

                 <param2>intergerField</param2>

                 <param3>dateField</param3>

                    ...

            </ctx>

            </rtEvent>

         </urn:domEvent>

      </urn:PushEvent>

   </soapenv:Body>

</soapenv:Envelope>

where the number of <paramX> may be different but everything else is equal,

How would you write the methods in the extension of nms:rtEvent ?

Example1 :

<ctx>

     <firstName>STRING_FIELD</firstName>

     <age>INTEGER_FIELD</age>

<ctx>

Example2 :

<ctx>

     <firstName>STRING_FIELD</firstName>

     <secondName>STRING_FIELD</secondName>

     <birthDate>DATETIME_FIELD</birthDate>

     <order>INTEGER_FIELD</order>

<ctx>

Thanks,

Salvatore

Highlighted

Avatar

Avatar

dattarays703613

Avatar

dattarays703613

dattarays703613

03-02-2018

rtEvent.PushEvent: Element is too generic (of type "ANY") as you mentioned. I think consuming systems might face problem as to what child to be created under the same, though they should simply be constructing required child element structure as string and then append it as child tag while sending it to campaign API. Nevertheless, PFB if helps -

In my view, one way to do this would be to add the child tags (manually modify the WSDL) as shown below:

Please note: you are not changing anything within Adobe Campaign, its just the WSDL file while sharing with consumers if required -

<?xml version="1.0" encoding="UTF-8"?>

<definitions targetNamespace="urn:nms:rtEvent" xmlns="http://schemas.xmlsoap.org/wsdl/"

xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:tns="urn:nms:rtEvent" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:rns="rbs">

<types><s:schema elementFormDefault="qualified" targetNamespace="urn:nms:rtEvent">

<s:import namespace="rbs"/>

<s:complexType name="Element">

<s:sequence><s:any processContents="lax"/>

<!-- new element -->

<s:element maxOccurs="1" minOccurs="1" name="rtEvent" type=  "rns:rtEventExt" />

</s:sequence></s:complexType>

<s:element name="PushEvent"><s:complexType><s:sequence><s:element maxOccurs="1" minOccurs="1" name="sessiontoken" type="s:string"/><s:element maxOccurs="1" minOccurs="1" name="domEvent" type="tns:Element"/></s:sequence></s:complexType></s:element><s:element name="PushEventResponse"><s:complexType><s:sequence><s:element maxOccurs="1" minOccurs="1" name="plId" type="s:long"/></s:sequence></s:complexType></s:element><s:element name="PushEvents"><s:complexType><s:sequence><s:element maxOccurs="1" minOccurs="1" name="sessiontoken" type="s:string"/><s:element

              maxOccurs="1" minOccurs="1" name="domEventCollection" type="tns:Element"/></s:sequence></s:complexType></s:element><s:element name="PushEventsResponse"><s:complexType><s:sequence><s:element maxOccurs="1" minOccurs="1" name="pdomIds" type="tns:Element"/></s:sequence></s:complexType></s:element></s:schema>

  <s:schema elementFormDefault="unqualified" targetNamespace="rbs">

<s:complexType name="rtEventExt" >

<s:sequence>

<s:element maxOccurs="1" minOccurs="1" name="ctx" type="rns:ctxAny" />

</s:sequence>

<s:attribute name="type" type="s:string" use="required"/>

<s:attribute name="wishedChannel" type="s:int" use="required"/>

<s:attribute name="email" type="s:string" use="optional"/>

<s:attribute name="mobilePhone" type="s:string"  use="optional"/>

</s:complexType>

<s:complexType name="ctxAny" >

<s:sequence>

<s:any processContents="lax"/>

</s:sequence>

</s:complexType>

</s:schema></types>

this could help consuming system while constructing required child tags under the Elements , example:

rtEvent_modified_Sample.JPG