You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by angeloNZ <an...@nz.fujitsu.com> on 2009/02/05 03:11:06 UTC

http binding problem displaying the WSDL

Hi,

I'm trying to do this for now:

client -> http bc consumer -> http bc provider -> external web service

basically, this would just be a pass-through call from the client to the
external web service as a simple test.

I have my xbean.xml as such:

<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:tn="http://com.fujitsu.nz"
       xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://servicemix.apache.org/http/1.0
http://servicemix.apache.org/schema/servicemix-http-3.2.2.xsd
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
                                     
  <http:endpoint service="tn:EchoService"
                 endpoint="soap"
                 role="consumer"            
                 targetService="tn:EchoService"
                 targetEndpoint="echo"               
                 locationURI="http://localhost:8192/EchoService/"                 
                 soap="true"/>
                 
  <http:endpoint service="tn:EchoService"
                 endpoint="echo"
                 role="provider"                                           
                
locationURI="http://localhost/MockWebService/services/EchoService"
                
wsdlResource="http://localhost/MockWebService/services/EchoService?wsdl"/>                                

</beans>

and here is the wsdl file that is being referenced by the provider endpoint:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://com.fujitsu.nz"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://com.fujitsu.nz" xmlns:intf="http://com.fujitsu.nz"
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.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
 <wsdl:types>
  <schema elementFormDefault="qualified"
targetNamespace="http://com.fujitsu.nz"
xmlns="http://www.w3.org/2001/XMLSchema">
   <element name="sayHello">
    <complexType/>
   </element>
   <element name="sayHelloResponse">
    <complexType>

     <sequence>
      <element name="sayHelloReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
  </schema>
 </wsdl:types>

   <wsdl:message name="sayHelloRequest">

      <wsdl:part element="impl:sayHello" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="sayHelloResponse">

      <wsdl:part element="impl:sayHelloResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:portType name="EchoService">

      <wsdl:operation name="sayHello">

         <wsdl:input message="impl:sayHelloRequest" name="sayHelloRequest">

       </wsdl:input>

         <wsdl:output message="impl:sayHelloResponse"
name="sayHelloResponse">

       </wsdl:output>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="EchoServiceSoapBinding" type="impl:EchoService">

      <wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="sayHello">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="sayHelloRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="sayHelloResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="EchoServiceService">

      <wsdl:port binding="impl:EchoServiceSoapBinding" name="EchoService">

         <wsdlsoap:address
location="http://localhost/MockWebService/services/EchoService"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>


The problem I'm having is I couldn't get the WSDL to display whenever I
access http://localhost:8192/EchoService?wsdl.  All I'm getting is a 404
page saying it's unable to find the requested resource.  My SA has been
deployed OK since I can see EchoService when I go to http://localhost:8192.

Was there anything that I missed out doing?  Am I right to think that I
should be able to see the WSDL via http://localhost:8192/EchoService?wsdl ?  

Also, later on I'll be putting a camel component in between the http BC's to
add routing logic:

client -> http bc consumer -> servicemix-camel -> http bc provider ->
external web service

Is my understanding correct that the camel component should be able to
"intercept" any request coming from the http consumer as long as I've got my
from("...") value correct?

Thanks for future clarifications.
-- 
View this message in context: http://www.nabble.com/http-binding-problem-displaying-the-WSDL-tp21843894p21843894.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: http binding problem displaying the WSDL

Posted by angeloNZ <an...@nz.fujitsu.com>.
After looking around the forum, I found an old post that was similar to my
problem:

http://cwiki.apache.org/SM/discussion-forums.html#nabble-td21843894%7Ca21844247
http://cwiki.apache.org/SM/discussion-forums.html#nabble-td21843894%7Ca21844247 

I finally managed to get things working after following the advice from that
thread.  So here's what I did:

