Anne
On 1/10/06, Duncan Doyle <[EMAIL PROTECTED]> wrote:
Hello,
We are currently using Webmethods Glue 5 as our SOAP interface to our Webservices (which are consumed by multiple .NET applications). We want toget rid of Glue and switch to Axis.
We however have some problems. The .NET applications expect a certain format of SOAP response (which is currently created by Glue) and we can't seem to reproduce this SOAP response with Axis 1.3.
We have a Java Bean which contains the response. This Bean (called ProductResponse) extends a Java Bean called FrameworkReponse (which contains responses that are similar for all our webservices, for example error responses). This FrameworkResponse bean contains 2 arrays of other JavaBeans, namely Error and Message.
Now, when we get an error response (which is contained by our Error bean, which in it's turn is contained by our FrameworkResponse bean) Glue returns the following SOAP message:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/ "
xmlns:n1=" http://services.company.com/product/package/company.framework.webservice.responsemodel /"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<n:getProductResponse xmlns:n="http://company.com/product">
<n:Result>
<errors>
<n1:Error>
<optionalDescription>Lookup error</optionalDescription>
<errorText>Product lookup error</errorText>
<errorID xsi:nil="1"/>
<errorCode>501</errorCode>
</n1:Error>
</errors>
<messages xsi:nil="1"/>
<product xsi:nil="1"/>
</n:Result>
</n:getProductResponse>
</soap:Body>
</soap:Envelope>
The message that Axis generates on the same request looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema "
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getProductResponse xmlns="http://company.com/product ">
<Result>
<errors>
<errors>
<errorCode>501</errorCode>
<errorID xsi:nil="true"/>
<errorText>Lookup error</foutText>
<optionalDescription>Product lookup error</optionalDescription>
</errors>
</errors>
<messages xsi:nil="true"/>
<product xsi:nil="true"/>
</Result>
</getProductResponse>
</soapenv:Body>
</soapenv:Envelope>
As you can see, in the Glue response the <errors> tag encapsulates a <Error> tag (which is the same name as our bean's classname and is in the namespace " http://services.company.com/product/package/company.framework.webservice.responsemodel " . However, in the Axis response the <errors> tag encapsulates another <errors> tag which is in the same namespace as our <getProductResponse>.
The <service> part of my wsdd looks like this:
<service name="ProductService" style="wrapped">
<parameter name="className" value="comany.web.ProductServiceEndPoint "/>
<parameter name="allowedMethods" value="getProduct"/>
<beanMapping qname="example:ProductKey" xmlns:example=" http://comapany.com/product" languageSpecificType="java:company.ProductKey"/>
<beanMapping qname="exampleresp:Result" xmlns:exampleresp="http://company.com/product " languageSpecificType="java:company.web.response.ProductResponse "/><beanMapping qname="respframework:Error" xmlns:respframework=" http://company.com/product/package/company.framework.webservice.responsemodel/ " languageSpecificType="java:company.webservice.responsemodel.Error"/>
<beanMapping qname="respframework:Message" xmlns:respframework=" http://company.com/product/package/company.framework.webservice.responsemodel/" languageSpecificType="java:company.com.framework.webservice.responsemodel.Message"/>
<operation name="getProduct" qname="nsname:getProduct" xmlns:nsname="http://company.com/product"
returnQName="nsname:Result">
<parameter name="key"/>
</operation>
</service>
As you can see, I have defined a bean mapping from my Error bean to an xml entity with the qualified name: "respframework:Error" where "respframework" is "http://company.com/product/package/company.framework.webservice.reponsemodel/ ". So why doesn't Axis use this namespace in the response but the namespace of the getProductResult instead?? And why does Axis not map the Error bean to an <Error> tag (the name of the bean) but to an <errors> tag???
Another question. I have specified the bean mapping of my ProductResponse bean to an xml <Result> element. However, when I do this, the I get an xml <getProductResponse> tag instead of a <Result> tag. I've solved this by specifying this qname in the <operation>, but why do I have to do this? Why doesn't Axis use the specified beanmapping in its reponse SOAP message??
With kind regards,
Duncan Doyle
