Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Java-SCA-1.6
-
None
-
None
-
All
Description
From this thread http://www.mail-archive.com/user@tuscany.apache.org/msg02537.html
For a scenario where a WSDL document is used to generate a reference interface the following is observed.
Composite (I added testRef)
====================
<component name="CalculatorServiceComponent">
<implementation.java class="calculator.CalculatorServiceImpl"/>
<!--implementation.spring
location="META-INF/spring/CalculatorService-context.xml"/-->
<reference name="testRef">
<binding.ws
uri="http://localhost:8080/sample-calculator-ws-webapp/AddServiceComponent"/>
</reference>
<reference name="addService" >
<interface.java interface="calculator.AddService" />
<binding.ws requires="authentication"
uri="http://localhost:8080/sample-calculator-ws-webapp/AddServiceComponent"/>
</reference>
<reference name="subtractService" target="SubtractServiceComponent" />
<reference name="multiplyService" target="MultiplyServiceComponent" />
<reference name="divideService" target="DivideServiceComponent" />
</component>
Implementation ( I extended the calculator's add method)
=========================================
public double add(double n1, double n2)
{ ArrayOfString existingTokens = new ArrayOfString(); existingTokens.addString("XYZ"); existingTokens.addString("ABC"); Login login = new Login(); login.setUserName("SomeUser"); login.setPassword("SomePassword"); login.setExistingTokenIds(existingTokens); testRef.login(login); return addService.add(n1, n2); }Result
=====
The web services binding generates the following message on the wire
POST /sample-calculator-ws-webapp/AddServiceComponent HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
User-Agent: Axis2
Host: localhost:8080
Content-Length: 387
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns2:login xmlns:ns2="http://webservices.soa.mycompany.com/">
<arg0>
<existingTokenIds>
<string>XYZ</string>
<string>ABC</string>
</existingTokenIds>
<password>SomePassword</password>
<userName>SomeUser</userName>
</arg0>
</ns2:login>
</soapenv:Body>
</soapenv:Envelope>
Where <arg0> represents the login object that's passed in.
To take a step closer to your composite I changed mine to configure
the web service binding with the WSDL directly.
Composite (I just changed the reference)
=============================
<reference name="testRef">
<binding.ws
wsdlElement="http://soa.mycompany.com/webservices/#wsdl.port(MyModuleService/MyModuleServiceSoap)"/>
</reference>
Result
=====
Again a message appeared on the wire
POST /MyModuleFacility/MyModuleService.asmx HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://soa.mycompany.com/webservices/Login"
User-Agent: Axis2
Host: localhost:8080
Content-Length: 495
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns3:Login xmlns:ns2="http://webservices.soa.mycompany.com/"
xmlns:ns3="http://soa.mycompany.com/webservices/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="login">
<existingTokenIds>
<string>XYZ</string>
<string>ABC</string>
</existingTokenIds>
<password>SomePassword</password>
<userName>SomeUser</userName>
</ns3:Login>
</soapenv:Body>
</soapenv:Envelope>
Note no <arg0> this time. Seems to be document literal but not
wrapped. Also the xsi:type looks wrong. Not sure why this is
happening.