Hi Yugandhar,

JiBX supports both wrapped (the default) and unwrapped (-uw option) code generation with WSDL2Java. If you use the default wrapped form, you need to have a <mapping> for each element referenced as a WSDL <message> part that links the element to a specific Java class. If you use the unwrapped form, you need to have an abstract <mapping> (which has a type-name, rather than an element name) for each type used as a child of the wrapper elements referenced by the <message> parts.

It looks like you're using the default wrapped form, so you need to have a <mapping> definition for each element name. The *class* names, though, can be anything you want to use.

But it'd be even simpler if you used the -uw flag for unwrapped code generation. In this case you shouldn't need a binding definition at all, since the default handling will work for the simple types referenced by your request and response elements.

I hope that helps clarify how this operates. The JiBX integration documentation (http://ws.apache.org/axis2/1_1_1/jibx/jibx-codegen-integration.html , also included in the actual distribution) covers these topics in more detail.

 - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



yugandhar wrote:
Dennis

I was able to move forward by creating the correct binding classes but I
have a question? Why is it expecting the exact class name as given in the
wsdl message ie AuthenticationKey and AuthenticateResponseType instead of
trying to refer to the schema namespace ie authenticationKeyType and
authenticateResponseType in the wsdl type section.

I appreciate your time in this. we dont want to refer to the class names
directly in the messages instead refer to the namespace.
I verified your example too. We would like to use like the same way used in
the example.

<wsdl:definitions xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:ns="http://SOASecurity.sec.gov/SOASecurity/wsdl/1.0/SOASecurity.wsdl";
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:SECxsd="http://SOASecurity.sec.gov/SOASecurity/schema/1.0/SOASecurity.xsd"; targetNamespace="http://SOASecurity.sec.gov/SOASecurity/wsdl/1.0/SOASecurity.wsdl";> <wsdl:types>
      <schema elementFormDefault="qualified"
targetNamespace="http://SOASecurity.sec.gov/SOASecurity/wsdl/1.0/SOASecurity.wsdl";
                xmlns="http://www.w3.org/2001/XMLSchema";>
<import
namespace="http://SOASecurity.sec.gov/SOASecurity/schema/1.0/SOASecurity.xsd"/>

<element name="authenticationKeyType" type="SECxsd:AuthenticationKey"/> <element name="authenticateResponseType"
type="SECxsd:AuthenticateResponse"/>   </schema>

    <schema elementFormDefault="qualified"
targetNamespace="http://SOASecurity.sec.gov/SOASecurity/schema/1.0/SOASecurity.xsd";
                xmlns="http://www.w3.org/2001/XMLSchema";>

        <complexType name="AuthenticateResponse">
          <sequence>
            <element name="status" type="boolean"/>
          </sequence>
        </complexType>
<complexType name="AuthenticationKey">
        <sequence>
          <element name="applicationID" type="decimal"/>
          <element name="EmployeeID" type="string"/>
          <element name="userID" type="string"/>
          <element name="password" type="string"/>
          <element name="tokenID" type="string"/>
        </sequence>
      </complexType>
    </schema>
</wsdl:types> <wsdl:message name="authenticateRequest">
    <wsdl:part name="authenticationKey" element="AuthenticationKey"/>
</wsdl:message> <wsdl:message name="authenticateResponse">
    <wsdl:part name="authenticateResponse"
element="AuthenticateResponseType"/>
  </wsdl:message>  <wsdl:portType name="SOASecurityServicePortType">
    <wsdl:operation name="authenticate">
      <wsdl:input message="ns:authenticateRequest"/>
      <wsdl:output message="ns:authenticateResponse"/>
    </wsdl:operation>
  </wsdl:portType>
<wsdl:binding name="SOASecurityServiceSOAP12Binding" type="ns:SOASecurityServicePortType"> <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="authenticate">
      <soap12:operation soapAction="ns:authenticate"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
  <wsdl:service name="SOASecurityService">
    <wsdl:port name="SOASecurityServiceSOAP12port"
               binding="ns:SOASecurityServiceSOAP12Binding">
      <soap12:address
location="http://localhost:8080/axis2/services/SOASecurityService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

=============

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to