0 Replies Latest reply on Jan 27, 2016 6:08 AM by AM-Oracle

    Namespace not matching in WLS Published WSDL for JAX-WS RPC Style webservice

    AM-Oracle

      After deploying a JAX-WS, RPC Style webservice, the WSDL published in Weblogic server 12.1.3 does not corresponds to initial WSDL. The namespace in is not matching.

      ISSUE:

      Initial WSDL Contains:

      <soap12:body parts="helloReq" use="literal" namespace=""/> 

      Published WSDL Contains:

      <soap12:body use="literal" namespace="http://sample"/> 

      Due to this, inappropriate SOAP Request is getting formed which is throwing error on invocation : "Cannot find dispatch method for {}hello".

      Initial WSDL:

      <?xml version="1.0" encoding="UTF-8"?> 

       

      <?xml version="1.0" encoding="UTF-8"?>

      <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"

        xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"

        xmlns:tns="http://sample" targetNamespace="http://sample">

       

       

        <types>

        <xsd:schema targetNamespace="http://sample">

       

       

        <xsd:complexType name="hello">

        <xsd:sequence>

        <xsd:element type="xsd:string" name="input" />

        </xsd:sequence>

        </xsd:complexType>

        <xsd:complexType name="helloResponse">

        <xsd:sequence>

        <xsd:element type="xsd:string" name="output" />

        </xsd:sequence>

        </xsd:complexType>

       

       

        </xsd:schema>

       

       

        </types>

       

       

        <message name="hello">

        <part name="helloReq" type="tns:hello" />

        </message>

        <message name="helloResponse">

        <part name="helloRes" type="tns:helloResponse" />

        </message>

       

       

        <portType name="HelloServicePort">

        <operation name="hello">

        <input message="tns:hello" />

        <output message="tns:helloResponse" />

        </operation>

        </portType>

       

       

        <binding type="tns:HelloServicePort" name="HelloServicePort">

        <soap12:binding style="rpc"

        transport="http://schemas.xmlsoap.org/soap/http" />

        <operation name="hello">

        <soap12:operation style="rpc" soapAction="" />

        <input>

        <soap12:body parts="helloReq" use="literal" namespace="" />

        </input>

        <output>

        <soap12:body parts="helloRes" use="literal" namespace="" />

        </output>

        </operation>

        </binding>

       

       

        <service name="HelloService">

        <port name="HelloServicePort" binding="tns:HelloServicePort">

        <soap12:address location="http://localhost:7201/hello/HelloService" />

        </port>

        </service>

      </definitions>

       

      Published WSDL:

      <!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS

        RI 2.2.10-b140319.1121 svn-revision#7b34660d6bc70e587e8ec81a17e4d76af68816a6. -->

      <!-- Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS

        RI 2.2.10-b140319.1121 svn-revision#7b34660d6bc70e587e8ec81a17e4d76af68816a6. -->

      <definitions

        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"

        xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"

        xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"

        xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://sample"

        xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"

        targetNamespace="http://sample" name="HelloService">

        <types>

        <xsd:schema>

        <xsd:import namespace="http://sample"

        schemaLocation="http://localhost:7022/hello/jaxws/HelloService?xsd=1" />

        </xsd:schema>

        </types>

        <message name="hello">

        <part name="helloReq" type="tns:hello" />

        </message>

        <message name="helloResponse">

        <part name="helloRes" type="tns:helloResponse" />

        </message>

        <portType name="HelloServicePort">

        <operation name="hello">

        <input wsam:Action="http://sample/HelloServicePort/helloRequest"

        message="tns:hello" />

        <output wsam:Action="http://sample/HelloServicePort/helloResponse"

        message="tns:helloResponse" />

        </operation>

        </portType>

        <binding name="HelloServicePortBinding" type="tns:HelloServicePort">

        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"

        style="rpc" />

        <operation name="hello">

        <soap12:operation soapAction="" />

        <input>

        <soap12:body use="literal" namespace="http://sample" />

        </input>

        <output>

        <soap12:body use="literal" namespace="http://sample" />

        </output>

        </operation>

        </binding>

        <service name="HelloService">

        <port name="HelloServicePort" binding="tns:HelloServicePortBinding">

        <soap12:address location="http://localhost:7022/hello/jaxws/HelloService" />

        </port>

        </service>

      </definitions>

       

      Is this the default behavior or a bug in JAX-WS? Is there any workaround to make this work without changing the wsdl?

      Please share some pointers.

      Thanks.