users@jax-rpc.java.net

Re: dynamic Proxy Client!

From: Anne Thomas Manes <atmanes_at_gmail.com>
Date: Sat, 12 Nov 2005 09:09:09 -0500

Your WSDL namespace is different from your schema namespace. When
referencing entities from the WSDL, you must use the WSDL namespace. When
referencing entities from your schema, you must use the schema namespace.

Anne

On 11/11/05, Oancea Daniel <doancea_at_gmail.com> wrote:
>
> Hi Anne,
>
> I alter the code on your suggestion and I got the following error message:
>
> Exception in thread "main" could not find service: {
> http://www.test.com/MonitorSvc.xsd1}MonitorSvcService<http://www.test.com/MonitorSvc.xsd1%7DMonitorSvcService>in the specified WSDL file. The service names found were: {
> http://www.test.com/MonitorSvc.wsdl}MonitorSvcService<http://www.test.com/MonitorSvc.wsdl%7DMonitorSvcService>
> at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(
> ServiceInfoBuilder.java:108)
> at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(
> ConfiguredService.java:62)
> at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(
> ConfiguredService.java:48)
> at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(
> ServiceFactoryImpl.java:41)
> at enthrone.dispatcher.snmpMonitor.SOAPClient.main(SOAPClient.java:33)
>
>
> On 11/10/05, Anne Thomas Manes <atmanes_at_gmail.com> wrote:
> >
> > I suspect that the correct namespace is
> > "http://www.test.com/MonitorSvc.xsd1"
> >
> > Anne
> >
> > On 11/10/05, Anne Thomas Manes < atmanes_at_gmail.com> wrote:
> > >
> > > What is the targetNamespace of your schema in the <types> section?
> > > Is it the same as the WSDL tagetNamespace?
> > >
> > > The namespace in your message will be taken from the schema, not from
> > > the WSDL.
> > >
> > > Anne
> > >
> > > On 11/10/05, Oancea Daniel < doancea_at_gmail.com> wrote:
> > > >
> > > > Thanks Anne for your reply.
> > > >
> > > > I think I'm using the right one! Here is another snippet from my
> > > > description:
> > > >
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > <wsdl:definitions
> > > > name="MonitorSvc"
> > > > targetNamespace="http://www.test.com/MonitorSvc.wsdl"
> > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > > xmlns:tns="http://www.test.com/MonitorSvc.wsdl"
> > > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > > xmlns:xsd1="http://www.test.com/MonitorSvc.xsd1">
> > > > .............................................................
> > > >
> > > > In my client I put something like:
> > > >
> > > > ....................................
> > > >
> > > > private static String serviceName = "MonitorSvcService";
> > > > private static String qPortName = "MonitorSvcPort";
> > > > private static String url = "http://localhost:8081/MonitorSvc/Alarm
> > > > ";
> > > > private static String uriName = "http://www.test.com/MonitorSvc.wsdl
> > > > ";
> > > >
> > > > public static void main(String[] args) {
> > > >
> > > > StringBuffer buffer = new StringBuffer(url);
> > > > buffer.append("?WSDL");
> > > >
> > > > try {
> > > > URL wsdlURL = new URL(buffer.toString());
> > > > ServiceFactory factory = ServiceFactory.newInstance();
> > > > QName qName = new QName(uriName,serviceName);
> > > > Service service = factory.createService(wsdlURL,qName);
> > > > MonitorSvc myproxy = (MonitorSvc)service.getPort(new
> > > > QName(uriName,qPortName),MonitorSvc.class);
> > > > .............................................
> > > >
> > > > The SEI it was generated using the -import option in wscompile tool:
> > > > wscompile -import -d . -nd . -f:norpcstructures config-wsdl.xml
> > > >
> > > > Something is wrong but I can not figure what it is.
> > > >
> > > >
> > > > On 11/9/05, Anne Thomas Manes <atmanes_at_gmail.com > wrote:
> > > > >
> > > > > Are you sure you're using the correct namespace?
> > > > >
> > > > > On 11/9/05, Oancea Daniel < doancea_at_gmail.com> wrote:
> > > > > >
> > > > > > Hi everybody,
> > > > > >
> > > > > > I try to develop a jax-rpc client using dynamic proxy client and
> > > > > > I got the fallowing error:
> > > > > >
> > > > > > Exception in thread "main" port: {http://www.test.com/MonitorSvc.wsdl}MonitorSvcPort
> > > > > > <http://www.test.com/MonitorSvc.wsdl%7DMonitorSvcPort> does not
> > > > > > contain operation: raiseAlarm
> > > > > > at com.sun.xml.rpc.client.dii.ConfiguredCall.configureCall(
> > > > > > ConfiguredCall.java:98)
> > > > > >
> > > > > > .........................................................................................................................
> > > > > >
> > > > > > here is a snippet from my WSDL description:
> > > > > > ................................................
> > > > > > <wsdl:portType name="MonitorSvc">
> > > > > > <wsdl:operation name="raiseAlarm">
> > > > > > <wsdl:input message="tns:raiseAlarmRequest"/>
> > > > > > <wsdl:output message="tns:raiseAlarmResponse"/>
> > > > > > </wsdl:operation>
> > > > > > </wsdl:portType>
> > > > > > <wsdl:binding name="MonitorSvcBinding" type="tns:MonitorSvc">
> > > > > > <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/
> > > > > > <http://schemas.xmlsoap.org/soap/http%22/>>
> > > > > > <wsdl:operation name="raiseAlarm">
> > > > > > <soap:operation soapAction="raiseAlarm" style="document"/>
> > > > > > <wsdl:input>
> > > > > > <soap:body parts="raiseRequest" use="literal"/>
> > > > > > </wsdl:input>
> > > > > > <wsdl:output>
> > > > > > <soap:body parts="raiseResponse" use="literal"/>
> > > > > > </wsdl:output>
> > > > > > </wsdl:operation>
> > > > > > </wsdl:binding>
> > > > > > <wsdl:service name="MonitorSvcService">
> > > > > > <wsdl:port binding="tns:MonitorSvcBinding"
> > > > > > name="MonitorSvcPort">
> > > > > > <soap:address location="http://localhost:8081/MonitorSvc/Alarm"/<http://localhost:8081/MonitorSvc/Alarm%22/>
> > > > > > >
> > > > > > </wsdl:port>
> > > > > > </wsdl:service>
> > > > > >
> > > > > > what I'm doing wrong here? (why doesn't recognize raiseAlarm
> > > > > > operation?)
> > > > > >
> > > > > > Any suggestion is overcome! thanks
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>