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/07/08 07:21:57 UTC

Re: WSDL service location not being rewritten for http:soap-* on Tomcat.

After digging through the source codes I found that the issue was in the
HttpSoapConsumerEndpoint.java class.  In my case I specified in my xbean
consumer definition that I wanted to use a wsdl file located in the
classpath.  The service address location of my consumer wsdl doesn't get
rewritten because of one line in the code.

The problem was in the validateWsdl1() method which gets called in the
activate() method.  There was one line there that sets the value of the
service location address to be the same as the locationURI value specified
in the xbean.xml file:


SOAPAddress soapAddress = WSDLUtils.getExtension(port, SOAPAddress.class);
        if (soapAddress != null) {
            // this line overwrite's the WSDL's original soap service
location.
            //soapAddress.setLocationURI(getLocationURI());

        } else {
            SOAP12Address soap12Address = WSDLUtils.getExtension(port,
SOAP12Address.class);
            if (soap12Address != null) {
                soap12Address.setLocationURI(getLocationURI());
            }
        }

>From the code above I've commented the
soapAddress.setLocationURI(getLocationURI()) line.  This allows whatever
value I specified in the wsdl file's service address url to be maintained
and not be overwritten by the locationURI value.  In my wsdl file I had to
specify the service location url to include the
"http://.../apache-servicemix-3.3-web/jbi/..."

Of course I had to rename the original apache-servicemix-3.3-web war file to
something else so that when it gets deployed in tomcat I could use the new
name to access the service endpoints.

example:    http://.../myproject/jbi/...



angeloNZ wrote:
> 
> Can anybody help with this apparent bug?  I experimented with using
> <http:endpoint> instead of <http:soap-*> and the wsdl service location
> value is being rewritten properly as well as the locationURI value of the
> consumer.  So this might be a bug with the http:soap endpoints.  I hope
> this could be fixed quickly as I really want to use the http:soap-*
> components.
> 
> 
> angeloNZ wrote:
>> 
>> Hi,
>> 
>> I'm experiencing a strange behavior on how the URL of my services are
>> being rewritten when running ServiceMix 3.3 on Tomcat.
>> 
>> In xbean.xml I have this definition:
>> <http:soap-consumer service="treis:FeedServiceConsumer"                  
>> endpoint="FeedServiceConsumerPort"                                                                                                                                                                                              
>>                  locationURI="http://localhost:8080/SOAP/FeedService/"
>>                  targetService="treis:CamelSOAPService"
>>                  wsdl="classpath:TreisFeedServiceConsumer.wsdl">
>> </http:soap-consumer>
>> 
>> here's an excerpt from TreisFeedServiceConsumer.wsdl:
>> <wsdl:service name="FeedServiceConsumer">
>>     <wsdl:port binding="impl:FeedServiceConsumerPortBinding"
>> name="FeedServiceConsumerPort">
>>       <wsdlsoap:address
>> location="http://localhost:8080/SOAP/FeedService"/>
>>     </wsdl:port>
>>   </wsdl:service>
>> 
>> I've renamed apache-servicemix-web-3.3.war to info.war to change the
>> context path.  I can then see the list of exposed services via
>> http://localhost:8080/info/jbi.  In this page I can see that my
>> soap-consumer endpoint is being displayed as
>> http://localhost:8080/info/jbi/SOAP/FeedService/ which is what I
>> expected.
>> 
>> However, when I view the wsdl by clicking on the link and then check the
>> value of the "location" attribute I noticed that it wasn't rewritten.  It
>> remained as "http://localhost:8080/SOAP/FeedService".  
>> 
>> I was expecting it to be http://localhost:8080/info/jbi/SOAP/FeedService. 
>> This is a problem as requests are sent to the wrong endpoint.  
>> 
>> Any idea why this is happening?  Would editing the wsdl file with the
>> correct 'location" value after I've
>> deployed the service assembly be a workaround for this?  Thanks for your
>> inputs.
>> 
>> As an experiment, I changed my xbean's locationUri value to
>> "http://localhost:8080/info/jbi/SOAP/FeedService".  After redeploying and
>> checking the jbi page the link shows as
>> "http://localhost:8080/info/jbi/info/jbi/SOAP/FeedService" where
>> "info/jbi" was repeated.  Oddly enough, when I checked the wsdl, the
>> location value is now correct:
>> 
>> http://localhost:8080/info/jbi/SOAP/FeedService.
>> 
>> What is going on?
>> 
>> 
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/WSDL-service-location-not-being-rewritten-for-http%3Asoap-*-on-Tomcat.-tp23957752p24385509.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.