On Wed, May 26, 2010 at 9:32 AM, Simon Laws <[email protected]> wrote: > On Wed, May 26, 2010 at 9:27 AM, Gregor Kiddie > <[email protected]> wrote: >> >> >> -----Original Message----- >> From: Simon Laws [mailto:[email protected]] >> Sent: 26 May 2010 09:10 >> To: [email protected] >> Subject: Re: Exception with security (again) >> >> On Tue, May 25, 2010 at 7:01 PM, Gregor Kiddie >> <[email protected]> wrote: >>> >>> >>> -----Original Message----- >>> From: Simon Laws [mailto:[email protected]] >>> Sent: 25 May 2010 13:38 >>> To: [email protected] >>> Subject: Re: Exception with security (again) >>> >>>> >>>> Looks like it can't find the SoapAction without it. >>>> >>>> >>>> org.apache.axis2.AxisFault: Server did not recognize the value of HTTP >>>> Header SOAPAction: . >>>> at >>>> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512) >>>> at >>>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370) >>>> at >>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416) >>>> at >>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) >>>> at >>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) >>>> at >>>> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker$1.run(Axis2BindingInvoker.java:172) >>>> at java.security.AccessController.doPrivileged(Native Method) >>>> at >>>> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:170) >>>> at >>>> org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:124) >>>> at >>>> org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationReferencePolicyInterceptor.invoke(BasicAuthenticationReferencePolicyInterceptor.java:85) >>>> at >>>> org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:67) >>>> >>> >>> Hmm, so that's another difference I didn't spot. Looking back at the >>> messages on the wire the binding without wsdl element scenario >>> gives... >>> >>> SOAPAction: "" >>> >>> Simon >>> >>> >>> -- >>> Apache Tuscany committer: tuscany.apache.org >>> Co-author of a book about Tuscany and SCA: tuscanyinaction.com >>> >>> Taking a long hard look at this, it appears that it's Axis2 that's the >>> issue. It can't deal with older WSDL styles. The recommendation is to try >>> Axis 1.4, so I'm going to see if the 1.4 libraries work with Tuscany! >>> >> >> We are on Axis 1.4.1 in the 1.x code base. I raised TUSCANY-3571 to >> track this. I'll look also to see if I can work out precisely what >> causing it to produce different results >> >> Simon >> >> -- >> Apache Tuscany committer: tuscany.apache.org >> Co-author of a book about Tuscany and SCA: tuscanyinaction.com >> >> The libs in Tuscany 1.6 is Axis2 version 1.4.1 >> The library required is Axis version 1.4 >> They are different libraries, rather than different versions! Axis was >> superseded by Axis2 a couple of years ago. It's just unfortunate the version >> numbers currently match ;) >> > > Aaaaaaaaaaaaaah, apologies, I missed the fact that you'd dropped the 2 > off of Axis. > > Simon > > -- > Apache Tuscany committer: tuscany.apache.org > Co-author of a book about Tuscany and SCA: tuscanyinaction.com >
I've taken a slightly different tack. While I'm not getting the IOB you originally posted I can now appreciate how it might come about. I stepped back to the point in the process where I fixed the WSDL to correct the operation name to a lower case "l". So we start with a WSDL which on the face of it seems to be describing a doc/lit/wrapped interface which, looking at the original WSDL, I think should be of the form: LoginResponse Login(username, password, existingTokeIDs) In the soap message the three parameters are "wrapped" up into a Login xml element which follows the operation name. However what wsdl2java actually generated was: LoginResponse login(Login login) Which is a little odd as this looks like a bare interface. Debugging through the code Tuscany does think there is a bare interface involved and I can imagine it's getting confused between the wrapped interface and the bare message. I looked back at wsdl2java and there is a flag that I've not noticed before that allows you to unwrap the parameters -uw. wsdl2java -or -o . -ss -ssi -uw -uri MyModuleService.wsdl I ran this and this does produce an interface of the form LoginResponse Login(username, password, existingTokeIDs) When I run this with a wsdl element on the binding: <binding.ws wsdlElement="http://soa.mycompany.com/webservices/#wsdl.port(MyModuleService/MyModuleServiceSoap)" requires="authentication"/> I see the following SOAP message. POST /MyModuleFacility/MyModuleService.asmx HTTP/1.1 Content-Type: text/xml; charset=UTF-8 SOAPAction: "http://soa.mycompany.com/webservices/Login" User-Agent: Axis2 Authorization: Basic dHVzY2FueXVzZXI6dHVzY2FueXB3ZA== Host: localhost:8080 Content-Length: 1018 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soape nv:Body> <_ns_:Login xmlns:_ns_="http://soa.mycompany.com/webservices/"> <ns3:userName xmlns:ns3="http://soa.mycompany.com/webservices/" xmlns:ns2="http://webservices.soa.mycompany.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SomeUser </ns3:userName> <ns3:password xmlns:ns3="http://soa.mycompany.com/webservices/" xmlns:ns2="http://webservices.soa.mycompany.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">SomePassword </ns3:password> <ns3:existing TokenIds xmlns:ns3="http://soa.mycompany.com/webservices/" xmlns:ns2="http://webservices.soa.mycompany.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="arrayOfString"> <string>XYZ</string> <string>ABC</string> </ns3:existingTokenIds> </_ns_:Login> </soapenv:Body> </soapenv:Envelope> Which looks like a wrapped message and it has the SOAPAction pulled from the WSDL and the basic auth info. I can't say that's what your external service is expecting but it looks to me like the interface that the WSDL is trying to describe. Regards Simon -- Apache Tuscany committer: tuscany.apache.org Co-author of a book about Tuscany and SCA: tuscanyinaction.com