I started from scratch and created a simple Echo Web Service using Eclipse
WTP and hosted it in tomcat.  Important parts of the WSDL are shown below:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ...
targetNamespace="http://com.fujitsu.nz">
...
<wsdl:service name="Echo">
        <wsdl:port name="EchoSOAP11port_http"
binding="ns0:EchoSOAP11Binding">

            <soap:address
location="http://localhost:80/MockWebService/services/Echo"/>
        </wsdl:port>
        <wsdl:port name="EchoSOAP12port_http"
binding="ns0:EchoSOAP12Binding">
            <soap12:address
location="http://localhost:80/MockWebService/services/Echo"/>
        </wsdl:port>
        <wsdl:port name="EchoHttpport" binding="ns0:EchoHttpBinding">
            <http:address
location="http://localhost:80/MockWebService/services/Echo"/>
        </wsdl:port>
    </wsdl:service>


The WSDL was generated using Axis2 runtime in Eclipse, that's why I get the
different port names for http,
soap1.1 and soap1.2.

Here's my xbean.xml definition:

<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:ns="http://com.fujitsu.nz" ...

  <http:endpoint service="ns:Echo"
                 endpoint="EchoSOAPConsumer"
                 role="consumer"            
                 targetService="ns:Echo"    
                 targetEndpoint="EchoSOAP11port_http"                                                 
                 locationURI="http://localhost:8192/EchoService/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 soap="true"
                 soapVersion="1.1"/>
                 

  <http:endpoint service="ns:Echo"
                 endpoint="EchoSOAP11port_http"
                 role="provider"                 
                
locationURI="http://localhost:80/MockWebService/services/Echo"
                
wsdlResource="http://localhost:80/MockWebService/services/Echo?wsdl"
                 soap="true"
                 soapVersion="1.1"
                 soapAction="getMessage"/>  

</beans>

1.  It is important that the targetNamespace value used in the wsdl be the
same as that in the xbean.xml.  From the WSDL above the targetNamespace is
http://com.fujitsu.nz which is the same as
xmlns:ns="http://com.fujitsu.nz" in xbean.xml.

2.  Notice that the service names for both the consumer and provider are the
same.  This should also be named exactly as what is in the WSDL:

<wsdl:service name="Echo">

3.  The value that made everything come together was the endpoint value in
the provider definition.  The provider endpoint value was exactly one of the
port names defined in the WSDL:

xbean.xml: 

<http:endpoint service="ns:Echo"
                 endpoint="EchoSOAP11port_http"  ...

WSDL:

<wsdl:service name="Echo">
        <wsdl:port name="EchoSOAP11port_http"
binding="ns0:EchoSOAP11Binding">  ...

4.  Lastly, in the consumer definition ensure that the targetEndpoint value
is the same as the endpoint value in the provider definition:

consumer:
   role="consumer"            
   targetService="ns:Echo"    
   targetEndpoint="EchoSOAP11port_http" 

provider:
   endpoint="EchoSOAP11port_http"
   role="provider" 


That's it.  I struggled with this problem for a while so I hope this helps
with those having the same problem.

Thanks to Freeman for his time in helping out.



