Almost there. specify serviceName, portName, targetNamespace on the endpoint class. Otherwise, runtime cannot determine the concrete WSDL in the metadata. Hence it is generating one and importing the original wsdl as abstract one.
@WebService(endpointInterface =
"com.o2.portal.fss.connector.jaxws.PortalEaiPortType", serviceName="PortalEaiService", portName="PortalEaiHttpPort", targetNamespace="
http://fss.o2.com/portal/services")
public class PortalEaiPortBugRepImpl implements PortalEaiPortType
In the same forum thread, the above was also mentioned
http://forums.java.net/jive/thread.jspa?forumID=46&threadID=1753&messageID=27692#27692
Jitu
breadfan_at_gmx.de wrote:
>>>From reading the thread, it sounds like you had a WSDL which you
>
>
>>imported that WSDL and then implemented
>>the client and the server. You then tried to publish your endpoint
>>using the EndPoint apis but you did not
>>include the original WSDL in the metadata. You then tried to invoke the
>>published endpoint with the
>>client created from the original WSDL. If this is what you did then
>>you have made some mistakes
>>that may be causing the problems.
>>
>>
>
>Doug you're right, that's what I did. Reading
>http://forums.java.net/jive/thread.jspa?forumID=46&threadID=1753&messageID=27692#27692
>(thanks for the link) and your further comments I now understand why I have
>to set the original wsdl as metadata.
>
>I did this now, but I still get the same error. The generated wsdl is
>returned by http://localhost:8080/jaxws-test/portalEai?wsdl and the original
>wsdl is returned by http://localhost:8080/jaxws-test/portalEai?wsdl=1, so
>the setMetadata-call with the original wsdl seems to have some, but not the
>desired effect. See the complete output below.
>
>The corrected testcase snippet:
>
> PortalEaiPortBugRepImpl portalEaiPortImpl = new
>PortalEaiPortBugRepImpl();
> Endpoint portalEaiEndpoint = Endpoint.create(portalEaiPortImpl);
>
> // use original wsdl
> List<Source> metadata = new ArrayList<Source>();
> String wsdlLoc =
>"E:/prj/o2/o2-sg/sd_area51_3/OcToPuS/modules/fss-connector/test/res/wsdl/proposed-bugrep/portal-eai.wsdl";
> InputStream origWsdl = new FileInputStream(wsdlLoc);
>
> Source source = new StreamSource(origWsdl);
> source.setSystemId(new URL("file://" + wsdlLoc).toExternalForm());
> metadata.add(source);
>
> portalEaiEndpoint.setMetadata(metadata);
>
>portalEaiEndpoint.publish("http://localhost:8080/jaxws-test/portalEai");
>
>Then I point my browser to http://localhost:8080/jaxws-test/portalEai?wsdl:
>
><?xml version="1.0" encoding="UTF-8"?><definitions
>xmlns:tns="http://bugrep.jaxws.server.connector.fss.portal.o2.com/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>xmlns="http://schemas.xmlsoap.org/wsdl/"
>targetNamespace="http://bugrep.jaxws.server.connector.fss.portal.o2.com/"
>name="PortalEaiPortBugRepImplService">
> <import namespace="http://fss.o2.com/portal/services"
>location="http://localhost:8080/jaxws-test/portalEai?wsdl=1"></import>
> <binding xmlns:ns1="http://fss.o2.com/portal/services"
>type="ns1:PortalEaiPortType" name="PortalEaiPortBugRepImplPortBinding">
> <soap:binding style="rpc"
>transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
> <operation name="checkAddress">
> <soap:operation
>soapAction="Portal_Portal2BPM_checkAddress"></soap:operation>
> <input>
> <soap:body namespace="http://fss.o2.com/portal/services"
>use="literal"></soap:body>
> </input>
> <output>
> <soap:body namespace="http://fss.o2.com/portal/services"
>use="literal"></soap:body>
> </output>
> </operation>
> </binding>
> <service name="PortalEaiPortBugRepImplService">
> <port binding="tns:PortalEaiPortBugRepImplPortBinding"
>name="PortalEaiPortBugRepImplPort">
> <soap:address
>location="http://localhost:8080/jaxws-test/portalEai"></soap:address>
> </port>
> </service>
></definitions>
>
>Pointing it to http://localhost:8080/jaxws-test/portalEai?wsdl=1 returns the
>original wsdl:
>
><?xml version="1.0" encoding="UTF-8"?><wsdl:definitions
>xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:tns="http://fss.o2.com/portal/services"
>xmlns:transport="http://fss.o2.com/portal/transport"
>targetNamespace="http://fss.o2.com/portal/services">
> <wsdl:types>
> </wsdl:types>
> <wsdl:message name="checkAddressRequestMsg">
> <wsdl:part type="xsd:string" name="checkAddressRequestPart"></wsdl:part>
> </wsdl:message>
> <wsdl:message name="checkAddressResultMsg">
> <wsdl:part type="xsd:string" name="checkAddressResultPart"></wsdl:part>
> </wsdl:message>
> <wsdl:portType name="PortalEaiPortType">
> <wsdl:operation name="checkAddress">
> <wsdl:input message="tns:checkAddressRequestMsg"></wsdl:input>
> <wsdl:output message="tns:checkAddressResultMsg"></wsdl:output>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding type="tns:PortalEaiPortType" name="PortalEaiBinding">
> <soap:binding style="rpc"
>transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
> <wsdl:operation name="checkAddress">
> <wsdl:documentation>The operation has no
>documentation</wsdl:documentation>
> <soap:operation style="rpc"
>soapAction="Portal_Portal2BPM_checkAddress"></soap:operation>
> <wsdl:input>
> <soap:body namespace="http://fss.o2.com/portal/input"
>parts="checkAddressRequestPart" use="literal"></soap:body>
> </wsdl:input>
> <wsdl:output>
> <soap:body namespace="http://fss.o2.com/portal/output"
>parts="checkAddressResultPart" use="literal"></soap:body>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="PortalEaiService">
> <wsdl:port binding="tns:PortalEaiBinding" name="PortalEaiHttpPort">
> <soap:address
>location="http://tibco13413008:2020/Business__Processes/Adapters/Portal/Inbound/portalEai"></soap:address>
> </wsdl:port>
> </wsdl:service>
></wsdl:definitions>
>
>
>
>>I believe you have two options, 1)
>>include the original wsdl as meta-data when
>>publishing your endpoint, or 2) generate the client from the JAX-WS
>>generated WSDL. I believe your best
>>option in #1.
>>
>>
>
>In one of our use case scenarios we get the WSDL delivered from the service
>implementor and use Jaxws-Server as a (unit/integration) testing and
>stubbing possibility, so option 1 is our only option.
>
>Chris
>
>
>
>