The difference between the first WSDL you sent and the one provided by
the client is use of the "elementFormDefault" attribute.

In the first WSDL you sent us, your schema specified
elementFormDefault="qualified", which means that every element in the
message must be qualified -- like this:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
 <SOAP-ENV:Body>
  <m:LogOn xmlns:m="urn:SmartConnection">
   <m:User>String</m:User>
   <m:Password>String</m:Password>
   <m:Ticket>String</m:Ticket>
   <m:Server>String</m:Server>
   <m:ClientName>String</m:ClientName>
   <m:Domain>String</m:Domain>
   <m:ClientAppName>String</m:ClientAppName>
   <m:ClientAppVersion>String</m:ClientAppVersion>
   <m:ClientAppSerial>String</m:ClientAppSerial>
  </m:LogOn>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

which you said did not work.

In the WSDL supplied by the client, the schema does not specify the
elementFormDefault attribute, therefore it defaults to "unqualified".
Hence the proper message should look like this:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
 <SOAP-ENV:Body>
  <m:LogOn xmlns:m="urn:SmartConnection">
   <User>marat</User>
   <Password>xx</Password>
   <Ticket>String</Ticket>
   <Server>String</Server>
   <ClientName>String</ClientName>
   <Domain>String</Domain>
   <ClientAppName>String</ClientAppName>
   <ClientAppVersion>String</ClientAppVersion>
   <ClientAppSerial>String</ClientAppSerial>
  </m:LogOn>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

If you generate the service from the supplied WSDL, you shouldn't have
a problem.

Anne

