Is it possible to invoke web services created with spring ws in php?
Because I was trying do it, what I got was ,I was able to invoke it in php .
I got list of person in php from Spring ws which I created.
But I am unable to add a person and it is causing me some xml validation error which is as follow :
Oct 11, 2011 12:02:15 PM org.springframework.ws.soap.server.endpoint.interc eptor.AbstractFaultCreatingValidatingInterceptor handleRequestValidationErrors
WARNING: XML validation error on request: cvc-complex-type.3.2.2: Attribute 'Id' is not allowed to appear in element 'ns1:Person'.
Oct 11, 2011 12:02:15 PM org.springframework.ws.soap.server.endpoint.interc eptor.AbstractFaultCreatingValidatingInterceptor handleRequestValidationErrors
WARNING: XML validation error on request: cvc-complex-type.4: Attribute 'Id' must appear on element 'ns1:Person'.
My Php code is as follow
The xml which is sent back to server is as followPHP Code:$person = new Person();
$person->Id=1;
$person->FirstName="rajesh";
$person->LastName="kakawat";
$client->addPerson(array(
"Person" => $person));
on server side addPerson() take person objectHTML Code:<?xml version="1.0" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/person/schema"> <SOAP-ENV:Body> <ns1:AddPersonRequest> <ns1:Person Id="1"> <ns1:FirstName> rajesh </ns1:FirstName> <ns1:LastName> kakawat </ns1:LastName> </ns1:Person> </ns1:AddPersonRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
person.xsd file is as follow
As this is my first webservice, I don't above much about webservice.HTML Code:<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/person/schema" xmlns:per="http://www.example.org/person/schema" elementFormDefault="qualified"> <xs:element name="Person"> <xs:complexType> <xs:sequence> <xs:element name="FirstName" type="xs:string" /> <xs:element name="LastName" type="xs:string" /> </xs:sequence> <xs:attribute ref="per:Id" use="required" /> </xs:complexType> </xs:element> <xs:attribute name="Id" type="xs:int" /> <xs:element name="AddPersonRequest"> <xs:complexType> <xs:sequence> <xs:element ref="per:Person" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="GetPersonRequest"> <xs:complexType> <xs:attribute ref="per:Id" use="required" /> </xs:complexType> </xs:element> <xs:element name="GetPersonResponse"> <xs:complexType> <xs:sequence> <xs:element ref="per:Person" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="GetAllPersonsRequest"> <xs:complexType> <xs:sequence /> </xs:complexType> </xs:element> <xs:element name="GetAllPersonsResponse"> <xs:complexType> <xs:sequence> <xs:element ref="per:Person" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="UpdatePersonRequest"> <xs:complexType> <xs:sequence> <xs:element ref="per:Person" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="DeletePersonRequest"> <xs:complexType> <xs:attribute ref="per:Id" use="required" /> </xs:complexType> </xs:element> </xs:schema>
Please help me out
Thank you


Reply With Quote