salesforce - Apex type not found for element : userDetails -
i m getting next response webservice
<?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/"><soap-env:body><getuserresponse xmlns="urn:wwservice"><userdetails xmlns="">successfully write web service hurray</userdetails></getuserresponse></soap-env:body></soap-env:envelope> but getting apex type not found element : userdetails
here's wsdl file
<?xml version="1.0" encoding="iso-8859-1"?> <definitions 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:tns="urn:wwservice" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetnamespace="urn:wwservice"> <types> <xsd:schema elementformdefault="qualified" targetnamespace="urn:wwservice"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/> <xsd:complextype name="getuserrequesttype"> <xsd:all> <xsd:element name="username" type="xsd:string" form="unqualified"/> <xsd:element name="password" type="xsd:string" form="unqualified"/> </xsd:all> </xsd:complextype> <xsd:complextype name="getuserresponsetype"> <xsd:all> <xsd:element name="userdetails" type="xsd:string" form="unqualified"/> </xsd:all> </xsd:complextype> <xsd:element name="getuser" type="tns:getuserrequesttype"/> <xsd:element name="getuserresponse" type="tns:getuserresponsetype"/> </xsd:schema> </types> <message name="getuserrequest"> <part name="parameters" element="tns:getuser"/></message> <message name="getuserresponse"> <part name="parameters" element="tns:getuserresponse"/></message> <porttype name="psocialporttype"> <operation name="getuser"> <input message="tns:getuserrequest"/> <output message="tns:getuserresponse"/> </operation> </porttype> <binding name="psocialbinding" type="tns:psocialporttype"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="getuser"> <soap:operation soapaction="urn:wwservice#getuser" style="document"/> <input><soap:body use="literal" namespace="urn:wwservice"/></input> <output><soap:body use="literal" namespace="urn:wwservice"/></output> </operation> </binding> <service name="psocial"> <port name="psocialport" binding="tns:psocialbinding"> <soap:address location="http://example.com/webservice/wwservice.php"/> </port> </service> </definitions> please allow me know getting wrong
i m using create wsdl
$server = new soap_server(); // changed coupons info start $server->soap_defencoding = 'utf-8'; $server->decode_utf8 = false; // changed coupons info end //$server->configurewsdl('m-way', 'urn:wwservice'); $server->configurewsdl('psocial', 'urn:wwservice',false,'document'); // new function spiff $server->register("getuser", array('username'=>'xsd:string','password'=>'xsd:string'), array('userdetails'=>'xsd:string'), 'urn:wwservice', 'urn:wwservice#getuser', 'document', 'literal' ); $http_raw_post_data = isset($http_raw_post_data)? $http_raw_post_data : file_get_contents('php://input'); $server->service($http_raw_post_data);
the problem soap response doesn't match description of in wsdl, wsdl has elementformdefault="qualified" schema, says kid element in namespace, e.g. saying response should be
<getuserresponse xmlns="urn:wwservice"> <userdetails>hello</userdetails> </getuserresponse> but actual response has
<getuserresponse xmlns="urn:wwservice"> <userdetails xmlns="">successfully write web service hurray</userdetails> </getuserresponse> note how namespace userdetails element different. should either update wsdl elementfordefault="unqualified" or update web service homecoming right namespace on userdetails element.
salesforce callouts
No comments:
Post a Comment