Re: Problema con Consumo de WebSevice
[email protected] (Carlos Medina)
| Newsgroups | php.general.es |
|---|---|
| Organization | SimplyNetworks |
| Message-ID | <[email protected]> |
Am 13.10.2010 20:53, schrieb william barillas:
> que tal amigos les escribo con una molestia
>
> actualmente estoy realizando un proyecto web donde la aplicacion hecha con
> php ver. 4.X debe de consumir una serie de WebServices hechos en Netbeans y
> publicados
> en un servidor GlasFish 2, el problema que tengo es que me genera el
> siguiente Error
>
> *wsdl error: phpType is struct, but value is not an array: see debug output
> for details *
>
> el codigo php es
>
> require_once('nusoap/lib/nusoap.php');
>
> $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] :
> '';$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] :
> '';$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername']
> : '';$proxypassword = isset($_POST['proxypassword']) ?
> $_POST['proxypassword'] : '';
>
> $client = new soapclient('
> http://localhost:8080/primerWS/helloWebServiceService?wsdl','true');
>
> $err = $client->getError();if ($err) { echo '<h2>Constructor
> error</h2><pre>' . $err .'</pre>';}// create an array of parameters
>
> $parametro = array("parameters" => "will");
>
> $metodo = "mensaje";
>
> $result = $client->call('mensaje',$parametro);// assess the results
>
> $xml_contenido = $result;
>
> if ($client->fault) {
>
> $err = $client->getError();
>
> echo ("no entro 1 " . $err);
>
>
>
> } else {
>
> $err = $client->getError();
>
> if ($err) {
>
> echo ("no entro 2 " . $err
> );
>
> } else {// display the results
>
>
>
> echo "todo OK";
>
> }
>
> }
> y el archivo wsdl es
>
> <definitions targetNamespace="http://ws.org/" name="helloWebServiceService">
> -
> <types>
> -
> <xsd:schema>
> <xsd:import namespace="http://ws.org/" schemaLocation="
> http://174.24.10.6:8080/primerWS/helloWebServiceService?xsd=1"/>
> </xsd:schema>
> </types>
> -
> <message name="mensaje">
> <part name="parameters" element="tns:mensaje"/>
> </message>
> -
> <message name="mensajeResponse">
> <part name="parameters" element="tns:mensajeResponse"/>
> </message>
> -
> <portType name="helloWebService">
> -
> <operation name="mensaje">
> <input wsam:Action="http://ws.org/helloWebService/mensajeRequest"
> message="tns:mensaje"/>
> <output wsam:Action="http://ws.org/helloWebService/mensajeResponse"
> message="tns:mensajeResponse"/>
> </operation>
> </portType>
> -
> <binding name="helloWebServicePortBinding" type="tns:helloWebService">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
> -
> <operation name="mensaje">
> <soap:operation soapAction=""/>
> -
> <input>
> <soap:body use="literal"/>
> </input>
> -
> <output>
> <soap:body use="literal"/>
> </output>
> </operation>
> </binding>
> -
> <service name="helloWebServiceService">
> -
> <port name="helloWebServicePort" binding="tns:helloWebServicePortBinding">
> <soap:address location="
> http://localhost:8080/primerWS/helloWebServiceService"/>
> </port>
> </service>
> </definitions>
>
> gracias por su ayuda
>
Hola,
por lo general debes enviar exactamente el tipo de dato que quiere el
servicio. Piensa un poco lo que te esta diciendo el Servicio y seguro
que encuentras el problema. Analiza el request y el response para que
puedas ver lo que estas generando.
Saludos
Carlos Medina