klaibert26 Posted February 23, 2010 Share Posted February 23, 2010 Hi, trying to connect to a ws with nusoap I'm new on this... From what I understood from my wsdl: I have a function name: Get_Siebel_Data this function is getting 2 vars type string : Inp_Operation and Inp_Val the Get_Siebel_Data() return a var named XML_Doc i'm trying to implement the client but i keep getting this error: "Error: Response not of type text/xml: application/wsdl+xml" Can anyone tell me what I do wrong? this is my client code: <?php require_once("nusoap/lib/nusoap.php"); //instantiate the NuSOAP class and define the web service URL: //$param = array( 'Inp_Val' => '33','Inp_Operation'=>'2'); $client = new soapclient("http://localhost/test/wsdl/Get_Siebel_Data.wsdl"); //check if there were any instantiation errors, and if so stop execution with an error message: $error = $client->getError(); if ($error) { die("client construction error: {$error}\n"); } //authenticate to the service: // $client->setCredentials('Inp_Val', 'Inp_Operation'); //perform a function call with parameters: $param = array('Inp_Val' => 'Inp_Val_param', 'Inp_Operation' => 'Inp_Operation_param', ); $answer = $client->call('Get_Siebel_Data', $param); //check if there were any call errors, and if so stop execution with some error messages: $error = $client->getError(); if ($error) { print_r($client->response); print_r($client->getDebug()); die(); } //output the response (in the form of a multidimensional array) from the function call: print_r($answer); ?> and this is my output: <html> <head><title>nusoap</title></head> <body> HTTP/1.1 200 OK Date: Tue, 23 Feb 2010 09:44:58 GMT Server: Apache/2.2.8 (Win32) Last-Modified: Thu, 18 Jun 2009 12:10:23 GMT ETag: "8b4500000000ee08-762-46c9e4ad5c9c0" Accept-Ranges: bytes Content-Length: 1890 Connection: close Content-Type: application/wsdl+xml <?xml version="1.0" encoding="UTF-8"?><?Siebel-Property-Set EscapeNames="false"?><definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://siebel.com/asi/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://siebel.com/asi/" ><types ></types ><message name="DPZ_Get_Siebel_Data_Get_Siebel_Data_Output" ><part name="XML_Doc" type="xsd:string" ></part ></message ><message name="DPZ_Get_Siebel_Data_Get_Siebel_Data_Input" ><part name="Inp_Val" type="xsd:string" ></part ><part name="Inp_Operation" type="xsd:string" ></part ></message ><portType name="DPZ_Get_Siebel_Data" ><operation name="Get_Siebel_Data" ><input message="tns:DPZ_Get_Siebel_Data_Get_Siebel_Data_Input" ></input ><output message="tns:DPZ_Get_Siebel_Data_Get_Siebel_Data_Output" ></output ></operation ></portType ><binding name="DPZ_Get_Siebel_Data_Binding" type="tns:DPZ_Get_Siebel_Data" ><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" ></soap:binding ><operation name="Get_Siebel_Data" ><soap:operation soapAction="rpc/http://siebel.com/asi/:Get_Siebel_Data" ></soap:operation ><input ><soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://siebel.com/asi/" use="encoded" ></soap:body ></input ><output ><soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://siebel.com/asi/" use="encoded" ></soap:body ></output ></operation ></binding ><service name="DPZ_Get_Siebel_Data" ><port binding="tns:DPZ_Get_Siebel_Data_Binding" name="DPZ_Get_Siebel_Data" ><soap:address location="http://dpz-tescom/eai_heb/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute&UserName=BPEL_LINK&Password=BPEL_LINK" ></soap:address ></port ></service ></definitions >2010-02-23 11:44:58.338844 soapclient: ctor wsdl= timeout=0 response_timeout=30 endpoint=string(47) "http://localhost/test/wsdl/Get_Siebel_Data.wsdl" 2010-02-23 11:44:58.339206 soapclient: instantiate SOAP with endpoint at http://localhost/test/wsdl/Get_Siebel_Data.wsdl 2010-02-23 11:44:58.339759 soapclient: call: operation=Get_Siebel_Data, namespace=http://tempuri.org, soapAction=, rpcParams=, style=rpc, use=encoded, endpointType=soap params=array(2) { ["Inp_Val"]=> string(13) "Inp_Val_param" ["Inp_Operation"]=> string(19) "Inp_Operation_param" } headers=bool(false) 2010-02-23 11:44:58.340097 soapclient: serializing param array for operation Get_Siebel_Data 2010-02-23 11:44:58.340376 soapclient: in serialize_val: name=Inp_Val, type=, name_ns=, type_ns=, use=encoded, soapval= value=string(13) "Inp_Val_param" attributes=bool(false) 2010-02-23 11:44:58.340822 soapclient: serialize_val: serialize string 2010-02-23 11:44:58.341096 soapclient: serialize_val returning <Inp_Val xsi:type="xsd:string">Inp_Val_param</Inp_Val> 2010-02-23 11:44:58.341357 soapclient: in serialize_val: name=Inp_Operation, type=, name_ns=, type_ns=, use=encoded, soapval= value=string(19) "Inp_Operation_param" attributes=bool(false) 2010-02-23 11:44:58.341688 soapclient: serialize_val: serialize string 2010-02-23 11:44:58.341955 soapclient: serialize_val returning <Inp_Operation xsi:type="xsd:string">Inp_Operation_param</Inp_Operation> 2010-02-23 11:44:58.342211 soapclient: wrapping RPC request with encoded method element 2010-02-23 11:44:58.342507 soapclient: In serializeEnvelope length=209 body (max 1000 characters)=<ns2596:Get_Siebel_Data xmlns:ns2596="http://tempuri.org"><Inp_Val xsi:type="xsd:string">Inp_Val_param</Inp_Val><Inp_Operation xsi:type="xsd:string">Inp_Operation_param</Inp_Operation></ns2596:Get_Siebel_Data> style=rpc use=encoded encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ 2010-02-23 11:44:58.342760 soapclient: headers: bool(false) 2010-02-23 11:44:58.343017 soapclient: namespaces: array(0) { } 2010-02-23 11:44:58.343305 soapclient: endpoint=http://localhost/test/wsdl/Get_Siebel_Data.wsdl, soapAction=, namespace=http://tempuri.org, style=rpc, use=encoded, encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ 2010-02-23 11:44:58.343720 soapclient: SOAP message length=606 contents (max 1000 bytes)=<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 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><ns2596:Get_Siebel_Data xmlns:ns2596="http://tempuri.org"><Inp_Val xsi:type="xsd:string">Inp_Val_param</Inp_Val><Inp_Operation xsi:type="xsd:string">Inp_Operation_param</Inp_Operation></ns2596:Get_Siebel_Data></SOAP-ENV:Body></SOAP-ENV:Envelope> 2010-02-23 11:44:58.344006 soapclient: transporting via HTTP 2010-02-23 11:44:58.348654 soapclient: sending message, length=606 2010-02-23 11:44:58.344332 soap_transport_http: ctor url=http://localhost/test/wsdl/Get_Siebel_Data.wsdl use_curl= curl_options: array(0) { } 2010-02-23 11:44:58.345366 soap_transport_http: parsed URL scheme = http 2010-02-23 11:44:58.345649 soap_transport_http: parsed URL host = localhost 2010-02-23 11:44:58.345901 soap_transport_http: parsed URL path = /test/wsdl/Get_Siebel_Data.wsdl 2010-02-23 11:44:58.346167 soap_transport_http: set header Host: localhost 2010-02-23 11:44:58.347833 soap_transport_http: set header User-Agent: NuSOAP/0.7.3 (1.114) 2010-02-23 11:44:58.348126 soap_transport_http: set header Content-Type: text/xml; charset=ISO-8859-1 2010-02-23 11:44:58.348394 soap_transport_http: set header SOAPAction: "" 2010-02-23 11:44:58.348919 soap_transport_http: entered send() with data of length: 606 2010-02-23 11:44:58.349195 soap_transport_http: connect connection_timeout 0, response_timeout 30, scheme http, host localhost, port 80 2010-02-23 11:44:58.349714 soap_transport_http: calling fsockopen with host localhost connection_timeout 0 2010-02-23 11:44:58.351554 soap_transport_http: set response timeout to 30 2010-02-23 11:44:58.351875 soap_transport_http: socket connected 2010-02-23 11:44:58.352354 soap_transport_http: set header Content-Length: 606 2010-02-23 11:44:58.353304 soap_transport_http: HTTP request: POST /test/wsdl/Get_Siebel_Data.wsdl HTTP/1.0 2010-02-23 11:44:58.353631 soap_transport_http: HTTP header: Host: localhost 2010-02-23 11:44:58.353885 soap_transport_http: HTTP header: User-Agent: NuSOAP/0.7.3 (1.114) 2010-02-23 11:44:58.354270 soap_transport_http: HTTP header: Content-Type: text/xml; charset=ISO-8859-1 2010-02-23 11:44:58.354541 soap_transport_http: HTTP header: SOAPAction: "" 2010-02-23 11:44:58.354791 soap_transport_http: HTTP header: Content-Length: 606 2010-02-23 11:44:58.355343 soap_transport_http: wrote data to socket, length = 787 2010-02-23 11:44:58.368621 soap_transport_http: read line of 17 bytes: HTTP/1.1 200 OK 2010-02-23 11:44:58.369763 soap_transport_http: read line of 37 bytes: Date: Tue, 23 Feb 2010 09:44:58 GMT 2010-02-23 11:44:58.370029 soap_transport_http: read line of 30 bytes: Server: Apache/2.2.8 (Win32) 2010-02-23 11:44:58.370289 soap_transport_http: read line of 46 bytes: Last-Modified: Thu, 18 Jun 2009 12:10:23 GMT 2010-02-23 11:44:58.370544 soap_transport_http: read line of 44 bytes: ETag: "8b4500000000ee08-762-46c9e4ad5c9c0" 2010-02-23 11:44:58.371163 soap_transport_http: read line of 22 bytes: Accept-Ranges: bytes 2010-02-23 11:44:58.371442 soap_transport_http: read line of 22 bytes: Content-Length: 1890 2010-02-23 11:44:58.371709 soap_transport_http: read line of 19 bytes: Connection: close 2010-02-23 11:44:58.371969 soap_transport_http: read line of 36 bytes: Content-Type: application/wsdl+xml 2010-02-23 11:44:58.372228 soap_transport_http: read line of 2 bytes: 2010-02-23 11:44:58.372540 soap_transport_http: found end of headers after length 275 2010-02-23 11:44:58.373003 soap_transport_http: want to read content of length 1890 2010-02-23 11:44:58.373299 soap_transport_http: read buffer of 1890 bytes 2010-02-23 11:44:58.373596 soap_transport_http: read to EOF 2010-02-23 11:44:58.374026 soap_transport_http: read body of length 1890 2010-02-23 11:44:58.374280 soap_transport_http: received a total of 2165 bytes of data from server 2010-02-23 11:44:58.374876 soap_transport_http: closed socket 2010-02-23 11:44:58.375205 soap_transport_http: No Content-Encoding header 2010-02-23 11:44:58.375470 soap_transport_http: end of send() 2010-02-23 11:44:58.375769 soapclient: got response, length=1890 type=application/wsdl+xml 2010-02-23 11:44:58.376032 soapclient: Entering parseResponse() for data of length 1890 headers: array( { ["date"]=> string(29) "Tue, 23 Feb 2010 09:44:58 GMT" ["server"]=> string(20) "Apache/2.2.8 (Win32)" ["last-modified"]=> string(29) "Thu, 18 Jun 2009 12:10:23 GMT" ["etag"]=> string(36) ""8b4500000000ee08-762-46c9e4ad5c9c0"" ["accept-ranges"]=> string(5) "bytes" ["content-length"]=> string(4) "1890" ["connection"]=> string(5) "close" ["content-type"]=> string(20) "application/wsdl+xml" } 2010-02-23 11:44:58.376380 soapclient: Error: Response not of type text/xml: application/wsdl+xml Thank's Link to comment https://forums.phpfreaks.com/topic/193043-nusoap-client-error-response-not-of-type-textxml/ Share on other sites More sharing options...
klaibert26 Posted February 24, 2010 Author Share Posted February 24, 2010 anyone? Has anyone encountered this error? Link to comment https://forums.phpfreaks.com/topic/193043-nusoap-client-error-response-not-of-type-textxml/#findComment-1017269 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.