Bug 815183

Summary: SOAPProcessor doesn't publish WSDL when used with HTTP Gateway
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Tadayoshi Sato <tasato>
Component: JBossESBAssignee: Kevin Conner <kevin.conner>
Status: VERIFIED --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.2.0 GACC: jshepherd, ldimaggi, mbaluch, rwagner, soa-p-jira, tcunning
Target Milestone: ER5   
Target Release: 5.3.0 GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The SOAPProcessor could not publish WSDLs when used in conjunction with the HTTP Gateway. This is because the SOAPProcessor's annotated publisher (JBossWSWebserviceContractPublisher) only implements the ActionContractPublisher but the HTTP Gateway needs the ContractProvider when publishing a WSDL contract.
Story Points: ---
Clone Of:
: 817747 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tadayoshi Sato 2012-04-23 04:17:22 UTC
Description of problem:
Platform BZ for https://issues.jboss.org/browse/JBESB-3789

SOAPProcessor can publish WSDL when it is used with JBR Gateway as demonstrated in webservice_producer. But if it is used with HTTP Gateway, it cannot publish WSDL. (For comparison, SOAPProxy publishes WSDL with both JBR and HTTP gateways.)

The reason is clear that whereas SOAPProxy's annotated publisher (SOAPProxyWsdlContractPublisher) implements ContractProvider interface as well as ActionContractPublisher, SOAPProcessor's annotated publisher (JBossWSWebserviceContractPublisher) implements only ActionContractPublisher. And HTTP Gateway works only with ContractProvider when publishing a WSDL contract.


How reproducible:
Easy

Steps to Reproduce:
1.Pick up the webservice_producer quickstart and substitute its jboss-esb.xml with the below:
<?xml version = "1.0" encoding = "UTF-8"?>
<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd"
    parameterReloadSecs="5">
    <services>
        <service category="MyServiceCategory" name="MyWSProducerService" description="WS Frontend speaks natively to the ESB" invmScope="GLOBAL">
            <listeners>
              <http-gateway name="Http-Gateway" />
            </listeners>
            <actions>
                <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
                    <property name="jbossws-context" value="Quickstart_webservice_producer_esb"/>
                    <property name="jbossws-endpoint" value="GoodbyeWorldWS"/>
                </action>
            </actions>
        </service>
    </services>
</jbossesb>
2.Deploy the quickstart.
3.Look at http://localhost:8080/contract/ and you will find no contract published at MyServiceCategory:MyWSProducerService.
  
Actual results:
WSDL isn't published.

Expected results:
WSDL should be published.

Additional info:
As a workaround, you can use JBR Gateway with HTTP protocol instead.

Comment 1 JBoss JIRA Server 2012-04-24 10:21:52 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

Tadayoshi,

Thanks for reporting this issue. The fix however is not the way as suggested by you. Please mention only the issue and not any suggestion for fix as this could confuse the issue at hand.

Comment 2 JBoss JIRA Server 2012-04-24 12:32:55 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

Tadayoshi,

Thanks for reporting this issue. The fix however may not be the way as suggested by you. Please mention only the issue and not any suggestion for fix as this could confuse the issue at hand.

Comment 3 JBoss JIRA Server 2012-04-26 04:59:46 UTC
Magesh Bojan <mageshbk> updated the status of jira JBESB-3789 to Closed

Comment 4 JBoss JIRA Server 2012-04-26 04:59:46 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

At revision: 38059

Comment 5 Rick Wagner 2012-04-26 14:11:34 UTC
GSS considers this a 'high' priority, it is customer facing.


GSS is asking the customer if they can wait for 5.3 or will require a patch for 5.2.

Either way, we will need this fixed in 5.3.

If a patch is required, we'll open a new BZ for that and will make it part of a Roll up.

Comment 6 JBoss JIRA Server 2012-05-03 04:50:54 UTC
Magesh Bojan <mageshbk> updated the status of jira JBESB-3789 to Reopened

Comment 7 JBoss JIRA Server 2012-05-03 04:50:54 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

Reopening to add this fix to 4.10.CP branch

Comment 8 JBoss JIRA Server 2012-05-03 05:44:10 UTC
Magesh Bojan <mageshbk> updated the status of jira JBESB-3789 to Closed

Comment 9 JBoss JIRA Server 2012-05-03 05:44:10 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

At revision: 38069 on 4_10_CP branch.

Comment 10 JBoss JIRA Server 2012-05-09 08:55:53 UTC
Sato Tadayoshi <tasato> updated the status of jira JBESB-3789 to Reopened

Comment 11 JBoss JIRA Server 2012-05-09 08:55:53 UTC
Sato Tadayoshi <tasato> made a comment on jira JBESB-3789

Reopened because the fix is incomplete.

Comment 12 JBoss JIRA Server 2012-05-09 09:13:07 UTC
Sato Tadayoshi <tasato> made a comment on jira JBESB-3789

Thanks Magesh for quick fixing. But unfortunatelly I tested the fix and found it's not complete.

Explaining based on the reproducing step above, the WSDL contract actually becomes to be published by the fix but the WSDL /definitions/service/port/soap:address/@location (XPath notation for convenience) points to the original Web service (http://127.0.0.1:8080/Quickstart_webservice_producer_esb/GoodbyeWorldWS). What is expected here should be the http-gateway endpoint on ESB (http://127.0.0.1:8080/Quickstart_webservice_producer/http/MyServiceCategory/MyWSProducerService) because otherwise a client ends up calling the original Web service directly.

Comment 13 JBoss JIRA Server 2012-05-09 13:11:06 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

Terribly sorry! Fixed it, let me know any issues before closing it.

At revision: 38081 on 4_10_CP branch
At revision: 38082 on 4_11_CP branch

Comment 14 JBoss JIRA Server 2012-05-09 13:15:48 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

Terribly sorry! Fixed it, let me know any issues before closing it.

At revision: 38081 on 4_11_CP branch
At revision: 38082 on 4_10_CP branch

Comment 15 JBoss JIRA Server 2012-05-14 03:01:49 UTC
Sato Tadayoshi <tadayosi> made a comment on jira JBESB-3789

Magesh, thanks for the prompt correction! It works fine, and you can close it.

Comment 16 JBoss JIRA Server 2012-05-14 05:53:52 UTC
Magesh Bojan <mageshbk> updated the status of jira JBESB-3789 to Closed

Comment 17 JBoss JIRA Server 2012-05-15 04:55:34 UTC
Jason Shepherd <jason> updated the status of jira JBESB-3789 to Reopened

Comment 18 JBoss JIRA Server 2012-05-15 04:55:34 UTC
Jason Shepherd <jason> made a comment on jira JBESB-3789

From a sample, wrapped endpoint URL:

http://myTestServer/myapp-esb/http/myapp?wsdl

I get a WSDL back;

    <wsdl:import location="http://esb.mycompany.cub/schemas/Errors.wsdl"
        namespace="http://css.mycompany.com/ws/errors/v1/">
    </wsdl:import>
    <wsdl:types>
        <xsd:schema xmlns:err="http://css.mycompany.com/ws/errors/v1/"
            xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://css.mycompany.com/ws/sc/myapp/v1/"
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://css.mycompany.com/ws/sc/myapp/v1/"
                schemaLocation="http://myTestServer/myapp-esb-myapp-esb-ws-0.7.0-SNAPSHOT/myapp?xsd=myapp.xsd" />
        </xsd:schema>
    </wsdl:types>

where the original is

    <!-- Base Service Messages -->
    <wsdl:import namespace="http://css.mycompany.com/ws/errors/v1/"
        location="http://esb.mycompany.cub/schemas/Errors.wsdl" />

    <!-- Data types definition -->
    <wsdl:types>
        <xsd:schema>
            <xsd:import namespace="http://css.mycompany.com/ws/sc/myapp/v1/"
                schemaLocation="myapp.xsd" />
        </xsd:schema>
    </wsdl:types>

Comment 19 JBoss JIRA Server 2012-05-15 04:58:28 UTC
Jason Shepherd <jason> made a comment on jira JBESB-3789

From a sample, wrapped endpoint URL:

http://myTestServer/myapp-esb/http/myapp?wsdl

I get a WSDL back with a reference to a schema on the wrapped web service. The schema should be hosted relative to the WSDL, on the ESB instance.

    <wsdl:import location="http://esb.mycompany.cub/schemas/Errors.wsdl"
        namespace="http://css.mycompany.com/ws/errors/v1/">
    </wsdl:import>
    <wsdl:types>
        <xsd:schema xmlns:err="http://css.mycompany.com/ws/errors/v1/"
            xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://css.mycompany.com/ws/sc/myapp/v1/"
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:import namespace="http://css.mycompany.com/ws/sc/myapp/v1/"
                schemaLocation="http://myTestServer/myapp-esb-myapp-esb-ws-0.7.0-SNAPSHOT/myapp?xsd=myapp.xsd" />
        </xsd:schema>
    </wsdl:types>

where the original is

    <!-- Base Service Messages -->
    <wsdl:import namespace="http://css.mycompany.com/ws/errors/v1/"
        location="http://esb.mycompany.cub/schemas/Errors.wsdl" />

    <!-- Data types definition -->
    <wsdl:types>
        <xsd:schema>
            <xsd:import namespace="http://css.mycompany.com/ws/sc/myapp/v1/"
                schemaLocation="myapp.xsd" />
        </xsd:schema>
    </wsdl:types>

Comment 20 JBoss JIRA Server 2012-05-15 07:40:01 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

Jason,

The SOAPProcessor is an action that exposes only Webservice endpoints that are internally hosted in the same container via JBossWS. This JIRA was created to mimic the behavior of JBR gateway in the new HTTP gateway. That has been done along with the endpoint address rewrite. Please do not overwhelm the issue here.

Just rewriting schema urls alone will not work, as such the resources like http://myTestServer/myapp-esb-myapp-esb-ws-0.7.0-SNAPSHOT/myapp?xsd=myapp.xsd do not exist in the server. The schema or WSDL imports will always point to the original Webservice's location only as done by JBR gateway. This needs to be handled in a separate JIRA. This encloses rewriting all JBR, HTTP gateway schema import urls and caching the schemas. Whether this feature will be acceptable or not we need to validate that separately. Users can inline their schema for the time being.

Tadayoshi,

The SOAP1.2 support is not there in SOAPProcessor/SOAPProxy as of now. The linked issue only states one small portion of re-writing that is not happening. That is definitely not related to this schema re-writing issue at all although they may touch the same files.

Comment 21 JBoss JIRA Server 2012-05-22 05:45:41 UTC
Magesh Bojan <mageshbk> updated the status of jira JBESB-3789 to Closed

Comment 22 JBoss JIRA Server 2012-05-22 05:45:41 UTC
Magesh Bojan <mageshbk> made a comment on jira JBESB-3789

Additional issue raised by Jason is handled here JBESB-3802.

Comment 23 David Le Sage 2012-06-14 04:12:15 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The SOAPProcessor could not publish WSDLs when used in conjunction with the HTTP Gateway. This is because the SOAPProcessor's annotated publisher (JBossWSWebserviceContractPublisher) only implements the ActionContractPublisher but the HTTP Gateway needs the ContractProvider when publishing a WSDL contract.

Comment 24 Jason Shepherd 2012-07-05 03:50:49 UTC
There are still outstanding issue with references XSD imported in the WSDL, explained here JBESB-3802. 

Can you address this is SOA-P 5.3 in this issue tracker ticket, or should I open a new one?

Comment 25 tcunning 2012-07-05 11:20:00 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=823711 represents the issues explained in JBESB-3802.

Comment 26 Marek Baluch 2012-07-14 07:28:26 UTC
Verified in SOA 5.3 ER5.

Contracts are now correctly made accessible. For the how-to reproduce case it is accessible via http://127.0.0.1:8080/Quickstart_webservice_producer/http/MyServiceCategory/MyWSProducerService?wsdl.