Re: java.util.List serialization
Sorry I send mail by error :P so I have 2 class: public class Content { Listusers = new ArrayList(0); public List getUsers() { return users; } public void setUsers(List users) { this.users = users; } } public class WSContent { public Content getContent() { Content content = new Content(); List users = new ArrayList(0); users.add("test"); users.add("test2"); content.setUsers(users); return content; } } When I invoke the service by calling getContent() method I have the following error on tomcat: GRAVE: Exception occurred while trying to invoke service method getContent org.apache.axiom.om.OMException: java.lang.IllegalArgumentException: null rcl Apparently this due to the List type in Content class :/ My question is how can I serialize the java.util.List ? On 12/2/06, sentenza < [EMAIL PROTECTED]> wrote: Hi, I want make web services with pojo class using axis2. I have 2 class : public class Content { } -- char sentenza[] = "\xeb\x0d\x5f\x31\xc0\x50\x89\xe2" "\x52\x57\x54\xb0\x3b\xcd\x80\xe8" "\xee\xff\xff\xff/bin/sh"; -- char sentenza[] = "\xeb\x0d\x5f\x31\xc0\x50\x89\xe2" "\x52\x57\x54\xb0\x3b\xcd\x80\xe8" "\xee\xff\xff\xff/bin/sh";
java.util.List serialization
Hi, I want make web services with pojo class using axis2. I have 2 class : public class Content { } -- char sentenza[] = "\xeb\x0d\x5f\x31\xc0\x50\x89\xe2" "\x52\x57\x54\xb0\x3b\xcd\x80\xe8" "\xee\xff\xff\xff/bin/sh";
Re: Axis 2 Java WS provider + PHP Client problem
Thanks a lot, It's work wonderfully ! When I used axis2 there only was version 1.0. The version 1.1 is really recent. On 11/14/06, Thilina Gunarathne <[EMAIL PROTECTED]> wrote: Hi, Java2WSDL will map methods with single OMElement parameters to xsd:any, since an OMElement can carry any arbitary XML. But your service might be expecting some schema for the payload, even though it uses the OMElement (apparently there needs be a custom written WSDL in this case). So there's no way for your PHP client to understand the expected payload.. My advice would be to use a simple POJO with the RPCMessageReceiver as your service.. Then it'll automatically generate the correct WSDL.. More on using POJO's can be found at [1]. >I can use own classes type as argument ? Yes.. you can do that with POJO as mentioned above.. ~Thilina [1]http://ws.apache.org/axis2/1_1/pojoguide.html On 11/14/06, sentenza <[EMAIL PROTECTED]> wrote: > I tried other sample services methodes who take on parameter, and I have > always the same error in the php client code :( > Is there a problem using the wdsl generated file with php soap ? > > I also check the Axis 2 echo sample service. I saw that the echo methode > take one parameter and this parameter type is OMElement. This is the same > for AddService::add methode. I ask me if all complextype must be implemented > with OMElement or I can use own classes type as argument ? > > > On 11/14/06, sentenza <[EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > > I try to developp a php SOAP client write with php 5. I use an axis 2 as > WS provider. > > > > To test I use Axis 2 sgccalculator sample and try to call AddService::add > methode. > > > > I generated the wsdl file for AddService with Axis 2 Eclipse Wizzard > (Java2WSDL) and I introducted it in META-IN directory of the sgccalculator > Axis Archive. I deployed the Service with the Axis 2 administration pages. > > > > Now I can access to the wsdl file with this url : > http://localhost:8080/axis2/services/AddService?wsdl . > > > > So I write a php client test page like this : > > > > > - > > > $client = new SoapClient(" > http://localhost:9393/axis2/services/AddService?wsdl "); > > print_r($client); > > > > echo ""; > > echo ""; > > > > var_dump($client->__getFunctions()); > > > > echo ""; > > echo ""; > > > > var_dump($client->__getTypes()); > > > > echo ""; > > echo ""; > > echo ""; > > > > $a = 1; > > $b = 2; > > > > try { > > > > $result = $client->add($a, $b); > > } > > catch (SoapFault $exception) { > > echo "ERROR !!! "; > > echo $exception; > > } > > > > ?> > > > > > > > I write you because I add the followind error, and I can't resolve it : > > > > > > > SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #3 ) > > > > array(6) { [0]=> string(51) "addPreviousResponse addPrevious(addPrevious > $part1)" [1]=> string(27) "addResponse add(add $part1)" [2]=> string(51) > "addPreviousResponse addPrevious(addPrevious $part1)" [3]=> string(27) > "addResponse add(add $part1)" [4]=> string(51) "addPreviousResponse > addPrevious(addPrevious $part1)" [5]=> string(27) "addResponse add(add > $part1)" } > > > > array(4) { [0]=> string(29) "struct add { anyType elem; }" [1]=> > string(39) "struct addResponse { anyType return; }" [2]=> string(37) "struct > addPrevious { anyType elem; }" [3]=> string(47) "struct addPreviousResponse > { anyType return; }" } > > > > > > ERROR !!! > > SoapFault exception: [soapenv:Client] unknown in W:\www\index.php:60 Stack > trace: #0 [internal function]: SoapClient->__call('add', Array) #1 > W:\www\index.php(60): SoapClient->add(1, 2) #2 {main} > > > > > > > > > Thanks for help ;) > > > > -- > > Benoit > > > > > > > > -- > char sentenza[] = > "\xeb\x0d\x5f\x31\xc0\x50\x89\xe2" > "\x52\x57\x54\xb0\x3b\xcd\x80\xe8" > "\xee\xff\xff\xff/bin/sh"; -- http://webservices.apache.org/~thilina/ http://thilinag.blogspot.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- char sentenza[] = "\xeb\x0d\x5f\x31\xc0\x50\x89\xe2" "\x52\x57\x54\xb0\x3b\xcd\x80\xe8" "\xee\xff\xff\xff/bin/sh";
Re: Axis 2 Java WS provider + PHP Client problem
Someone can help me please, because I'm blocked !Thank's by advanceOn 11/14/06, sentenza <[EMAIL PROTECTED] > wrote:I tried other sample services methodes who take on parameter, and I have always the same error in the php client code :( Is there a problem using the wdsl generated file with php soap ?I also check the Axis 2 echo sample service. I saw that the echo methode take one parameter and this parameter type is OMElement. This is the same for AddService::add methode. I ask me if all complextype must be implemented with OMElement or I can use own classes type as argument ? -- char sentenza[] ="\xeb\x0d\x5f\x31\xc0\x50\x89\xe2""\x52\x57\x54\xb0\x3b\xcd\x80\xe8""\xee\xff\xff\xff/bin/sh";
Re: Axis 2 Java WS provider + PHP Client problem
I tried other sample services methodes who take on parameter, and I have always the same error in the php client code :(Is there a problem using the wdsl generated file with php soap ?I also check the Axis 2 echo sample service. I saw that the echo methode take one parameter and this parameter type is OMElement. This is the same for AddService::add methode. I ask me if all complextype must be implemented with OMElement or I can use own classes type as argument ? On 11/14/06, sentenza <[EMAIL PROTECTED]> wrote: Hi,I try to developp a php SOAP client write with php 5. I use an axis 2 as WS provider.To test I use Axis 2 sgccalculator sample and try to call AddService::add methode. I generated the wsdl file for AddService with Axis 2 Eclipse Wizzard (Java2WSDL) and I introducted it in META-IN directory of the sgccalculator Axis Archive. I deployed the Service with the Axis 2 administration pages. Now I can access to the wsdl file with this url : http://localhost:8080/axis2/services/AddService?wsdl .So I write a php client test page like this : -$client = new SoapClient(" http://localhost:9393/axis2/services/AddService?wsdl "); print_r($client); echo ""; echo ""; var_dump($client->__getFunctions()); echo ""; echo ""; var_dump($client->__getTypes()); echo ""; echo ""; echo ""; $a = 1; $b = 2; try { $result = $client->add($a, $b); } catch (SoapFault $exception) { echo "ERROR !!! "; echo $exception; } ?>I write you because I add the followind error, and I can't resolve it : SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #3 ) array(6) { [0]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [1]=> string(27) "addResponse add(add $part1)" [2]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [3]=> string(27) "addResponse add(add $part1)" [4]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [5]=> string(27) "addResponse add(add $part1)" } array(4) { [0]=> string(29) "struct add { anyType elem; }" [1]=> string(39) "struct addResponse { anyType return; }" [2]=> string(37) "struct addPrevious { anyType elem; }" [3]=> string(47) "struct addPreviousResponse { anyType return; }" } ERROR !!! SoapFault exception: [soapenv:Client] unknown in W:\www\index.php:60 Stack trace: #0 [internal function]: SoapClient->__call('add', Array) #1 W:\www\index.php(60): SoapClient->add(1, 2) #2 {main}Thanks for help ;)-- Benoit -- char sentenza[] ="\xeb\x0d\x5f\x31\xc0\x50\x89\xe2""\x52\x57\x54\xb0\x3b\xcd\x80\xe8""\xee\xff\xff\xff/bin/sh";
Axis 2 Java WS provider + PHP Client problem
Hi,I try to developp a php SOAP client write with php 5. I use an axis 2 as WS provider.To test I use Axis 2 sgccalculator sample and try to call AddService::add methode. I generated the wsdl file for AddService with Axis 2 Eclipse Wizzard (Java2WSDL) and I introducted it in META-IN directory of the sgccalculator Axis Archive. I deployed the Service with the Axis 2 administration pages. Now I can access to the wsdl file with this url : http://localhost:8080/axis2/services/AddService?wsdl .So I write a php client test page like this : -$client = new SoapClient(" http://localhost:9393/axis2/services/AddService?wsdl "); print_r($client); echo ""; echo ""; var_dump($client->__getFunctions()); echo ""; echo ""; var_dump($client->__getTypes()); echo ""; echo ""; echo ""; $a = 1; $b = 2; try { $result = $client->add($a, $b); } catch (SoapFault $exception) { echo "ERROR !!! "; echo $exception; } ?>I write you because I add the followind error, and I can't resolve it : SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #3 ) array(6) { [0]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [1]=> string(27) "addResponse add(add $part1)" [2]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [3]=> string(27) "addResponse add(add $part1)" [4]=> string(51) "addPreviousResponse addPrevious(addPrevious $part1)" [5]=> string(27) "addResponse add(add $part1)" } array(4) { [0]=> string(29) "struct add { anyType elem; }" [1]=> string(39) "struct addResponse { anyType return; }" [2]=> string(37) "struct addPrevious { anyType elem; }" [3]=> string(47) "struct addPreviousResponse { anyType return; }" } ERROR !!! SoapFault exception: [soapenv:Client] unknown in W:\www\index.php:60 Stack trace: #0 [internal function]: SoapClient->__call('add', Array) #1 W:\www\index.php(60): SoapClient->add(1, 2) #2 {main}Thanks for help ;)-- Benoit