On 4/18/05, Felix Kravets <[EMAIL PROTECTED]> wrote:
> The WSDL from third-party is this 
>   
> <?xml version="1.0" encoding="UTF-8" ?>
> <definitions name="SmartConnection"
> targetNamespace="urn:SmartConnection"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:tns="urn:SmartConnection"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns="http://schemas.xmlsoap.org/wsdl/";
> xmlns:dime="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/";
> xmlns:content="http://schemas.xmlsoap.org/ws/2002/04/content-type/";>
>     <types xmlns="http://schemas.xmlsoap.org/wsdl/";>
>         <schema xmlns="http://www.w3.org/2001/XMLSchema";
> targetNamespace="urn:SmartConnection">
>             <!--************* COMPLEX TYPES *****************--> 
>             <element name="LogOn">
>                 <complexType>
>                     <sequence>
>                         <element name="User" type="xsd:string"/>
>                         <element name="Password" type="xsd:string"/>
>                         <element name="Ticket" nillable="true"
> type="xsd:string"/>   <!-- To allow silent logon, based on ticket of
> previous sections. Usage depends on client config. -->
>                         <element name="Server" nillable="true"
> type="xsd:string"/>   <!-- Server to logon to as returned from GetServers or
> empty if not supported -->
>                         <element name="ClientName" type="xsd:string"/>      
>         <!-- Client machine name -->
>                         <element name="Domain" nillable="true"
> type="xsd:string"/>   <!-- OS domain -->
>                         <element name="ClientAppName" type="xsd:string"/>   
>         <!-- Client Application: InDesign, InCopy, PhotoShop, Web -->
>                         <element name="ClientAppVersion" nillable="true"
> type="xsd:string"/>
>                         <element name="ClientAppSerial" nillable="true"
> type="xsd:string"/>
>                     </sequence>
>                 </complexType>
>             </element>
>             <element name="LogOnResponse">
>                 <complexType>
>                     <sequence>
>                         <element name="Ticket" type="xsd:string"/>
>                     </sequence>
>                 </complexType>
>             </element>
>         </schema>
>     </types> 
>     <message name="LogOn">
>         <part name="parameters" element="tns:LogOn"/>
>     </message>
>     <message name="LogOnResponse">
>         <part name="parameters" element="tns:LogOnResponse"/>
>     </message> 
>   
>     <portType name="SmartConnectionPort">
>         <operation name="LogOn">
>             <input message="tns:LogOn"/>
>             <output message="tns:LogOnResponse"/>
>         </operation>
>     </portType> 
>     <binding name="SmartConnectionBinding" type="tns:SmartConnectionPort">
>         <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>         <operation name="LogOn">
>             <soap:operation
> soapAction="urn:SmartConnection#smartserver#LogOn"/>
>             <input>
>                 <soap:body use="literal"/>
>             </input>
>             <output>
>                 <soap:body use="literal"/>
>             </output>
>         </operation>
>     </binding> 
>     <service name="SmartConnectionService">
>         <documentation/>
>         <port name="SmartConnectionPort"
> binding="tns:SmartConnectionBinding">
>             <soap:address
> location="http://127.0.0.1/smartconnection/index.php"/>
>         </port>
>     </service> 
> </definitions>
>  
> The deploy.wsdd is 
>   
> <!-- Use this file to deploy some handlers/chains and services      -->
> <!-- Two ways to do this:                                  
>         -->
> <!--   java org.apache.axis.client.AdminClient deploy.wsdd 
>         -->
> <!--      after the axis server is running                      
>    -->
> <!-- or                                                    
>         -->
> <!--   java org.apache.axis.utils.Admin client|server deploy.wsdd   -->
> <!--      from the same directory that the Axis engine runs         --> 
> <deployment
>     xmlns="http://xml.apache.org/axis/wsdd/";
>    
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
>   <!-- Services from SmartConnectionService WSDL service --> 
>   <service name="SmartConnectionPort" provider="java:RPC" style="document"
> use="literal">
>       <parameter name="wsdlTargetNamespace" value="urn:SmartConnection"/>
>       <parameter name="wsdlServiceElement"
> value="SmartConnectionService"/>
>       <parameter name="wsdlServicePort" value="SmartConnectionPort"/>
>       <parameter name="className"
> value="SmartConnection.SmartConnectionBindingImpl"/>
>       <parameter name="wsdlPortType" value="SmartConnectionPort"/>
>       <parameter name="typeMappingVersion" value="1.2"/>
>       <operation name="logOn" qname="LogOn"
> returnQName="retNS:LogOnResponse"
> xmlns:retNS="urn:SmartConnection"
> returnType="rtns:>LogOnResponse"
> xmlns:rtns="urn:SmartConnection"
> soapAction="urn:SmartConnection#smartserver#LogOn" >
>         <parameter qname="pns:LogOn" xmlns:pns="urn:SmartConnection"
> type="tns:>LogOn" xmlns:tns="urn:SmartConnection"/>
>       </operation>
>       <parameter name="allowedMethods" value="logOn"/> 
>       <typeMapping
>         xmlns:ns="urn:SmartConnection"
>         qname="ns:>LogOnResponse"
>         type="java:SmartConnection.LogOnResponse"
>        
> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>        
> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>         encodingStyle=""
>       />
>       <typeMapping
>         xmlns:ns="urn:SmartConnection"
>         qname="ns:>LogOn"
>         type="java:SmartConnection.LogOn"
>        
> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>        
> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>         encodingStyle=""
>       />
>   </service>
> </deployment>
>  
> It turned out that the problem was in the namespace.
> The following request didn't work
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>  <SOAP-ENV:Body>
>   <m:LogOn xmlns:m="urn:SmartConnection">
>    <m:User>String</m:User>
>    <m:Password>String</m:Password>
>    <m:Ticket>String</m:Ticket>
>    <m:Server>String</m:Server>
>    <m:ClientName>String</m:ClientName>
>    <m:Domain>String</m:Domain>
>    <m:ClientAppName>String</m:ClientAppName>
>    <m:ClientAppVersion>String</m:ClientAppVersion>
>    <m:ClientAppSerial>String</m:ClientAppSerial>
>   </m:LogOn>
>  </SOAP-ENV:Body>
> </SOAP-ENV:Envelope> 
> But this worked fine 
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>  <SOAP-ENV:Body>
>   <m:LogOn xmlns:m="urn:SmartConnection">
>    <User>marat</User>
>    <Password>xx</Password>
>    <Ticket>String</Ticket>
>    <Server>String</Server>
>    <ClientName>String</ClientName>
>    <Domain>String</Domain>
>    <ClientAppName>String</ClientAppName>
>    <ClientAppVersion>String</ClientAppVersion>
>    <ClientAppSerial>String</ClientAppSerial>
>   </m:LogOn>
>  </SOAP-ENV:Body>
> </SOAP-ENV:Envelope> 
> I looked at the generated LogOn.java and found out that Axis generated
>         elemField.setFieldName("user");
>         elemField.setXmlName(new javax.xml.namespace.QName("", "User"));
>         elemField.setXmlType(new
> javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";,
> "string"));
>         typeDesc.addFieldDesc(elemField); 
>   
> After I modified to 
>         elemField.setFieldName("user");
>         elemField.setXmlName(new
> javax.xml.namespace.QName("urn:SmartConnection", "User"));
>         elemField.setXmlType(new
> javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";,
> "string"));
>         typeDesc.addFieldDesc(elemField); 
> it processed the clien't request and returned LogOnResponse. 
>   
> Do you know what should I do to generate java classes with the proper
> QNames?
> Is there an option in WSDL2Java that I am missing when I generate java
> classes from WSDL? 
> I generated as follows: 
>  WSDL2Java -s MyTest.wsdl -W 
> Thanks,
> Felix
>  
> 
> 
> Dino Chiesa <[EMAIL PROTECTED]> wrote: 
>  
> That WSDL - is it the WSDL provided by the third party?  or is it the WSDL
> generated by your implementation?  
>   
> Can you send both WSDLs ?  (and tell us which is which) 
> or maybe they are exactly the same? 
>   
> also can you tell me a bit more about this step: 
> > I generated Java classes from this WSDL, and my test client is working
> fine
> > with my Server. 
>   
> Just how exactly did you generate classes for the server, then how did you
> deploy them?  Do you have a deploy.wsdd ?   can you send that too? 
> likewise how did you generate classes for the test client.  which WSDL did
> you use?   
>   
> NB:  the SOAP generated by the 3rd party client looks right.  It appears to
> be doc/lit SOAP.    The SOAP generated by your test client looks wrong -
> looks like it does not conform to the WSDL that you sent.  It includes
> xsi:type which is not necessary in doc/lit. 
>   
> 
>   
>  ________________________________
>  From: Felix Kravets [mailto:[EMAIL PROTECTED] 
> Sent: Monday, April 18, 2005 9:13 AM
> To: [email protected]; Anne Thomas Manes
> Subject: Re: Invalid element in SOAP body
> 
>  
>  
> Hi Anne, 
>   
> Here is WSDL 
>   
>  <?xml version="1.0" encoding="UTF-8" ?> 
>  
> - <wsdl:definitions targetNamespace="urn:SmartConnection"
> xmlns:apachesoap="http://xml.apache.org/xml-soap";
> xmlns:impl="urn:SmartConnection" xmlns:intf="urn:SmartConnection"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";> 
>  
> - <!-- WSDL created by Apache Axis version: 1.2RC3
> Built on Feb 28, 2005 (10:15:14 EST)
>   --> 
>  
> - <wsdl:types> 
>  
>  
> - <schema elementFormDefault="qualified"
> targetNamespace="urn:SmartConnection"
> xmlns="http://www.w3.org/2001/XMLSchema";> 
>  
>  
> - <element name="LogOn"> 
>  
>  
> - <complexType> 
>  
>  
> - <sequence> 
>  
>  
>   <element name="User" nillable="true" type="xsd:string" /> 
>  
>   <element name="Password" nillable="true" type="xsd:string" /> 
>  
>   <element name="Ticket" nillable="true" type="xsd:string" /> 
>  
>   <element name="Server" nillable="true" type="xsd:string" /> 
>  
>   <element name="ClientName" nillable="true" type="xsd:string" /> 
>  
>   <element name="Domain" nillable="true" type="xsd:string" /> 
>  
>   <element name="ClientAppName" nillable="true" type="xsd:string" /> 
>  
>   <element name="ClientAppVersion" nillable="true" type="xsd:string" /> 
>  
>   <element name="ClientAppSerial" nillable="true" type="xsd:string" /> 
>   </sequence> 
>   </complexType> 
>   </element> 
>  
> - <element name="LogOnResponse"> 
>  
>  
> - <complexType> 
>  
>  
> - <sequence> 
>  
>  
>   <element name="Ticket" nillable="true" type="xsd:string" /> 
>   </sequence> 
>   </complexType> 
>   </element> 
>   </schema> 
>   </wsdl:types> 
>  
> - <wsdl:message name="LogOnResponse"> 
>  
>  
>   <wsdl:part element="impl:LogOnResponse" name="LogOnResponse" /> 
>   </wsdl:message> 
>  
> - <wsdl:message name="LogOnRequest"> 
>  
>  
>   <wsdl:part element="impl:LogOn" name="LogOn" /> 
>   </wsdl:message> 
>  
> - <wsdl:portType name="SmartConnectionPort"> 
>  
>  
> - <wsdl:operation name="LogOn" parameterOrder="LogOn"> 
>  
>  
>   <wsdl:input message="impl:LogOnRequest" name="LogOnRequest" /> 
>  
>   <wsdl:output message="impl:LogOnResponse" name="LogOnResponse" /> 
>   </wsdl:operation> 
>   </wsdl:portType> 
>  
> - <wsdl:binding name="SmartConnectionPortSoapBinding"
> type="impl:SmartConnectionPort"> 
>  
>  
>   <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"; /> 
>  
> - <wsdl:operation name="LogOn"> 
>  
>  
>   <wsdlsoap:operation
> soapAction="urn:SmartConnection#smartserver#LogOn" /> 
>  
> - <wsdl:input name="LogOnRequest"> 
>  
>  
>   <wsdlsoap:body use="literal" /> 
>   </wsdl:input> 
>  
> - <wsdl:output name="LogOnResponse"> 
>  
>  
>   <wsdlsoap:body use="literal" /> 
>   </wsdl:output> 
>   </wsdl:operation> 
>   </wsdl:binding> 
>  
> - <wsdl:service name="SmartConnectionService"> 
>  
>  
> - <wsdl:port binding="impl:SmartConnectionPortSoapBinding"
> name="SmartConnectionPort"> 
>  
>  
>   <wsdlsoap:address
> location="http://torfelix:8080/axis/services/SmartConnectionPort";
> /> 
>   </wsdl:port> 
>   </wsdl:service> 
>   </wsdl:definitions> 
>   
> This is the soap request  
>   
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><SOAP-ENV:Envelope
> xmlns="urn:SmartConnection"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
> xmlns:tns="urn:SmartConnection"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><SOAP-ENV:Body><tns:LogOn><User>xx</User><Password>xx</Password><Ticket></Ticket><Server>Server</Server><ClientName>TORFELIX</ClientName><Domain>TORFELIX</Domain><ClientAppName>InDesign
> CS</ClientAppName><ClientAppVersion>v3.3.1 build
> 353</ClientAppVersion><ClientAppSerial></ClientAppSerial></tns:LogOn></SOAP-ENV:Body></SOAP-ENV:Envelope>
> 
> The above request receives the following responce 
> 
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?><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><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXException:
> Invalid element in SmartConnection.LogOn -
> User</faultstring><detail><ns1:hostname
> xmlns:ns1="http://xml.apache.org/axis/";>torfelix</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
> 
>   
> Thanks for you help, 
> Felix
> 
> Anne Thomas Manes <[EMAIL PROTECTED]> wrote: 
> Can you post the WSDL?
> 
> On 4/15/05, Felix Kravets wrote:
> > 
> > 
> > 
> > 
> > Hi, 
> > 
> > 
> > 
> > I am using Axis 1.2 RC3. The client is a third-party that provided WSDL. 
> > 
> > I generated Java classes from this WSDL, and my test client is working
> fine
> > with my Server. 
> > 
> > But call from the third-party client returns "Invalid element" fault. 
> > 
> > My test client sends the following in the SOAP 
> > 
> > 
> > 
> > 
> > 
> > some_user 
> > 
> > ...... 
> > 
> > And it works fine 
> > 
> > 
> > 
> > Third-party client sends 
> > 
> > 
> > 
> > 
> > 
> > some_user 
> > 
> > ...... 
> > 
> > This returns "Invalid element User" fault. 
> > 
> > 
> > 
> > Any suggestions would be greatly appreciated. 
> > 
> > 
> > 
> > Thanks 
> > 
> > 
> > 
> > ________________________________
> > Do you Yahoo!?
> > Yahoo! Small Business - Try our new resources site! 
> > 
> >
>  
> 
>  ________________________________
>  Do you Yahoo!?
> Make Yahoo! your home page 
> 
> 
> 
>  ________________________________
> Do you Yahoo!?
>  Plan great trips with Yahoo! Travel: Now over 17,000 guides! 
> 
>

Reply via email to