New to webservices, wsdl and nusoap

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • craig.keightley@gmail.com

    New to webservices, wsdl and nusoap

    I have access to the following web service but always retreive the
    same error:-

    Array
    (
    [faultcode] =soapenv:Server .userException
    [faultstring] =se.brodit.ws.I nvalidUserExcep tion
    [detail] =Array
    (
    [hostname] =webserver
    )

    )





    This is the following code (taken from numerous examples)

    // Pull in the NuSOAP code
    require_once('n usoap/nusoap.php');

    $serverpath ='http://www.brodit.se/';
    $wsdl = $serverpath . 'Brodit/wsdl/WebService.wsdl ';
    $param = array(
    'userId' ='xxxxxxxx'
    );

    // Create the client instance
    $client = new soapclient($wsd l, true);
    // Check for an error
    $err = $client->getError();
    if ($err) {
    // Display the error
    echo '<h2>Constructo r error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
    }
    // Call the SOAP method
    $result = $client->call('getBrand types', $param);
    // Check for a fault
    if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result );
    echo '</pre>';
    } else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
    // Display the error
    echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
    // Display the result
    echo '<h2>Result</h2><pre>';
    print_r($result );
    echo '</pre>';
    }
    }


    any help would be grateful. many thanks

    craig

  • Michael Placentra II

    #2
    Re: New to webservices, wsdl and nusoap

    It means the service says your user id is wrong. I see there are x's in
    the user id string in your snippet, did you replace your user id with
    x's for safety when posting on newsgroups? Or did you not fill that in
    when you copied out of the example?

    Comment

    • craigyk

      #3
      Re: New to webservices, wsdl and nusoap

      On Apr 23, 9:57 pm, Michael Placentra II <sumguyovrt...@ gmail.com>
      wrote:
      It means the service says your user id is wrong. I see there are x's in
      the user id string in your snippet, did you replace your user id with
      x's for safety when posting on newsgroups? Or did you not fill that in
      when you copied out of the example?
      yes, i removed the userId value.

      my problem is that i have tried with the correct user id and retreived
      the above error message.
      I have used the webservice in eclipse and that let me access the
      information with no problems.

      am i doing anything wrond witht the code posted?

      Comment

      • craigyk

        #4
        Re: New to webservices, wsdl and nusoap

        Comment

        • craigyk

          #5
          Re: New to webservices, wsdl and nusoap

          On Apr 24, 11:06 am, craigyk <craig.keight.. .@gmail.comwrot e:
          On Apr 23, 9:57 pm, Michael Placentra II <sumguyovrt...@ gmail.com>
          wrote:
          >
          It means the service says your user id is wrong. I see there are x's in
          the user id string in your snippet, did you replace your user id with
          x's for safety when posting on newsgroups? Or did you not fill that in
          when you copied out of the example?
          >
          yes, i removed the userId value.
          >
          my problem is that i have tried with the correct user id and retreived
          the above error message.
          I have used the webservice in eclipse and that let me access the
          information with no problems.
          >
          am i doing anything wrond witht the code posted?
          I have noticed whilst using the eclipse plug-in, the request layout is
          as follows:

          <?xml version="1.0" encoding="UTF-8" ?>
          - <soapenv:Envelo pe xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
          xmlns:q0="http://ws.brodit.se" xmlns:soapenv=" http://
          schemas.xmlsoap .org/soap/envelope/" xmlns:xsi="http ://www.w3.org/2001/
          XMLSchema-instance">
          - <soapenv:Body >
          - <q0:getBrandtyp es>
          <q0:userId />
          <q0:brandTypeId >XXXXXX</q0:brandTypeId>
          </q0:getBrandtype s>
          </soapenv:Body>
          </soapenv:Envelop e>

          do i need the q0 tags in nusoap?
          is it the text encoding?



          Comment

          • craigyk

            #6
            Re: New to webservices, wsdl and nusoap

            On Apr 23, 9:57 pm, Michael Placentra II <sumguyovrt...@ gmail.com>
            wrote:
            It means the service says your user id is wrong. I see there are x's in
            the user id string in your snippet, did you replace your user id with
            x's for safety when posting on newsgroups? Or did you not fill that in
            when you copied out of the example?
            I have noticed whilst using the eclipse plug-in, the request layout is
            as follows:

            <?xml version="1.0" encoding="UTF-8" ?>
            - <soapenv:Envelo pe xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
            xmlns:q0="http://ws.brodit.se" xmlns:soapenv=" http://
            schemas.xmlsoap .org/soap/envelope/" xmlns:xsi="http ://www.w3.org/2001/
            XMLSchema-instance">
            - <soapenv:Body >
            - <q0:getBrandtyp es>
            <q0:userId />
            <q0:brandTypeId >XXXXXX</q0:brandTypeId>
            </q0:getBrandtype s>
            </soapenv:Body>
            </soapenv:Envelop e>

            do i need the q0 tags in nusoap?

            Comment

            • craigyk

              #7
              Re: New to webservices, wsdl and nusoap

              On Apr 24, 11:06 am, craigyk <craig.keight.. .@gmail.comwrot e:
              On Apr 23, 9:57 pm, Michael Placentra II <sumguyovrt...@ gmail.com>
              wrote:
              >
              It means the service says your user id is wrong. I see there are x's in
              the user id string in your snippet, did you replace your user id with
              x's for safety when posting on newsgroups? Or did you not fill that in
              when you copied out of the example?
              >
              yes, i removed the userId value.
              >
              my problem is that i have tried with the correct user id and retreived
              the above error message.
              I have used the webservice in eclipse and that let me access the
              information with no problems.
              >
              am i doing anything wrond witht the code posted?
              I have noticed whilst using the eclipse plug-in, the request layout is
              as follows:

              <?xml version="1.0" encoding="UTF-8" ?>
              - <soapenv:Envelo pe xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
              xmlns:q0="http://ws.brodit.se" xmlns:soapenv=" http://
              schemas.xmlsoap .org/soap/envelope/" xmlns:xsi="http ://www.w3.org/2001/
              XMLSchema-instance">
              - <soapenv:Body >
              - <q0:getBrandtyp es>
              <q0:userId />
              <q0:brandTypeId >XXXXXX</q0:brandTypeId>
              </q0:getBrandtype s>
              </soapenv:Body>
              </soapenv:Envelop e>

              do i need the q0 tags in nusoap?

              Comment

              • craigyk

                #8
                Re: New to webservices, wsdl and nusoap

                On Apr 24, 11:06 am, craigyk <craig.keight.. .@gmail.comwrot e:
                On Apr 23, 9:57 pm, Michael Placentra II <sumguyovrt...@ gmail.com>
                wrote:
                >
                It means the service says your user id is wrong. I see there are x's in
                the user id string in your snippet, did you replace your user id with
                x's for safety when posting on newsgroups? Or did you not fill that in
                when you copied out of the example?
                >
                yes, i removed the userId value.
                >
                my problem is that i have tried with the correct user id and retreived
                the above error message.
                I have used the webservice in eclipse and that let me access the
                information with no problems.
                >
                am i doing anything wrond witht the code posted?
                testting, i twont add my psts

                Comment

                Working...