How to do ServiceCallout with Soap service?

Not applicable

Hi,

Now i call one proxy and with the response i need call at one SOAP service.

With other cases i used service callout but only with rest service. is posible to do the same with one soap service and how to do it.

With REST service it is my callout but with SOAP service i dont know how to do this.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="ServiceCalloutTest">
    <DisplayName>ServiceCalloutTest</DisplayName>
    <Properties/>
    <Request clearPayload="true" variable="myRequest">
        <Set>
            <Headers>
                <Header name="Content-Type">application/json</Header>
                <Header name="Authorization">Basic YasddsasdFFASDFGsdsaw==</Header>
            </Headers>
            <Verb>POST</Verb>
            <Payload contentType="application/json">
                {
                    "Name": {
                      "Language": "ES",
                      "ID": "{responseDataService1}"
                         }
                }
            </Payload>
        </Set>
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    </Request>
    <Response>calloutResponse</Response>
    <HTTPTargetConnection>
        <Properties/>
        <URL>http://300.51.25.10:8000/service1</URL>
    </HTTPTargetConnection>
</ServiceCallout>

Thanks

Solved Solved
0 3 905
1 ACCEPTED SOLUTION

sidd-harth
Participant V

Hi @Josh iQu , we can use Service Callout policy to make a SOAP call. Check the sample code below,

    <Set>
        <Headers>
            <Header name="Content-Type">text/xml; charset=utf-8</Header>
        </Headers>
        <Payload contentType="text/xml">
            <s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
                <s11:Body>
                    <ns1:GetInfo xmlns:ns1="http://tempuri.org/">
                        <!-- optional -->
                        <ns1:Request>
                            <!-- optional -->
                            <ns1:Login>{Login}</ns1:Login>
                            <!-- optional -->
                            <ns1:TokenList>
                                <ns1:string>{string}</ns1:string>
                            </ns1:TokenList>
                        </ns1:Request>
                    </ns1:GetMultipleProposalInfo>
                </s11:Body>
            </s11:Envelope>
        </Payload>
        <Verb>POST</Verb>
    </Set>

So once you get the response, use Extract policy to get the details & added then in you Payload where were applicable.

In HTTPTargetConnection give the SOAP Webservice URL.

View solution in original post

3 REPLIES 3

sidd-harth
Participant V

Hi @Josh iQu , we can use Service Callout policy to make a SOAP call. Check the sample code below,

    <Set>
        <Headers>
            <Header name="Content-Type">text/xml; charset=utf-8</Header>
        </Headers>
        <Payload contentType="text/xml">
            <s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
                <s11:Body>
                    <ns1:GetInfo xmlns:ns1="http://tempuri.org/">
                        <!-- optional -->
                        <ns1:Request>
                            <!-- optional -->
                            <ns1:Login>{Login}</ns1:Login>
                            <!-- optional -->
                            <ns1:TokenList>
                                <ns1:string>{string}</ns1:string>
                            </ns1:TokenList>
                        </ns1:Request>
                    </ns1:GetMultipleProposalInfo>
                </s11:Body>
            </s11:Envelope>
        </Payload>
        <Verb>POST</Verb>
    </Set>

So once you get the response, use Extract policy to get the details & added then in you Payload where were applicable.

In HTTPTargetConnection give the SOAP Webservice URL.

Siddharth Barahalikar Thanks!!

I add SOAP Webservice URL and it work. 😃

Regads

When I look at these codes, I understand that the work of a programmer is complex and incontestable for every person. If you are surprised just like me when you look at these codes, then you are a humanitarian and I advise you to write papers and edit papers instead of dealing with programming. You can find a job on the site https://jobsforeditors.com/managing-editor-job-description.html where there is a lot of information in managing editor job description and a lot of information in senior editor job description.