PureConnect

 View Only
Discussion Thread View
  • 1.  Help with formatting XML in Handler SOAP request

    Posted 10-10-2019 10:58
    Hi everyone, 

    I am having a massive problem with what seems to be a very simple issue :(

    I need to be able to format this SOAP Request in a handler.
    <?xml version="1.0"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v2="https://pathtoservice">
       <soapenv:Body>
            <v2:GetAuthentication>
                   <v2:mobileNumber>Any number</v2:mobileNumber>
                   <v2:textPrompt>Any text</v2:textPrompt>
             </v2:GetAuthentication>
      </soapenv:Body>
    </soapenv:Envelope>

    I am using the following tool steps in this order:
    SOAP Create Envelope - >SOAP Add RPC Parameter ->SOAP Add RPC Parameter - >SOAP HTTP Request Ex3

    According to what I am seeing in the logs the "v2" is not being added in front of the RPC Method Name  (GetAuthentication).

    Can any of you share with me a simple SOAP Handler that actually works?  

    The documentation provides no examples of what should go where I just don't know what to do. Any pointers are most welcome.
    #Handlers

    ------------------------------
    Egill Palsson
    Advania AB
    ------------------------------


  • 2.  RE: Help with formatting XML in Handler SOAP request

    Posted 10-11-2019 01:58
    Hi Egill,

    did you add the prefix (v2) to th parameter name? Example:  v2:mobileNumber

    ------------------------------
    ---------------------------------------------
    Hans-Gerd Sandhagen
    Software Developer
    Fiebig GmbH
    ---------------------------------------------
    ------------------------------



  • 3.  RE: Help with formatting XML in Handler SOAP request

    Posted 10-11-2019 03:13

    Hi Egill,

    I think you can make use "XML Create Document" node.

    Thanks.



    ------------------------------
    Venkoba Adeshappa
    Philips Electronics North America
    ------------------------------



  • 4.  RE: Help with formatting XML in Handler SOAP request
    Best Answer

    Posted 10-11-2019 04:37
    Hi everyone,

    as far as you create a SOAP reuest with simple parameter values (number, string,...) only, it should be possible with the SOAP-Tools, but I agree Venkoba,  that you could also use XML tools to create the request and if you need complex type as parameter values, this is only possible with XML tools:

    - Use "XML Create Document" to define your XML and the selection namespaces.
    - Use "XML Select Single Node Set Value" to select each parameter node (by XPath pattern) and set the value.
    - Use "SOAP HTTP Request Ex3" and set your XML document as "Request Envelop" parameter.
    - Use "XML Select Single Node" to get the values from the "Response Envelope"

    You should note some things:
    - Add encoding="utf-8" to your XML line: Example: <?xml version="1.0" encoding="utf-8"?>. Otherwise the server may reject your request due to incorrect content type.
    - Check "Retrieve Value" in input of "XML Select Single Node". Otherwise to output parameter "Node Value" will not be filled.
    - If you have problems with selecting the right nodes from XML document or response envelope, have a look at the description of "Selection Namespaces" in the documentation of the "XML Set Document Property" tool.

    ------------------------------
    ---------------------------------------------
    Hans-Gerd Sandhagen
    Software Developer
    Fiebig GmbH
    ---------------------------------------------
    ------------------------------



  • 5.  RE: Help with formatting XML in Handler SOAP request

    Posted 10-14-2019 09:51

    Wow! if only had known, or even thought of using XML before!!. 

    I just managed to solve the envelope issue in 10 minutes using your recommendation Hans-Gerd :)  Thanks!

    Then immediately I got the next problem :( Again it works perfectly if I take the same envelope and run it through SOAPui, but through Handlers, with exactly the same envelope and SOAP action return an error :(  I understand if you don't have all the answers, but you got to try right :)

    ********************************The error from the IP log***************************************

    SOAPHTTPRequestEx_Internal2 : An error occurred during execution:
    Exception: ResultCode = 5, ErrorCode = 0x0x80040524, Description = "Invalid Content type of the response! Only 'text/xml' or 'application/xml' supported.", Source = ""
    HTTPStatusCode: 404
    HTTPStatusText: Not Found
    ResponseHeaders:
    Content-Type: text/html
    Server: Microsoft-IIS/8.5
    X-Powered-By: ASP.NET
    X-OneAgent-JS-Injection: true
    X-ruxit-JS-Agent: true



    ------------------------------
    Egill Palsson
    Advania AB
    ------------------------------



  • 6.  RE: Help with formatting XML in Handler SOAP request

    Posted 10-15-2019 03:27

    It seems, that answers with 404, Not found. This is the reason for the Exception because the response is not XML.

    You could check the "Raw Response Body" from "SOAP HTTP Request Ex3" to see, which body is retured by the web server.

    ------------------------------
    ---------------------------------------------
    Hans-Gerd Sandhagen
    Software Developer
    Fiebig GmbH
    ---------------------------------------------
    ------------------------------



  • 7.  RE: Help with formatting XML in Handler SOAP request

    Posted 10-16-2019 10:29
    Thanks everyone for your generous help, using XML is the way to go here, it is sooooo much easier.

    In the end my problems were solved, I was still having problems with the "SOAP Action" even if the Envelope was correct.

    So I dove into the wsdl to look for possible ways, and I ended up using the whole URL to the action, instead of just the name of the action, which has worked before :)  But I guess things change :)


    ------------------------------
    Egill Palsson
    Advania AB
    ------------------------------



  • 8.  RE: Help with formatting XML in Handler SOAP request

    Posted 10-11-2019 10:31
    Egill,

    A while back my company had PSO do some SOAP request work for us. They didn't use the SOAP tools and instead manually entered the SOAP body into a string. I've done this multiple times in the past and it has worked great every time. Create an Assignment step and just copy and paste your string into the assignment step. As an added bonus the tool step will add the \r\n and the spaces. You will get a message about can only paste so much into the assignment step, just click the no button and press Ctrl+v again and again until everything is pasted in. Also remember you will need to escape the double quotes with a backslash.

    Thanks,

    ------------------------------
    Mark Tatera
    ConvergeOne

    Opinions are my own and not the views of my employer. Any suggestions or programming changes I suggest come with no warranty and should be tried at your own risk. If my comment helped you or solved your problem please consider marking my comment as best answer.
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources