Thanks Willem.
Ok, that morphed the exception into:
javax.xml.ws.WebServiceException: Port {urn:srv}PfC not found.
My wsdl2java generated PfC_PfC_Client.java file records it as:
private static final QName SERVICE_NAME = new
QName("urn:srv", "PfCService");
I'm guessing I've screwed up my original java2wsdl and wsdl2java
commands somehow?
I started with a PfC java interface file with the package line:
package au.net.mmsn.pfc.servlet.pfcws;
Built the wsdl as:
SERVICE=PfC
SPACKAGE="au.net.mmsn.pfc.servlet.pfcws"
${CXF}/bin/java2wsdl -verbose -o ${SERVICE}.wsdl -d . -s ./jaxws \
-classdir ./jaxws \
-cp ./jaxws \
-servicename "${SERVICE}Service" \
-portname "${SERVICE}" \
${SPACKAGE}.${SERVICE}
built the client as:
CPACKAGE=au.net.mmsn.pfc.client.pfcws
${CXF}/bin/wsdl2java -verbose -client \
-compile \
-classdir ${CPROJBIN} \
-impl \
-d ${CPROJSRC} \
-p ${CPACKAGE} \
${SERVICE}.wsdl
and server as:
SPACKAGE="au.net.mmsn.pfc.servlet.pfcws"
${CXF}/bin/wsdl2java -verbose -server \
-compile \
-classdir ${SPROJBIN} \
-impl \
-d ${SPROJSRC} \
-p ${SPACKAGE} \
${SERVICE}.wsdl
Thanks again
Doug
On Wednesday 22 August 2007 14:11, Willem Jiang wrote:
> The Service QName should be
>
> QName SERVICE = new QName("http://impl.serbices.servlet.pfc.mmsn.net.au/
> ", "PfCServicesImplService");
>
>
> Willem.
>
> doug wrote:
> > I get the following WSDL, but I am not sure exactly what the Service
> > QName should be trying to match.
> > Thanks
> > Doug
> >
> > <wsdl:definitions name="PfCServicesImplService"
> > targetNamespace="http://impl.serbices.servlet.pfc.mmsn.net.au/">
> > <wsdl:import
> > location="http://192.168.98.46:8080/pfc/services/PfC?wsdl=PfC.wsdl"
> > namespace="urn:srv"/>
> > <wsdl:binding name="PfCServicesImplServiceSoapBinding" type="ns1:PfC">
> > <soap:binding style="document"
> > transport="http://schemas.xmlsoap.org/soap/http"/>
> > <wsdl:operation name="getApplicationPushletIDs">
> > <soap:operation soapAction="" style="document"/>
> >
> > [snip]
> >
> > </wsdl:binding>
> > <wsdl:service name="PfCServicesImplService">
> > <wsdl:port binding="ns2:PfCServicesImplServiceSoapBinding"
> > name="PfCServicesImplPort">
> > <soap:address location="http://192.168.98.46:8080/pfc/services/PfC"/>
> > </wsdl:port>
> > </wsdl:service>
> > </wsdl:definitions>
> >
> > On Wednesday 22 August 2007 13:10, Willem Jiang wrote:
> >> Hi
> >> It looks like the Service Name is not a right one from the exception's
> >> message.
> >> Please check the Service QName with the wsdl which you get from the
> >>
> >> http://192.168.98.46:8080/pfc/services/PfC?wsdl
> >>
> >>
> >> Willem.
> >>
> >> doug wrote:
> >>> Hi,
> >>> I think I have my server set up ok because if I visit this page:
> >>> http://192.168.98.46:8080/pfc/services/
> >>> I get a list of the services I implemented:
> >>>
> >>> {http://impl.chat.serbices.servlet.pfc.mmsn.net.au/}ChatServiceImplPort
> >>> {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileImplPort
> >>> {http://impl.imageshare.serbices.servlet.pfc.mmsn.net.au/}ImShServiceIm
> >>>pl Port
> >>> {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileSystemImp
> >>>lP ort
> >>> {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileIOImplPor
> >>>t {http://impl.serbices.servlet.pfc.mmsn.net.au/}PfCServicesImplPort
> >>>
> >>> The last one is a link to
> >>> http://192.168.98.46:8080/pfc/services/PfC?wsdl and serves up the
> >>> appropriate wsdl description of the PfC interface.
> >>>
> >>> The problem is that when I try to get a handle on the PfC interface
> >>> from within my client applet, I end up with the error:
> >>>
> >>> org.apache.cxf.service.factory.ServiceConstructionException:
> >>> Could not find definition for service {urn:srv}PfCService.
> >>>
> >>> I used the following client side code (both the client and server side
> >>> service code were generated from wsdl2java):
> >>>
> >>> serviceAddress = "http://" + (String)configOpts.get("hostName") + ":"
> >>> + (String)configOpts.get("port") + serviceURI +"?wsdl";
> >>> // i.e. http://192.168.98.46:8080/pfc/services/PfC?wsdl
> >>> URL url = new URL(serviceAddress);
> >>> QName SERVICE = new QName("urn:srv", "PfCService");
> >>> PfCService service = new PfCService(url, SERVICE );
> >>> PfC pfc = service.getPfC();
> >>>
> >>> Sorry, I am new to all this, so likely I am doing something foolish.
> >>> Hope this is enough to work from.
> >>> Thanks for any insights
> >>> Doug