Freeman Fang wrote:
> 
> Could you send me the full debug log when you try to access 
> http://localhost:8192/EchoService/main.wsdl from your browser?
> Freeman
> 
> angeloNZ wrote:
>> I wasn't getting any sort of exception when deploying the SA with the
>> consumer and provider servicename the same.  I've now tried changing the
>> name of the consumer service and still get the unable to find the
>> requested
>> resource problem.
>>
>> I can get the external web service's wsdl to show up in the browser by
>> doing
>> http://localhost/MockWebService/services/EchoService?wsdl
>> and I can make requests to it's methods when using a soapUI client as
>> well.
>>
>> So I'm not really sure what else to look for.
>>
>> Here's what I get from turning on DEBUG whenever I try to access
>> .../EchoService/main.wsdl
>>
>> DEBUG - jetty                          - chain=null
>> DEBUG - jetty                          - servlet holder=jbiServlet
>> DEBUG - jetty                          - RESPONSE /EchoService/main.wsdl 
>> 404
>> DEBUG - jetty                          - REQUEST /EchoService/main.wsdl
>> on
>> org.mortbay.jetty.HttpC
>> onnection@1b6c74
>> DEBUG - jetty                          - servlet=jbiServlet
>> DEBUG - jetty                          - chain=null
>> DEBUG - jetty                          - servlet holder=jbiServlet
>> DEBUG - jetty                          - RESPONSE /EchoService/main.wsdl 
>> 404
>>
>>
>> Freeman Fang wrote:
>>   
>>> Hi,
>>>
>>> Are you sure your SA get deployed successfully?  I notice your http 
>>> consumer and provider has same servicename which should cause conflict 
>>> when deploy your SA.
>>> Could see any exception from servicemix console when you deploy the SA?
>>> Also, you use
>>> wsdlResource="http://localhost/MockWebService/services/EchoService?wsdl"
>>> to refer the wsdl, which means the service already exposed from 
>>> http://localhost/MockWebService/services/EchoService
>>> Could you access the 
>>> http://localhost/MockWebService/services/EchoService?wsdl from your web 
>>> browser?
>>> Freeman
>>> angeloNZ wrote:
>>>     
>>>> thanks for your reply Freeman.  
>>>>
>>>> however, using http://localhost:8192/EchoService/main.wsdl gives me the
>>>> same
>>>> resource not found problem.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   
>>>>       
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/http-binding-problem-displaying-the-WSDL-tp21843894p21923959.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: http binding problem displaying the WSDL

Posted by Freeman Fang <fr...@gmail.com>.
Could you send me the full debug log when you try to access 
http://localhost:8192/EchoService/main.wsdl from your browser?
Freeman

angeloNZ wrote:
> I wasn't getting any sort of exception when deploying the SA with the
> consumer and provider servicename the same.  I've now tried changing the
> name of the consumer service and still get the unable to find the requested
> resource problem.
>
> I can get the external web service's wsdl to show up in the browser by doing
> http://localhost/MockWebService/services/EchoService?wsdl
> and I can make requests to it's methods when using a soapUI client as well.
>
> So I'm not really sure what else to look for.
>
> Here's what I get from turning on DEBUG whenever I try to access
> .../EchoService/main.wsdl
>
> DEBUG - jetty                          - chain=null
> DEBUG - jetty                          - servlet holder=jbiServlet
> DEBUG - jetty                          - RESPONSE /EchoService/main.wsdl 
> 404
> DEBUG - jetty                          - REQUEST /EchoService/main.wsdl on
> org.mortbay.jetty.HttpC
> onnection@1b6c74
> DEBUG - jetty                          - servlet=jbiServlet
> DEBUG - jetty                          - chain=null
> DEBUG - jetty                          - servlet holder=jbiServlet
> DEBUG - jetty                          - RESPONSE /EchoService/main.wsdl 
> 404
>
>
> Freeman Fang wrote:
>   
>> Hi,
>>
>> Are you sure your SA get deployed successfully?  I notice your http 
>> consumer and provider has same servicename which should cause conflict 
>> when deploy your SA.
>> Could see any exception from servicemix console when you deploy the SA?
>> Also, you use
>> wsdlResource="http://localhost/MockWebService/services/EchoService?wsdl"
>> to refer the wsdl, which means the service already exposed from 
>> http://localhost/MockWebService/services/EchoService
>> Could you access the 
>> http://localhost/MockWebService/services/EchoService?wsdl from your web 
>> browser?
>> Freeman
>> angeloNZ wrote:
>>     
>>> thanks for your reply Freeman.  
>>>
>>> however, using http://localhost:8192/EchoService/main.wsdl gives me the
>>> same
>>> resource not found problem.
>>>
>>>
>>>
>>>
>>>
>>>   
>>>       
>>
>>     
>
>   


Re: http binding problem displaying the WSDL

