logo       

[NuSOAP+InfoPath] document/literal problem: msg#00097

php.nusoap.general

Subject: [NuSOAP+InfoPath] document/literal problem

Hi,
 
I have a SOAP service page that looks like this (webservice.php) :
 
<?php
function publier($article) {
    ...
    <store the article in a database>
    ...
    $result = mysql_query($query);
    return $result;
}
require('nusoap/lib/nusoap.php');
$server = new soap_server("desc.wsdl");
$server->configureWSDL('cmsserver', 'urn:cms');
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
                      ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
 
the desc.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:si="http://soapinterop.org/xsd" xmlns:tns="urn:cms" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:cms">
<types><xsd:schema targetNamespace="urn:cms">
 <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
 <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
 <xsd:complexType name="article">
  <xsd:all>
   <xsd:element name="titre" type="xsd:string"/>
   <xsd:element name="texte" type="xsd:string"/>
  </xsd:all>
 </xsd:complexType>
 <xsd:complexType name="publierRequestType">
  <xsd:all>
   <xsd:element name="article" type="tns:article"/>
  </xsd:all>
 </xsd:complexType>
 <xsd:complexType name="publierResponseType">
  <xsd:all>
   <xsd:element name="return" type="xsd:boolean"/>
  </xsd:all>
 </xsd:complexType>
 <xsd:element name="publier" type="tns:publierRequestType"/>
 <xsd:element name="publierResponse" type="tns:publierResponseType"/>
</xsd:schema>
</types><message name="publierRequest"><part name="parameters" type="tns:publier" /></message><message name="publierResponse">
<part name="parameters" type="tns:publierResponse" /></message>
<portType name="cmsserverPortType"><operation name="publier"><input message="tns:publierRequest"/><output message="tns:publierResponse"/></operation></portType>
<binding name="cmsserverBinding" type="tns:cmsserverPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/><operation name="publier">
<soap:operation soapAction="urn:cms#publier" style="document"/>
<input><soap:body use="literal" namespace="urn:cms"/></input>
<output><soap:body use="literal" namespace="urn:cms"/></output>
</operation></binding>
<service name="cmsserver"><port name="cmsserverPort" binding="tns:cmsserverBinding">
<soap:address location="http://localhost_2/mini_cms/webservice.php"/></port></service></definitions>
 
I'm trying to send data from an Infopath form to that web service, but I get an error message saying that Infopath couldn't understand the wsdl definition file.
It fails both with desc.wsdl and webservice.php as the web service location in the Infopath dialog box.
 
Is there something wrong in my wsdl file ? Did I miss something important ?
 
 
Every web page on the subject claims that "NuSOAP can handle both rpc/encoded and document/literal services" but so far I haven't found a single tutorial that explains clearly how to deal with the latter.
Also, why the hell does Microsoft have to encourage the use of document/literal while the rest of the world is all about rpc/encoded ? I thought Web services were the ultimate level of abstraction, that they were supposed to be as universal as possible. Actually it seems that all these messy W3C recommendations are there to confuse people rather than to provide a uniform way of doing things...
 
As you see I'm sort of losing my nerve with all that SOAP/Web Services/Infopath stuff, so any help woud be greatly welcome :)
 
 
 
Guillaume
 
 
 
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise