467,168 Members | 944 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,168 developers. It's quick & easy.

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.InvalidUserException
[detail] =Array
(
[hostname] =webserver
)

)

This is the following code (taken from numerous examples)

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

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

// Create the client instance
$client = new soapclient($wsdl, true);
// Check for an error
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
// At this point, you know the call that follows will fail
}
// Call the SOAP method
$result = $client->call('getBrandtypes', $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

Apr 23 '07 #1
  • viewed: 3569
Share:
7 Replies
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?
Apr 23 '07 #2
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?

Apr 24 '07 #3
Apr 24 '07 #4
On Apr 24, 11:06 am, craigyk <craig.keight...@gmail.comwrote:
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:Envelope 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:getBrandtypes>
<q0:userId />
<q0:brandTypeId>XXXXXX</q0:brandTypeId>
</q0:getBrandtypes>
</soapenv:Body>
</soapenv:Envelope>

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

Apr 24 '07 #5
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:Envelope 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:getBrandtypes>
<q0:userId />
<q0:brandTypeId>XXXXXX</q0:brandTypeId>
</q0:getBrandtypes>
</soapenv:Body>
</soapenv:Envelope>

do i need the q0 tags in nusoap?

Apr 24 '07 #6
On Apr 24, 11:06 am, craigyk <craig.keight...@gmail.comwrote:
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:Envelope 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:getBrandtypes>
<q0:userId />
<q0:brandTypeId>XXXXXX</q0:brandTypeId>
</q0:getBrandtypes>
</soapenv:Body>
</soapenv:Envelope>

do i need the q0 tags in nusoap?

Apr 24 '07 #7
On Apr 24, 11:06 am, craigyk <craig.keight...@gmail.comwrote:
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

Apr 24 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Unbreakable | last post: by
reply views Thread by Ward G | last post: by
3 posts views Thread by frustratedcoder | last post: by
1 post views Thread by Philluminati | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.