Posted by angeloNZ <an...@nz.fujitsu.com>.
I wasn't getting any sort of exception when deploying the SA with the
consumer and provider servicename the same.  I've now tried changing the
name of the consumer service and still get the unable to find the requested
resource problem.

I can get the external web service's wsdl to show up in the browser by doing
http://localhost/MockWebService/services/EchoService?wsdl
and I can make requests to it's methods when using a soapUI client as well.

So I'm not really sure what else to look for.

Here's what I get from turning on DEBUG whenever I try to access
.../EchoService/main.wsdl

DEBUG - jetty                          - chain=null
DEBUG - jetty                          - servlet holder=jbiServlet
DEBUG - jetty                          - RESPONSE /EchoService/main.wsdl 
404
DEBUG - jetty                          - REQUEST /EchoService/main.wsdl on
org.mortbay.jetty.HttpC
onnection@1b6c74
DEBUG - jetty                          - servlet=jbiServlet
DEBUG - jetty                          - chain=null
DEBUG - jetty                          - servlet holder=jbiServlet
DEBUG - jetty                          - RESPONSE /EchoService/main.wsdl 
404


Freeman Fang wrote:
> 
> Hi,
> 
> Are you sure your SA get deployed successfully?  I notice your http 
> consumer and provider has same servicename which should cause conflict 
> when deploy your SA.
> Could see any exception from servicemix console when you deploy the SA?
> Also, you use
> wsdlResource="http://localhost/MockWebService/services/EchoService?wsdl"
> to refer the wsdl, which means the service already exposed from 
> http://localhost/MockWebService/services/EchoService
> Could you access the 
> http://localhost/MockWebService/services/EchoService?wsdl from your web 
> browser?
> Freeman
> angeloNZ wrote:
>> thanks for your reply Freeman.  
>>
>> however, using http://localhost:8192/EchoService/main.wsdl gives me the
>> same
>> resource not found problem.
>>
>>
>>
>>
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/http-binding-problem-displaying-the-WSDL-tp21843894p21844671.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: http binding problem displaying the WSDL

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Are you sure your SA get deployed successfully?  I notice your http 
consumer and provider has same servicename which should cause conflict 
when deploy your SA.
Could see any exception from servicemix console when you deploy the SA?
Also, you use
wsdlResource="http://localhost/MockWebService/services/EchoService?wsdl"
to refer the wsdl, which means the service already exposed from 
http://localhost/MockWebService/services/EchoService
Could you access the 
http://localhost/MockWebService/services/EchoService?wsdl from your web 
browser?
Freeman
angeloNZ wrote:
> thanks for your reply Freeman.  
>
> however, using http://localhost:8192/EchoService/main.wsdl gives me the same
> resource not found problem.
>
>
>
>
>
>   


Re: http binding problem displaying the WSDL

Posted by angeloNZ <an...@nz.fujitsu.com>.
thanks for your reply Freeman.  

however, using http://localhost:8192/EchoService/main.wsdl gives me the same
resource not found problem.





-- 
View this message in context: http://www.nabble.com/http-binding-problem-displaying-the-WSDL-tp21843894p21844350.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: http binding problem displaying the WSDL

