Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested ComplexType #32

Open
shopapps opened this issue May 18, 2018 · 3 comments
Open

Nested ComplexType #32

shopapps opened this issue May 18, 2018 · 3 comments
Labels

Comments

@shopapps
Copy link

Hi,

I have an issue with a nuSoap client (using a WSDL) where one of the params is being sent as empty, which i think is because I don't know how to define which complexType to send the params as. So for example:

$TelephoneNumberAvailabilityRequest = [
            'MACCode'           => new soapval("MACCode", "xsd:nil", null),
            'PerformMPFACCheck' => 'No',
            'Postcode'          => 'NW1 4DJ',
            'ProxyCLI'          => false,
            'TelephoneNumber'   => '0123456789',
        ];

$payload = [
            'request' => [
                'AccessCircuit' => ['string' => ['All', 'FTTP']],
                'RequestDetails' => [
//                    'AvailabilityRequest' => [
                        'TelephoneNumberAvailabilityRequest' => $TelephoneNumberAvailabilityRequest,
//                    ],
                ],
            ],
        ];

$result = $client->call($method,[$payload]);

this gets sent to the server as:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns7756="http://tempuri.org">
 <SOAP-ENV:Body>
  <GetAvailability xmlns="http://xxxxxxxxxxx">
   <request>
    <AccessCircuit>
     <string>All</string>
     <string>FTTP</string>
    </AccessCircuit>
    <RequestDetails>   <!--    WHY IS THIS EMPTY :-(     -->
    </RequestDetails>
   </request>
  </GetAvailability>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I've tried lots of combinations of defining the payload, such as

'RequestDetails' => [
            'MACCode'           => new soapval("MACCode", "xsd:nil", null),
            'PerformMPFACCheck' => 'No',
            'Postcode'          => 'NW1 4DJ',
            'ProxyCLI'          => false,
            'TelephoneNumber'   => '0123456789',
        ],

What I am trying to acheive is to send:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:net="http://xxxxxxxx/NetworkProductAvailabilityCheckerService" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <soapenv:Header/>
    <soapenv:Body>
        <net:GetAvailability>
            <net:request>
                <net:AccessCircuit>
                    <arr:string>All</arr:string>
                </net:AccessCircuit>
                <net:NominatedCLIRequestDetails>
                    <net:CLI>0123456789</net:CLI>
                    <net:NumberRetentionCode>0</net:NumberRetentionCode>
                    <net:Retain>Yes</net:Retain>
                </net:NominatedCLIRequestDetails>
                <net:RequestDetails xsi:type="net:TelephoneNumberAvailabilityRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <net:MACCode xsi:nil="true" />
                    <net:PerformMPFACCheck>No</net:PerformMPFACCheck>
                    <net:Postcode>NW1 4DJ</net:Postcode>
                    <net:ProxyCLI>false</net:ProxyCLI>
                    <net:TelephoneNumber>0123456789</net:TelephoneNumber>
                </net:RequestDetails>
                <net:UserConsent>Yes</net:UserConsent>
            </net:request>
        </net:GetAvailability>
    </soapenv:Body>
</soapenv:Envelope>

but just does not want to work???

  • any advise gratefuly received :-)
@f3l1x
Copy link
Member

f3l1x commented May 20, 2018

Hi, it's so complicated. I can't help you. Perhaps somebody else?

@f3l1x f3l1x added the question label May 20, 2018
@evilangelmd
Copy link

As i can see in nusoap code, nusoap is working with wsdl. in wsdl that provides server there is no key "TelephoneNumberAvailabilityRequest" in "RequestDetails". Probably if you will use it without that key, you will have more success.

try to put your nested code 1 level up

something like:

$payload = [
            'request' => [
                'AccessCircuit' => ['string' => ['All', 'FTTP']],
                'RequestDetails' => $TelephoneNumberAvailabilityRequest,
            ],
];

@shopapps
Copy link
Author

shopapps commented Aug 1, 2018

Thanks for the response... Am not sure if doing it that way will set the "xsi:type" to "TelephoneNumberAvailabilityRequest" but next time I am looking at that particular code I will give it a try.

Regards, Paul.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants