Hi, I have got a little probleme that is driving me mad for some day now, the mail is a bit long but I wanted to be as sharp as possible and since I have investigated for quite a time, there is a lot of thing to put in. Here it goes :
I must call a SOAP services and the people who develloped the services gived me the WSDL description. (see the end of the message for the complete WSDL). The service is deployed with axis by I cannot change it or the WSDL because I am just a client. I can call several functions but for the time being I will focus on two : - The first take a String in parameter and return a string (pretty simple) - The second take a complex object and return a complex object. The complex java object are like this : Object Client: with field :Calandar dateDeNaissance, Adresse monAdresse, String Non, String prenom with Adresse being another object : Object Adresse: with field : String nomRue, int numeroRue, Ville ville and finally Ville being : Object ville : with field : int codePostal, String nomVille To call the service I use the dynamic invoker, and since the WSDL is in document style and unwrapped I added typeMapping in the code (It doesn't work without it for the both functions). The code for the object Client, Adresse and Ville have been generated with the wsdl2java ant task of axis and they seem correct. But here come the probleme : with the first function, the server replie but WSIF seem unable to transform the response in object error in java : org.xml.sax.SAXException: Unable to marshall between XML and Castor Objects :Illegal Text data found as child of: retournerUneChaineReturn value: "La chaine envoy�e est : test" SOAP flow being (I cut the header and keeped only xml): Request: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <retournerUneChaine xmlns="http://services"><string>test</string></retournerUneChaine> </soapenv:Body> </soapenv:Envelope> Response : <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <retournerUneChaineResponse xmlns="http://services"> <retournerUneChaineReturn>La chaine envoyée est : test</retournerUneChaineReturn> </retournerUneChaineResponse> </soapenv:Body> </soapenv:Envelope> For the second function the server doesn't replie because it doesn't even understand the request. Indeed, WSIF changed the name of field of the complex object, for instance monAdresse became mon-adresse (org.xml.sax.SAXException: Invalid element in probtp.protec.soap.types.Client - mon-adresse) Soap flow : Request : <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <retournerObjetAvecParam xmlns="http://services"><client><nom>a</nom><mon-adresse numero-rue="10"><nom-rue>c</nom-rue><ville code-postal="11"><nom-ville>d</nom-ville></ville></mon-adresse><prenom>b</prenom></client></retournerObjetAvecParam> </soapenv:Body> </soapenv:Envelope> Response contain the exception as fault code But in my long search for a solution I find something very strange: when I used a newer version of the jar wsdl4j The soap message change totally but it doesn't work either (even if the message seem better), for the first I have the same exception and this time it seems that the server haven't fully understood me: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <retournerUneChaine xsi:type="xsd:string" xmlns="http://services">test</retournerUneChaine> </soapenv:Body> </soapenv:Envelope> Response : <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <retournerUneChaineResponse xmlns="http://services"> <retournerUneChaineReturn>La chaine envoyée est : null</retournerUneChaineReturn> </retournerUneChaineResponse> </soapenv:Body> </soapenv:Envelope> And for the second, I've got this error : org.xml.sax.SAXException: operation description is missing parameter description! Soap flow : request <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <retournerObjetAvecParam xsi:type="ns1:retournerObjetResponse" xmlns="http://services" xmlns:ns1="http://services"> <ns2:dateDeNaissance xmlns:ns2="http://otd">2004-02-13T10:58:25.070Z</ns2:dateDeNaissance> <ns3:monAdresse xmlns:ns3="http://otd"> <ns3:nomRue>c</ns3:nomRue> <ns3:numeroRue>10</ns3:numeroRue> <ns3:ville> <ns3:codePostal>11</ns3:codePostal> <ns3:nomVille>d</ns3:nomVille> </ns3:ville> </ns3:monAdresse> <ns4:nom xmlns:ns4="http://otd">a</ns4:nom> <ns5:prenom xmlns:ns5="http://otd">b</ns5:prenom> </retournerObjetAvecParam> </soapenv:Body> </soapenv:Envelope> and response contain the exception as faultcode. It's been several days and now I'am stuck. I have tried all the solution I've thought of be with no result. Any help will be greatly appreciated. Anthony Arrigoni Ps : Sorry for the mistake but english is not my native language. Here comes the WSDL: <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://services" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://services" xmlns:intf="http://services" xmlns:tns2="http://otd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:types> <schema elementFormDefault="qualified" targetNamespace="http://services" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://services" xmlns:intf="http://services" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <element name="retournerUneChaine"> <complexType> <sequence> <element name="msg" nillable="true" type="xsd:string"/> </sequence> </complexType> </element> <element name="retournerUneChaineResponse"> <complexType> <sequence> <element name="retournerUneChaineReturn" nillable="true" type="xsd:string"/> </sequence> </complexType> </element> <element name="retournerTableauObjets"> <complexType> <sequence/> </complexType> </element> <element name="retournerTableauObjetsResponse"> <complexType> <sequence> <element maxOccurs="unbounded" name="retournerTableauObjetsReturn" type="tns2:Client"/> </sequence> </complexType> </element> <element name="retournerObjetAvecParam"> <complexType> <sequence> <element name="client" nillable="true" type="tns2:Client"/> </sequence> </complexType> </element> <element name="retournerObjetAvecParamResponse"> <complexType> <sequence> <element name="retournerObjetAvecParamReturn" nillable="true" type="tns2:Client"/> </sequence> </complexType> </element> <element name="retournerObjet"> <complexType> <sequence/> </complexType> </element> <element name="retournerObjetResponse"> <complexType> <sequence> <element name="retournerObjetReturn" nillable="true" type="tns2:Client"/> </sequence> </complexType> </element> </schema> <schema elementFormDefault="qualified" targetNamespace="http://otd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://services" xmlns:intf="http://services" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <complexType name="Client"> <sequence> <element name="dateDeNaissance" nillable="true" type="xsd:dateTime"/> <element name="monAdresse" nillable="true" type="tns2:Adresse"/> <element name="nom" nillable="true" type="xsd:string"/> <element name="prenom" nillable="true" type="xsd:string"/> </sequence> </complexType> <complexType name="Adresse"> <sequence> <element name="nomRue" nillable="true" type="xsd:string"/> <element name="numeroRue" type="xsd:int"/> <element name="ville" nillable="true" type="tns2:Ville"/> </sequence> </complexType> <complexType name="Ville"> <sequence> <element name="codePostal" type="xsd:int"/> <element name="nomVille" nillable="true" type="xsd:string"/> </sequence> </complexType> </schema> </wsdl:types> <wsdl:message name="retournerObjetRequest"> <wsdl:part element="intf:retournerObjet" name="parameters"/> </wsdl:message> <wsdl:message name="retournerTableauObjetsResponse"> <wsdl:part element="intf:retournerTableauObjetsResponse" name="parameters"/> </wsdl:message> <wsdl:message name="retournerObjetResponse"> <wsdl:part element="intf:retournerObjetResponse" name="parameters"/> </wsdl:message> <wsdl:message name="retournerUneChaineResponse"> <wsdl:part element="intf:retournerUneChaineResponse" name="parameters"/> </wsdl:message> <wsdl:message name="retournerObjetAvecParamResponse"> <wsdl:part element="intf:retournerObjetAvecParamResponse" name="parameters"/> </wsdl:message> <wsdl:message name="retournerTableauObjetsRequest"> <wsdl:part element="intf:retournerTableauObjets" name="parameters"/> </wsdl:message> <wsdl:message name="retournerUneChaineRequest"> <wsdl:part element="intf:retournerUneChaine" name="parameters"/> </wsdl:message> <wsdl:message name="retournerObjetAvecParamRequest"> <wsdl:part element="intf:retournerObjetAvecParam" name="parameters"/> </wsdl:message> <wsdl:portType name="GererClient"> <wsdl:operation name="retournerUneChaine"> <wsdl:input message="intf:retournerUneChaineRequest" name="retournerUneChaineRequest"/> <wsdl:output message="intf:retournerUneChaineResponse" name="retournerUneChaineResponse"/> </wsdl:operation> <wsdl:operation name="retournerTableauObjets"> <wsdl:input message="intf:retournerTableauObjetsRequest" name="retournerTableauObjetsRequest"/> <wsdl:output message="intf:retournerTableauObjetsResponse" name="retournerTableauObjetsResponse"/> </wsdl:operation> <wsdl:operation name="retournerObjetAvecParam"> <wsdl:input message="intf:retournerObjetAvecParamRequest" name="retournerObjetAvecParamRequest"/> <wsdl:output message="intf:retournerObjetAvecParamResponse" name="retournerObjetAvecParamResponse"/> </wsdl:operation> <wsdl:operation name="retournerObjet"> <wsdl:input message="intf:retournerObjetRequest" name="retournerObjetRequest"/> <wsdl:output message="intf:retournerObjetResponse" name="retournerObjetResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="GererClientSoapBinding" type="intf:GererClient"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="retournerUneChaine"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="retournerUneChaineRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="retournerUneChaineResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="retournerTableauObjets"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="retournerTableauObjetsRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="retournerTableauObjetsResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="retournerObjetAvecParam"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="retournerObjetAvecParamRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="retournerObjetAvecParamResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="retournerObjet"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="retournerObjetRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="retournerObjetResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="GererClientService"> <wsdl:port binding="intf:GererClientSoapBinding" name="GererClient"> <wsdlsoap:address location="http://m02622:8080/axis/services/GererClient"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Acc�dez au courrier �lectronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34�/mn) ; t�l : 08 92 68 13 50 (0,34�/mn)
