axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Wibbels" <Martin.Wibb...@telin.nl>
Subject RE: Error: Method not allowed
Date Wed, 28 Apr 2004 11:08:00 GMT
First of all: if I do wsdl2java on 'your' WSDL, I get (amongst others) a
class nl.lifeline.www.wsdl.vz33_vz34.Vz33Vz34PortType and 
nl.lifeline.www.wsdl.vz33_vz34.Vz33Vz34Locator. They save you the
trouble of creating Service and Stub instances yourself. So accessing 
the server would then go like this:

import nl.lifeline.www.wsdl.vz33_vz34.*;

<...>

Vz33Vz34BindingStub vz_stub = (Vz33Vz34BindingStub)new
Vz33Vz34Locator().getVz33Vz34();
vz_stub.setUsername("...");
vz_stub.setPassword("...");

BerichtInformatie bi = ...

try {
	result = vz_stub.vz33(bi);
}
catch(RemoteException e) {
	e.printStackTrace();
}

The setUsername and setPassword stuff is ok, but depending on the
authentication scheme you're using you may have to set an Authenticator
(java.net.Authenticator). 

Wrt to the error message: it seems that the lifeline people are running
their webservice behind a proxy and that the proxy is unable to connect
to the actual webservice. Seems like something that they should be
sorting out (just type the URL of the webservice in a browser, you'll
see the same type of error message).

Regards,
 
Martin


