You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Tak <yo...@gmail.com> on 2006/07/27 02:06:02 UTC

Strange WSDL was generated

I have quesitons for WSDL generated by servicemix-http component.

I deployed POJO as a WebService on servicemix-jsr181 and servicemix-http
components with no error.
In the generated WSDL via brower, I noticed the structure of WSDL elements
and namespace are different from origial one I used to generate the skelton
of POJO code for my service. The POJOs don't have any annotation.

Q1: extra complexType "FindItemByPrimaryKeyResponse" is generated and
assigned to the part.
This type also have another element with same name 'out' as the element that
refers to this extra element.
so response message from this service have extra nested <out> element in the
SOAP <body>.

Q2: unknown namespace "http://v1.master.optionzero.sf.org" is generated, 
and assigned to the types mentioned Q1.

Do I miss some configurations?
I have spend a lot of time to search a clue on the net, but no luck so far.
Any help would be really appreciated.
Tak

---- Here is the snippet of my original WSDL to generate bean skelton----
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  name="PriceInquiry" 
  targetNamespace="http://optionzero.sf.org/master/v1" 
  xmlns:tns="http://optionzero.sf.org/master/v1">
  <wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://optionzero.sf.org/master/v1" 
      xmlns:pref="http://optionzero.sf.org/master/v1">
    <xsd:import namespace="http://optionzero.sf.org/master/xsd/v1" 
    schemaLocation="../../../../xsd/americas/v1/ItemPrice.xsd"></xsd:import>
    ...
    <xsd:element name="getItemPriceForQtyResponse">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="out" type="pref:ItemPrice"></xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    ...
  </wsdl:types>

  <wsdl:message name="getItemPriceForQtyResponse">
    <wsdl:part name="getItemPriceForQtyResponse"
element="tns:getItemPriceForQtyResponse"></wsdl:part>
  </wsdl:message>
  ...

  <wsdl:portType name="PriceInquiry">
    <wsdl:operation name="getItemPriceForQty">
      <wsdl:input message="tns:getItemPriceForQty"></wsdl:input>
      <wsdl:output message="tns:getItemPriceForQtyResponse"></wsdl:output>
    </wsdl:operation>
    ...
  </wsdl:portType>

</wsdl:definitions>

---- Here is the sniipet of the WSDL generated ----
<wsdl:definitions 
  targetNamespace="http://optionzero.sf.org/master/v1"
  xmlns:ns1="http://v1.master.optionzero.sf.org"
  .../>
<wsdl:types>
  <xsd:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
  targetNamespace="http://v1.master.optionzero.sf.org">
  <xsd:complexType name="GetItemPriceForQtyResponse">
    <xsd:sequence>
      <xsd:element minOccurs="0" name="out" nillable="true"
type="ns2:ItemPrice"/>
    </xsd:sequence>
  </xsd:complexType>
    ...
  </xsd:schema>

  <xsd:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
  targetNamespace="http://optionzero.sf.org/master/v1">
    <xsd:element name="getItemPriceForQtyResponse">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element maxOccurs="1" minOccurs="1" name="out"
nillable="true" 
          type="ns1:GetItemPriceForQtyResponse"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  ...
<wsdl:types>

<wsdl:message name="getItemPriceForQtyResponse">
  <wsdl:part name="parameters" element="tns:getItemPriceForQtyResponse"/>
</wsdl:message>

<wsdl:portType name="PriceInquiryHttpServicePortType">
  <wsdl:operation name="getItemPriceForQty">
    <wsdl:input name="getItemPriceForQtyRequest"
message="tns:getItemPriceForQtyRequest"/>
    <wsdl:output name="getItemPriceForQtyResponse"
message="tns:getItemPriceForQtyResponse"/>
    <wsdl:fault name="RemoteException" message="tns:RemoteException"/>
  </wsdl:operation>
</wsdl:portType>

---- Here is my SE definition in xbean.xml ----
<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
       xmlns:ns="http://optionzero.sf.org/master/v1">
  <classpath>
    <location>.</location>
  </classpath>

  <jsr181:endpoint
    pojoClass="org.sf.optionzero.master.v1.impl.PriceInquiryImpl"
   annotations="none"
   service="ns:PriceInquiryHttpService"
   endpoint="PriceInquiryHttpService"/>
</beans>

