Hi Martin, First, thanks for your reply. With some help here, I did finally figure the problem out and it was more straightforward than I thought, but I'm still not sure why it was the cause.
In axis-generated MyServiceServiceLocator, I had removed the .php ending of the value I supplied for the service address. Restoring this suffix seemed to do the trick. Also, a co-worker here told me about the axis utility tcpmon which came in very handy, letting me see exactly what was being sent back and forth. Thanks again for your help! Rich mgainty wrote: > > your wsdl doesnt generate server side code so lets take a look at > definition > of styles/usage > https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/li > brary/esoa/web-services/The%20Difference%20Between%20RPC%20and%20Document%20 > Style%20WSDL.article > > WSDL 1.2 has dropped use of use="encoding" attribute most probably to > deprecate use of RPC/ENCODED > style/usage > http://osdir.com/ml/text.xml.distributed/2003-03/msg00025.html > > also I read this on PHP users blog about PHP 5.2.2 not working with POSTED > data > http://www.howtoforge.com/forums/showthread.php?t=12986 > > FWIW > Martin-- > ----- Original Message ----- > From: "richever" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Tuesday, April 22, 2008 4:47 PM > Subject: Axis to PHP - getting 406 Not Acceptable error > > >> >> I am trying to replace a Java application with a PHP application. >> Previously, the Java application communicated with our core application, >> also written in Java. These two apps communicated with each other using > Axis >> 1.4. I have defined the php 'server' class, hand wrote the wsdl file and >> I've written a few small php test scripts. Everything seems to work > without >> a problem. >> >> My next step was to use the wsdl2java tool to generate the Java files >> that >> the core Java app would use to communicate with the new php app. I > tweeked >> some code in the core app so that it calls the new wsdl2java files >> instead >> of the ones generated for the previous java app that the php app >> replaces. >> >> However, it just doesn't work. Instead, the client (the axis generated > code >> is what I assume to be the client) keeps generating a '406 not >> acceptable' >> error. Here's a stack trace fragment: >> >> > org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744 > ), >> org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144), >> > org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java: > 32), >> org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118), >> org.apache.axis.SimpleChain.invoke(SimpleChain.java:83), >> org.apache.axis.client.AxisClient.invoke(AxisClient.java:165), >> org.apache.axis.client.Call.invokeEngine(Call.java:2784), >> org.apache.axis.client.Call.invoke(Call.java:2767), >> org.apache.axis.client.Call.invoke(Call.java:2443), >> org.apache.axis.client.Call.invoke(Call.java:2366), >> org.apache.axis.client.Call.invoke(Call.java:1812), >> > com.dm.web.vb.webservice.MyServiceBindingStub.login(MyServiceBindingStub.jav > a:201), >> com.dm.web.forum.VBWSFacade.login(VBWSFacade.java:53), >> com.dm.web.forum.UserFacade.login(UserFacade.java:64) >> ... snip ... >> >> Below is my wsdl document. I'd very much appreciate it if someone could >> give me a hand with this. I'm totally stuck and I can't really move > forward >> at this point. Thanks! >> >> <?xml version ='1.0' encoding ='UTF-8' ?> >> <definitions name='MyService' >> targetNamespace="urn:MyService" >> xmlns:tns="urn:MyService" >> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" >> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" >> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" >> xmlns="http://schemas.xmlsoap.org/wsdl/"> >> >> <types> >> <xsd:schema >> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" >> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" >> xmlns="http://www.w3.org/2001/XMLSchema" >> targetNamespace="urn:MyService"> >> >> <xsd:complexType name="loginResult"> >> <xsd:all> >> <xsd:element name="password" type="xsd:string" /> >> <xsd:element name="userid" type="xsd:int" /> >> </xsd:all> >> </xsd:complexType> >> >> </xsd:schema> >> </types> >> >> <message name="loginRequest"> >> <part name="username" type="xsd:string" /> >> <part name="password" type="xsd:string" /> >> </message> >> >> <message name="loginResponse"> >> <part name="result" type="tns:loginResult" /> >> </message> >> >> <message name="logoutRequest"> >> <part name="input" type="xsd:string"/> >> </message> >> >> <message name="deleteUserRequest"> >> <part name="username" type="xsd:string"/> >> <part name="deletePosts" type="xsd:boolean"/> >> </message> >> >> <message name="deleteUserResponse"> >> <part name="response" type="xsd:boolean"/> >> </message> >> >> <message name="getUserIdRequest"> >> <part name="username" type="xsd:string" /> >> </message> >> >> <message name="getUserIdResponse"> >> <part name="userid" type="xsd:int" /> >> </message> >> >> <message name="getHashRequest"> >> <part name="input" type="xsd:int" /> >> </message> >> >> <message name="getHashResponse"> >> <part name="output" type="xsd:string" /> >> </message> >> >> <portType name="MyService"> >> <operation name="login"> >> <input message="tns:loginRequest" /> >> <output message="tns:loginResponse" /> >> </operation> >> >> <operation name="logout"> >> <input message="tns:logoutRequest" /> >> </operation> >> >> <operation name="deleteUser"> >> <input message="tns:deleteUserRequest"/> >> <output message="tns:deleteUserResponse"/> >> </operation> >> >> <operation name="getUserId"> >> <input message="tns:getUserIdRequest"/> >> <output message="tns:getUserIdResponse"/> >> </operation> >> >> <operation name="getHash"> >> <input message="tns:getHashRequest" /> >> <output message="tns:getHashResponse" /> >> </operation> >> </portType> >> >> <binding name="MyServiceBinding" type="tns:MyService"> >> <soap:binding style="rpc" >> transport="http://schemas.xmlsoap.org/soap/http" /> >> >> <operation name="login"> >> <soap:operation soapAction="urn:MyServiceAction" /> >> >> <input> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </input> >> <output> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </output> >> </operation> >> >> <operation name="logout"> >> <soap:operation soapAction="urn:MyServiceAction" /> >> >> <input> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </input> >> </operation> >> >> <operation name="deleteUser"> >> <soap:operation soapAction="urn:MyServiceAction" /> >> >> <input> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </input> >> <output> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </output> >> </operation> >> >> <operation name="getUserId"> >> <soap:operation soapAction="urn:MyServiceAction" /> >> >> <input> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </input> >> <output> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </output> >> </operation> >> >> <operation name="getHash"> >> <soap:operation soapAction="urn:MyServiceAction" /> >> >> <input> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </input> >> <output> >> <soap:body use="encoded" namespace="urn:MyService" >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >> /> >> </output> >> </operation> >> </binding> >> >> <service name="MyService"> >> <port name="MyService" binding="tns:MyServiceBinding"> >> <soap:address > location="http://localhost/testvb/msoap/MyService.php"/> >> </port> >> </service> >> >> </definitions> >> >> >> >> >> -- >> View this message in context: > http://www.nabble.com/Axis-to-PHP---getting-406-Not-Acceptable-error-tp16826 > 040p16826040.html >> Sent from the Axis - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Axis-to-PHP---getting-406-Not-Acceptable-error-tp16826040p16851068.html Sent from the Axis - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