Posted by Freeman Fang <fr...@gmail.com>.
angeloNZ wrote:
> Hi,
>
> I'm trying to do this for now:
>
> client -> http bc consumer -> http bc provider -> external web service
>
> basically, this would just be a pass-through call from the client to the
> external web service as a simple test.
>
> I have my xbean.xml as such:
>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>        xmlns:tn="http://com.fujitsu.nz"
>        xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://servicemix.apache.org/http/1.0
> http://servicemix.apache.org/schema/servicemix-http-3.2.2.xsd
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>                                      
>   <http:endpoint service="tn:EchoService"
>                  endpoint="soap"
>                  role="consumer"            
>                  targetService="tn:EchoService"
>                  targetEndpoint="echo"               
>                  locationURI="http://localhost:8192/EchoService/"                 
>                  soap="true"/>
>                  
>   <http:endpoint service="tn:EchoService"
>                  endpoint="echo"
>                  role="provider"                                           
>                 
> locationURI="http://localhost/MockWebService/services/EchoService"
>                 
> wsdlResource="http://localhost/MockWebService/services/EchoService?wsdl"/>                                
>
> </beans>
>
> and here is the wsdl file that is being referenced by the provider endpoint:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://com.fujitsu.nz"
> xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:impl="http://com.fujitsu.nz" xmlns:intf="http://com.fujitsu.nz"
> 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.4
> Built on Apr 22, 2006 (06:55:48 PDT)-->
>  <wsdl:types>
>   <schema elementFormDefault="qualified"
> targetNamespace="http://com.fujitsu.nz"
> xmlns="http://www.w3.org/2001/XMLSchema">
>    <element name="sayHello">
>     <complexType/>
>    </element>
>    <element name="sayHelloResponse">
>     <complexType>
>
>      <sequence>
>       <element name="sayHelloReturn" type="xsd:string"/>
>      </sequence>
>     </complexType>
>    </element>
>   </schema>
>  </wsdl:types>
>
>    <wsdl:message name="sayHelloRequest">
>
>       <wsdl:part element="impl:sayHello" name="parameters">
>
>       </wsdl:part>
>
>    </wsdl:message>
>
>    <wsdl:message name="sayHelloResponse">
>
>       <wsdl:part element="impl:sayHelloResponse" name="parameters">
>
>       </wsdl:part>
>
>    </wsdl:message>
>
>    <wsdl:portType name="EchoService">
>
>       <wsdl:operation name="sayHello">
>
>          <wsdl:input message="impl:sayHelloRequest" name="sayHelloRequest">
>
>        </wsdl:input>
>
>          <wsdl:output message="impl:sayHelloResponse"
> name="sayHelloResponse">
>
>        </wsdl:output>
>
>       </wsdl:operation>
>
>    </wsdl:portType>
>
>    <wsdl:binding name="EchoServiceSoapBinding" type="impl:EchoService">
>
>       <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
>       <wsdl:operation name="sayHello">
>
>          <wsdlsoap:operation soapAction=""/>
>
>          <wsdl:input name="sayHelloRequest">
>
>             <wsdlsoap:body use="literal"/>
>
>          </wsdl:input>
>
>          <wsdl:output name="sayHelloResponse">
>
>             <wsdlsoap:body use="literal"/>
>
>          </wsdl:output>
>
>       </wsdl:operation>
>
>    </wsdl:binding>
>
>    <wsdl:service name="EchoServiceService">
>
>       <wsdl:port binding="impl:EchoServiceSoapBinding" name="EchoService">
>
>          <wsdlsoap:address
> location="http://localhost/MockWebService/services/EchoService"/>
>
>       </wsdl:port>
>
>    </wsdl:service>
>
> </wsdl:definitions>
>
>
> The problem I'm having is I couldn't get the WSDL to display whenever I
> access http://localhost:8192/EchoService?wsdl.  All I'm getting is a 404
> page saying it's unable to find the requested resource.  My SA has been
> deployed OK since I can see EchoService when I go to http://localhost:8192.
>
> Was there anything that I missed out doing?  Am I right to think that I
> should be able to see the WSDL via http://localhost:8192/EchoService?wsdl ?  
>
>   
You should use http://localhost:8192/EchoService/main.wsdl for http bc 
consumer.
http://localhost:8192/EchoService?wsdl  is correct when you use cxf bc 
consumer

> Also, later on I'll be putting a camel component in between the http BC's to
> add routing logic:
>
> client -> http bc consumer -> servicemix-camel -> http bc provider ->
> external web service
>
> Is my understanding correct that the camel component should be able to
> "intercept" any request coming from the http consumer as long as I've got my
> from("...") value correct?
>
>   
Yes
Freeman
> Thanks for future clarifications.
>