---- Here is my BC definition in xbean.xml ----
<?xml version="1.0"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
     xmlns:ns="http://optionzero.sf.org/master/v1">
  <http:endpoint
    service="ns:PriceInquiryHttpService"
    endpoint="PriceInquiryHttpService"
    role="consumer"
    locationURI="http://localhost:8192/master/PriceInquiryHttpService/"
    defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
    soap="true"
  />

  <http:endpoint
    service="ns:PriceInquiryHttpProviderService"
    endpoint="PriceInquiryHttpProviderService"
    role="provider"
    locationURI="http://localhost:8000/master/PriceInquiryHttpService/"
    soap="true"
  />
</beans>

-- 
View this message in context: http://www.nabble.com/Strange-WSDL-was-generated-tf2006941.html#a5513296
Sent from the ServiceMix - User forum at Nabble.com.


Re: Strange WSDL was generated

Posted by Guillaume Nodet <gn...@gmail.com>.
Take a look at the wsdl-first demo that ships with M2 or latest svn head.
You can start from the WSDL and generate the POJOs using jaxws.

Cheers,
Guillaume Nodet

On 7/27/06, Tak <yo...@gmail.com> wrote:
>
>
> I will try this, but this is just for WSDL generation, correct?
> Does "wsdlResource" attribute stop returning extra nexted <out> element in
> the SOAP response?
>
> I need to do topdown POJO based development.
> So far, jsr181 looked good, but this issue is very serious,
> because caller cannot unmarshal the XML data to Java POJO model due to the
> extra <out> element.
> Is there other or better component but jsr181 for the topdown POJO based
> development?
>
> Tak
>
>
> gnodet wrote:
> >
> >>This is a known problem, but I'm not sure why this happen.
> >>If you want to do WSDL first developement, you should deploy
> >>the WSDL along with the POJOs on the jsr181 component
> >>and use it instead of relying on wsdl generation.
> >>This can be done using the wsdlResource attribute on the
> >><jsr181:endpoint/> element.
> >>
> >>Cheers,
> >>Guillaume Nodet
> >
> --
> View this message in context:
> http://www.nabble.com/Strange-WSDL-was-generated-tf2006941.html#a5519591
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet

Re: Strange WSDL was generated

Posted by Tak <yo...@gmail.com>.
I will try this, but this is just for WSDL generation, correct?
Does "wsdlResource" attribute stop returning extra nexted <out> element in
the SOAP response?

I need to do topdown POJO based development.
So far, jsr181 looked good, but this issue is very serious,
because caller cannot unmarshal the XML data to Java POJO model due to the
extra <out> element.
Is there other or better component but jsr181 for the topdown POJO based
development?

Tak


gnodet wrote:
> 
>>This is a known problem, but I'm not sure why this happen.
>>If you want to do WSDL first developement, you should deploy
>>the WSDL along with the POJOs on the jsr181 component
>>and use it instead of relying on wsdl generation.
>>This can be done using the wsdlResource attribute on the
>><jsr181:endpoint/> element.
>>
>>Cheers,
>>Guillaume Nodet
> 
-- 
View this message in context: http://www.nabble.com/Strange-WSDL-was-generated-tf2006941.html#a5519591
Sent from the ServiceMix - User forum at Nabble.com.


Re: Strange WSDL was generated

Posted by Guillaume Nodet <gn...@gmail.com>.
This is a known problem, but I'm not sure why this happen.
If you want to do WSDL first developement, you should deploy
the WSDL along with the POJOs on the jsr181 component
and use it instead of relying on wsdl generation.
This can be done using the wsdlResource attribute on the
<jsr181:endpoint/> element.

Cheers,
Guillaume Nodet

On 7/27/06, Tak <yo...@gmail.com> wrote:
>
>
> Sorry, let me correct one.
>
> >Q1: extra complexType "FindItemByPrimaryKeyResponse" is generated and
> assigned to the part.
> complex type is "GetItemPriceForQtyResponse".
>
> Tak
> --
> View this message in context:
> http://www.nabble.com/Strange-WSDL-was-generated-tf2006941.html#a5513323
> Sent from the ServiceMix - User forum at Nabble.com.
>
>

Re: Strange WSDL was generated

Posted by Tak <yo...@gmail.com>.
Sorry, let me correct one.

>Q1: extra complexType "FindItemByPrimaryKeyResponse" is generated and
assigned to the part.
complex type is "GetItemPriceForQtyResponse".

Tak
-- 
View this message in context: http://www.nabble.com/Strange-WSDL-was-generated-tf2006941.html#a5513323
Sent from the ServiceMix - User forum at Nabble.com.