1

Hi i'm using PHP's soapclient function to call a soap webservices (with wdsl).

I know how to pass parameters to a method, but the webservice i'm using is expecting parameters in the parameter name (not sure how to call this).

This is what the webservice is expecting when using parameters:

<searchCriteria>
    <Name MatchType=”MatchBeginning”>Exmaple Company</Name>
    <Address>
        <Street>Example Street</Street>
    </Address>
</searchCriteria>

It's about this part in the Name parameter: MatchType=”MatchBeginning”

This is how i'm calling the webservice:

<?php
    $client = @new \SoapClient($url,array(
            'exceptions' => 1,
            'login' => '****',
            'password' => '****',
            'trace' => 1,
    ));

    $parameter = array(
        "countries" => array(
            "CountryCode" => "NL",
        ),
        "searchCriteria" => array(
            "Name" => "value"
        ),
    );

Can someone tell me how to add the parameter using the above method? Much appreciated.

BTW i'm trying to consume a webservice from Creditsafe. Maybe someone will find this question by adding this info.

1 Answer 1

2

I figured out how to do it:

    $parameter = array(
        "countries" => array(
            "CountryCode" => "DE",
        ),
        "searchCriteria" => array(
            "Name" => array( "_" => "value",
             "MatchType" => "MatchBeginning"
            ),
        )
    );
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.