> -----Original Message-----
> From: info@calculus-software.nl [mailto:info@calculus-software.nl] 
> Sent: Wednesday, April 28, 2004 12:36
> To: axis-user@ws.apache.org
> Subject: RE: Error: Method not allowed
> 
> 
> Thanks Martin,
> 
> That helps a bit.
> Why do I always see the xxService = xxServiceLocator() in the 
> examples, but I don't see them in my project when generating 
> the code with wsdl2java?
> 
> Anyway, my 'main' looks like:
>    public static void main(String[] args)
>       throws AxisFault, MalformedURLException, ServiceException
>    {
>       String lifeline_wsdl = 
> "https://www.lifeline.nl/wsdl/vz33-vz34/";
>       String lifeline_serv = 
> "https://www.lifeline.nl/webservices/vz33-vz34";
>       String COV = lifeline_wsdl;
> 
>       java.net.URL URL_wsdl = new java.net.URL(lifeline_wsdl);
>       java.net.URL URL_serv = new java.net.URL(lifeline_serv);
> 
>       String targetNamespace = lifeline_wsdl;
>       QName servQN = new QName(targetNamespace, "vz33-vz34");
>       QName portQN = new QName(targetNamespace, "vz33-vz34");
> 
>       Service VIPservice = new 
> org.apache.axis.client.Service(URL_wsdl,
> servQN);
> 
>       BerichtInformatie bi = new BerichtInformatie();
>       bi.setCodeExterneIntegratie(1);
>       bi.setDatumAanvraag(new Date());
>       bi.setReferentienummerAanvrager(new Integer(1020818));
>       bi.setRetourneerNAWGegevens(true);
>       bi.setSessienummer("1");
>       bi.setVersienummer(0);
> 
>       VerzekerdenGegevens[] vg = new VerzekerdenGegevens[1];
>       VerzekerdenGegevens vgone = new VerzekerdenGegevens();
> 
>       vg[0] = vgone;
>       vgone.setCodeZorgverzekeraar(7100);
>       vgone.setVerzekerdenNummer("");
>       vgone.setPatientidentificatieZorgverlener("");
> 
>       Calendar cal = Calendar.getInstance();
>       cal.set(1970, 12, 31);
>       vgone.setGeboortedatum(cal.getTime());
>       vgone.setPostcode("2211EB");
>       vgone.setHuisnummer(2);
>       vgone.setHuisnummerToevoeging("");
> 
>       bi.setVerzekerden(vg);
> 
>       Vz33Vz34BindingStub vz_stub = new 
> Vz33Vz34BindingStub(URL_serv, VIPservice);
>       vz_stub.setUsername("??");
>       vz_stub.setPassword("??");
> 
>       nl.lifeline.www.schemas.vz34.BerichtInformatie result = null;
> 
>       try
>       {
>          result = vz_stub.vz33(bi);
>       }
>       catch(RemoteException e)
>       {
>          // TODO Auto-generated catch block
>          e.printStackTrace();
>       }
> 
>       if(result != null)
>       {
>          System.out.println(result.toString());
>       }
>    }
> 
> Now I am still having problems.
> The proxy server received an invalid
> response from an upstream server.&lt;P&gt;
> The proxy server could not handle the request &lt;EM&gt;&lt;A 
> HREF=&quot;/webservices/vz33-vz34&quot;&gt;POST&amp;nbsp;/webs
> ervices/vz33-vz34&lt;/A&gt;&lt;/EM&gt;.&lt;P&gt;
> Reason: &lt;STRONG&gt;Could not connect to remote machine: 
> Connection refused&lt;/STRONG&gt;&lt;P&gt;
> 
> Another question: is
>       vz_stub.setUsername("??");
>       vz_stub.setPassword("??");
> correct to set the 'header message'?
> 
> Thanks in advance, Stephan
> 
> > Stephan,
> >
> > As you can see in the WSDL the URL of the service is 
> > 'https://www.lifeline.nl/webservices/vz33-vz34' (specified in the 
> > <Service> element), your Axis client is POSTing to 
> > https://www.lifeline.nl/wsdl/vz33-vz34/ which is the URL of 
> the WSDL 
> > itself. POSTing to a WSDL file is of course not allowed. So please 
> > check if you use the correct URL to access the service. 
> Somewhere you 
> > should be doing something like:
> >
> > xxxServices xxxService = new xxxServiceLocator().getxxxService();
> >
> > or
> >
> > xxxServices xxxService = new xxxServiceLocator().getxxxService(new
> > URL("..."));
> >
> > In the first case check URL in the generated source of 
> > xxServiceLocator.java, in the second case check the URL that you're 
> > specifying yourself.
> >
> > Regards,
> >
> > Martin
> >
> >
> >> -----Original Message-----
> >> From: info@calculus-software.nl [mailto:info@calculus-software.nl]
> >> Sent: Wednesday, April 28, 2004 11:26
> >> To: axis-user@ws.apache.org
> >> Subject: Re: Error: Method not allowed
> >>
> >>
> >> Leo,
> >>
> >> How can I check SSL authentication?
> >> Why did you switch to WASP, instead of axis?
> >> I am planning to develop similar client-software for VECOZO (and 
> >> Infomedics) as well! I already have the VECOZO 
> key-certificate info.
> >>
> >> Client-applications are to be distributed to Dutch 
> >> general-practitioners
> >> (huisartsen) who can check insurance-status ot their patients.
> >>
> >> I consider myself as a newbie in programming web-services. 
> Any change 
> >> you can help me with examples of client-applications?
> >>
> >> Regards, Stephan
> >> > Stephan,
> >> >
> >> > Since the URL of the webservice is HTTPS, are you sure the SSL
> >> authentication goes ok ? By the way we developed simular 
> webservices
> >> > for VECOZO using the same standards. We
> >> > originally used axis as well but since a few weeks ago
> >> switched to using
> >> > WASP.
> >> >
> >> > Sincere greetz
> >> > Leo de Blaauw
> >> > IZA
> >> >
> >> > ----- Original Message -----
> >> > From: <info@calculus-software.nl>
> >> > To: <axis-user@ws.apache.org>
> >> > Sent: Wednesday, April 28, 2004 10:16 AM
> >> > Subject: Error: Method not allowed
> >> >
> >> >
> >> >> Hi,
> >> >>
> >> >> I am building a client-application.
> >> >> I am using Eclipse with Apache-axis.
> >> >> A WSDL is hosted by a server:
> >> https://www.lifeline.nl/wsdl/vz33-vz34/
> >> >>
> >> >> I used WSDL2java to generate a stub.
> >> >> Running my application always gives me the message:
> >> >> 'The requested method POST is not allowed for the URL 
> >> >> /wsdl/vz33-vz34/'
> >> >>
> >> >> Is this a problem on my client, or is it a problem on the
> >> server. For
> >> >> those interested, I can provide you with my 'main'
> >> >>
> >> >> Thanks, Stephan Borst (The Netherlands)
> >>
> >>
> >>
> >>
> >
> >
> > begin 666 Martin Wibbels.vcf 
> > M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..E=I8F)E;',[36%R=&EN#0I&
> > M3CI-87)T:6X@5VEB8F5L<PT*3U)'.E1E;&5M871I8V$@26YS=&ET=75T#0I4
> > M14P[5T]22SM63TE#13HK,S$@*# 
> I-3,@-#@U,#0V-0T*5$5,.U=/4DL[1D%8 M.BLS,2 
> > H,"DU,R T.#4P-# P#0I!1%([5T]22SH[2#0T-#M0+D\N($)O>" U 
> > M.#D[16YS8VAE9&4[.S<U,# @04X[3D542$523$%.1%,-"DQ!0D5,.U=/4DL[
> > M14Y#3T1)3D<]455/5$5$+5!224Y404),13I(-#0T/3!$/3!!4"Y/+B!";W@@
> > M-3@Y/3!$/3!!16YS8VAE9&4L(#<U,# @04X],$0],$%.151(15),04Y$4PT* 
> > M14U!24P[4%)%1CM)3E1%4DY%5#I-87)T:6XN5VEB8F5L<T!T96QI;BYN; T* 
> > A4D56.C(P,#(Q,# W5# X-3<U-UH-"D5.1#I60T%21 T* `
> > end
> 
> 
> 
> 


Mime
View raw message