I've to provide a .jsp page(index.jsp) along with my Web Service project for testing purpose.
Basically the .jsp page has a textarea, for reading a soap request as a string & on submitting it the soap response will come.
I tried it with "javax.xml.ws.Service & Dispatch" class, it's working fine.
But now I'm asked for a javascript/ajax based code.
Can anybody help me regarding this.
I'm giving a sample .wsdl file here :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://zensar.com/greeting" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Greeting"
xmlns:grtng="http://zensar.com/greeting/schema"
targetNamespace="http://zensar.com/greeting">
<wsdl:types>
<xsd:schema targetNamespace="http://zensar.com/greeting">
<xsd:import namespace="http://zensar.com/greeting/schema"
schemaLocation="Greeting.xsd"></xsd:import>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GreetingRequest">
<wsdl:part element="grtng:GreetingRequest" name="GreetingRequest" />
</wsdl:message>
<wsdl:message name="GreetingResponse">
<wsdl:part element="grtng:GreetingResponse" name="GreetingResponse" />
</wsdl:message>
<wsdl:portType name="GreetingPort">
<wsdl:operation name="Greeting">
<wsdl:input message="tns:GreetingRequest" />
<wsdl:output message="tns:GreetingResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Greeting" type="tns:GreetingPort">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Greeting">
<soap:operation soapAction="http://zensar.com/GreetingWS/Greeting" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Greeting">
<wsdl:port binding="tns:Greeting" name="Greeting">
<soap:address location="http://localhost:8085/Greeting/services" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>**
Personally, I'd say consuming the web service directly through javascript is a bit masochistic.
In my opinion it'd be much easier for the javascript to call a server side method (with whatever architecture that may be, c#, java, php etc) then do a CURL request and send the response back to the front end.
Writing out a soap endpoint by hand in javascript just seems pointless when you could use something like Axis2 at the server side to do the boiler plate heavy loading of the SOAP handshake.
You can try this ... http://www.ibm.com/developerworks/webservices/library/ws-wsajax/
This article explains everything in detail.
Related
I created WSDL file in Altora XMLSpay and I whant created Web service in Netbeans (Web servicies from WSDL...) but always when add .wsdl file Netbeans write that "There is no service in specified WSDL file." Can you help me? What's wrong with my wsdl documnet?
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://new.webservice.namespace" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://new.webservice.namespace">
<wsdl:types>
<xs:schema targetNamespace="http://new.webservice.namespace" elementFormDefault="qualified"/>
</wsdl:types>
<wsdl:message name="NewMessageRequest">
<wsdl:part name="parameter" type="xs:string"/>
</wsdl:message>
<wsdl:message name="NewMessageResponse">
<wsdl:part name="parameter" type="xs:string"/>
</wsdl:message>
<wsdl:portType name="GetDbStatus">
<wsdl:operation name="OpenDB">
<wsdl:input message="tns:NewMessageRequest"/>
<wsdl:output message="tns:NewMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GetDbStatusBinding" type="tns:GetDbStatus">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="OpenDB">
<soap:operation soapAction="urn:#NewOperation"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Test_Wsdl">
<wsdl:port name="GetDbstatusPort" binding="tns:GetDbStatusBinding">
<soap:address location="http://localhost:8080/mpo_getdbstatus/GetDbStatus"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I think your problem in your wsdl
GetDbStatusBinding
The part of the message 'NewMessageRequest' references a schema type instead of a schema element.
The part of the message 'NewMessageResponse' references a schema type instead of a schema element.
It helped me but I have another error:
[ERROR] Schema descriptor {http://www.w3.org/2001/XMLSchema}string in message part "messageReq" is not defined and could not be bound to Java. Perhaps the schema descriptor {http://www.w3.org/2001/XMLSchema}string is not defined in the schema imported/included in the WSDL. You can either add such imports/includes or run wsimport and provide the schema location using -b switch.
line 8 of file:/C:/.../.../mpo_getdbstatus/src/conf/xml-resources/web-services/NewWebServiceFromWSDL/wsdl/mpo_getdbstatus_wsdl.wsdl
C:......\mpo_getdbstatus\nbproject\jaxws-build.xml:31: Error starting wsimport: null
<wsimport sourcedestdir="${build.generated.dir}/jax-wsCache/service/NewWebServiceFromWSDL" destdir="${build.generated.dir}/jax-wsCache/service/NewWebServiceFromWSDL" wsdl="${basedir}/${conf-dir}xml-resources/web-services/NewWebServiceFromWSDL/wsdl/mpo_getdbstatus_wsdl.wsdl" catalog="catalog.xml" encoding="${source.encoding}" extension="true" verbose="true" fork="false" xnocompile="true" xendorsed="true">
<depends file="${basedir}/${conf-dir}xml-resources/web-services/NewWebServiceFromWSDL/wsdl/mpo_getdbstatus_wsdl.wsdl"/>
<produces dir="${build.generated.dir}/jax-wsCache/service/NewWebServiceFromWSDL"/>
</wsimport>
I've got this wsdl supplied for a SOAP 1.1, once I try to generate my java code using wsimport, it handles the wsdl as being 1.2. Which subsiquentially throws an error:
com.sun.tools.ws.wsdl.framework.ParseException: invalid extension element: "soap:body" (in namespace "http://schemas.xmlsoap.org/wsdl/soap/")
If I change the soap name change from:
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/
to
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/
It generates my code, but I'm not sure what other consequences this has (I can't yet connect to the endpoint at this time). Plus I don't want to hack the wsdl.
Is there any known error in wsimport that let's it incorrectly handle a 1.1 wsdl as being 1.2? (well, known... I can't find anything about this after hours of searching)
Is there a work around where for example I can force wsimport to use soap 1.1?
Any other solution without editting the wsdl?
wsdl code here:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:rpa="urn:ns:cdm:reisinformatie:data:vi:1" xmlns:tns="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1" xmlns:ns="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1" targetNamespace="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1">
<wsdl:types>
<xsd:schema xmlns:rpa="urn:ns:cdm:reisinformatie:data:vi:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1" targetNamespace="urn:ns:cdm:reisinformatie:message:actuelelandelijkeberichten:1" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xsd:import schemaLocation="ri-cdm-vi-lab.xsd" namespace="urn:ns:cdm:reisinformatie:data:vi:1"/>
<xsd:element name="GeefActueleLandelijkeBerichtenRequestMessage" type="rpa:GeefActueleLandelijkeBerichtenRequestMessageType"/>
<xsd:element name="GeefActueleLandelijkeBerichtenResponseMessage" type="rpa:GeefActueleLandelijkeBerichtenResponseMessageType"/>
<xsd:element name="GeefActueleLandelijkeBerichtenFaultMessage" type="rpa:GeefActueleLandelijkeBerichtenFaultMessageType"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GeefActueleLandelijkeBerichtenRequest">
<wsdl:part name="parameter" element="tns:GeefActueleLandelijkeBerichtenRequestMessage"/>
</wsdl:message>
<wsdl:message name="GeefActueleLandelijkeBerichtenResponse">
<wsdl:part name="parameter" element="tns:GeefActueleLandelijkeBerichtenResponseMessage"/>
</wsdl:message>
<wsdl:message name="GeefActueleLandelijkeBerichtenFault">
<wsdl:part name="Fout" element="tns:GeefActueleLandelijkeBerichtenFaultMessage"/>
</wsdl:message>
<wsdl:portType name="ActueleLandelijkeBerichtenSoap">
<wsdl:documentation>Actuele LandelijkeBerichten Soap Port</wsdl:documentation>
<wsdl:operation name="GeefActueleLandelijkeBerichten">
<wsdl:input message="tns:GeefActueleLandelijkeBerichtenRequest"/>
<wsdl:output message="tns:GeefActueleLandelijkeBerichtenResponse"/>
<wsdl:fault name="Fout" message="tns:GeefActueleLandelijkeBerichtenFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ActueleLandelijkeBerichtenSoap" type="tns:ActueleLandelijkeBerichtenSoap">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:documentation>Actuele LandelijkeBerichten Soap Binding</wsdl:documentation>
<wsdl:operation name="GeefActueleLandelijkeBerichten">
<soap:operation soapAction="urn:GeefActueleLandelijkeBerichten"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="Fout">
<soap:body use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ActueleLandelijkeBerichten">
<wsdl:documentation>Actuele LandelijkeBerichten Service</wsdl:documentation>
<wsdl:port name="RPAActueleLandelijkeBerichtenSoap" binding="tns:ActueleLandelijkeBerichtenSoap">
<soap:address location="NotDefined"/>
<wsdl:documentation>Reisinformatie Pull Applicatie Actuele LandelijkeBerichten Soap Service</wsdl:documentation>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
note: two .xsd's not included
Right, we've decided to generate the code with CXF (which works) and then add that to the delivery file.
Also, another team at our company ran into same problem and couldn't find a solution for this as well.
So, the answer seems to be: use CXF.
I have create a web service using java. I used the below code to call the web service using php.
$client = new SoapClient("http://localhost:8080/imageCom/wsdl/CompareImage.wsdl");
$stock = "http://localhost/pic/blueTshirts/b10.jpg";
$parameters= array("url"=>$stock);
$values = $client->checkSimilarity($parameters);
var_dump($values);
When I run the code I get the following output. But it doesn't display the result
output: object(stdClass)#2 (0) { }
Here is my WSDL
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://simalarity.imageCom" xmlns:intf="http://simalarity.imageCom" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://simalarity.imageCom">
<!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://simalarity.imageCom">
<element name="checkSimilarity">
<complexType>
<sequence>
<element name="url" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="checkSimilarityResponse">
<complexType/>
</element>
</schema>
</wsdl:types>
<wsdl:message name="checkSimilarityRequest">
<wsdl:part element="impl:checkSimilarity" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="checkSimilarityResponse">
<wsdl:part element="impl:checkSimilarityResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="CompareImage">
<wsdl:operation name="checkSimilarity">
<wsdl:input message="impl:checkSimilarityRequest" name="checkSimilarityRequest"></wsdl:input>
<wsdl:output message="impl:checkSimilarityResponse" name="checkSimilarityResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CompareImageSoapBinding" type="impl:CompareImage">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="checkSimilarity">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="checkSimilarityRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="checkSimilarityResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CompareImageService">
<wsdl:port binding="impl:CompareImageSoapBinding" name="CompareImage">
<wsdlsoap:address location="http://localhost:8080/imageCom/services/CompareImage"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
What I am doing wrong? Please help me.
The thing is you are getting standard class object array in return.
You have to extract the values accordingly
print_r($array) will print your array recursively.
You may also loop over an array of objects like below,
foreach ($array as $key => $object) {
echo $object->object_property;
}
Think of an array as a collection of things. It's a bag where you can store your stuff and give them a unique id (key) and access them.
I'm working on generating Java code from the UPS Void wsdl. However, this wsdl generates java classess with the package of:
package com.ups.wsdl.xoltws.void.v1_1;
Which doesn't compile. Void is a reserved keyword in Java.
I'm using the Maven cxf codegen plugin.
This seems like a problem that anyone generating Java code from this wsdl would run into. Has anyone done this before and found a workaround for this problem?
Here's the wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<!-- UPS Void Shipment Service WSDL Release Date Mar 11, 2008 -->
<!-- Copyright 2007-2008 United Parcel Service of America, Inc. All rights reserved. -->
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:error="http://www.ups.com/XMLSchema/XOLTWS/Error/v1.1" xmlns:upss="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" xmlns:common="http://www.ups.com/XMLSchema/XOLTWS/Common/v1.0" xmlns:voida="http://www.ups.com/XMLSchema/XOLTWS/Void/v1.1" xmlns:tns="http://www.ups.com/WSDL/XOLTWS/Void/v1.1" targetNamespace="http://www.ups.com/WSDL/XOLTWS/Void/v1.1">
<wsdl:types>
<xsd:schema>
<!-- This schema defines the UPS Security header used for authorization purposes -->
<xsd:import namespace="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" schemaLocation="UPSSecurity.xsd"/>
<!-- This schema defines the error detail data types returned within SOAPFaults to provide more specific information pertaining to the problem. -->
<xsd:import namespace="http://www.ups.com/XMLSchema/XOLTWS/Error/v1.1" schemaLocation="Error1.1.xsd"/>
<!-- This schema defines the Void Shipment service data types -->
<xsd:import namespace="http://www.ups.com/XMLSchema/XOLTWS/Void/v1.1" schemaLocation="VoidWebServiceSchema.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="VoidRequestMessage">
<wsdl:part name="Body" element="voida:VoidShipmentRequest"/>
<wsdl:part name="UPSSecurity" element="upss:UPSSecurity"/>
</wsdl:message>
<wsdl:message name="VoidResponseMessage">
<wsdl:part name="Body" element="voida:VoidShipmentResponse"/>
</wsdl:message>
<wsdl:message name="VoidErrorMessage">
<wsdl:part name="VoidError" element="error:Errors"/>
</wsdl:message>
<wsdl:portType name="VoidPortType">
<wsdl:operation name="ProcessVoid">
<wsdl:input name="VoidShipmentRequest" message="tns:VoidRequestMessage"/>
<wsdl:output name="VoidShipmentResponse" message="tns:VoidResponseMessage"/>
<wsdl:fault name="VoidError" message="tns:VoidErrorMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="VoidBinding" type="tns:VoidPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ProcessVoid">
<soap:operation soapAction="http://onlinetools.ups.com/webservices/VoidBinding/v1.1" style="document"/>
<wsdl:input name="VoidShipmentRequest">
<soap:body parts="Body" use="literal"/>
<soap:header message="tns:VoidRequestMessage" part="UPSSecurity" use="literal">
<soap:headerfault message="tns:VoidErrorMessage" part="VoidError" use="literal"/>
</soap:header>
</wsdl:input>
<wsdl:output name="VoidShipmentResponse">
<soap:body parts="Body" use="literal"/>
</wsdl:output>
<wsdl:fault name="VoidError">
<soap:fault name="VoidError" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="VoidService">
<wsdl:port name="VoidPort" binding="tns:VoidBinding">
<!-- Production URL -->
<!-- <soap:address location="https://onlinetools.ups.com/webservices/Void"/> -->
<!-- CIE (Customer Integration Environment) URL -->
<soap:address location="https://wwwcie.ups.com/webservices/Void"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I was able to fix this through some flags in my Maven config:
<wsdlOption>
<wsdl>${project.basedir}/src/main/resources/wsdl/ups/ship/Void.wsdl</wsdl>
<extraargs>
<extraarg>-client</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-compile</extraarg>
<extraarg>-p</extraarg>
<extraarg>com.ups.wsdl.xoltws.voidservice</extraarg>
<extraarg>-autoNameResolution</extraarg>
</extraargs>
</wsdlOption>
More details on this in: Specifying Package Name When Using Maven to Generate Java from WSDL
I am integrating with a system that expects us to consume WS-I 1.1 document/literal wrapped messages. We have a working solution but it appears like there could be a simpler way to deal with payload wrapping/unwrapping.
I have an endpoint that as follows:
#Endpoint
public class FooEndpoint
{
#Autowired
private FooService FooService;
#PayloadRoot(localPart = "Foo", namespace = "http://foo/service")
#ResponsePayload
public JAXBElement<FooAcknowledgementType> Foo(
#RequestPayload JAXBElement<FooRequestType> requestElement)
{
FooRequestType request = requestElement.getValue();
FooAcknowledgementType response = FooService.Foo(request);
// TODO: Find a better solution with the wrapped response
return new JAXBElement<FooAcknowledgementType>(new QName(
"http://foo/service", "FooAcknowledgement"),
FooAcknowledgementType.class, null, response);
}
}
and a WSDL which defines the contract is like:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns="http://foo/service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns="http://www.w3.org/2000/09/xmldsig#" xmlns:ns1="http://foo/schema"
name="Foo" targetNamespace="http://foo/service">
<wsdl:types>
<xsd:schema xmlns:s="http://foo/schema" targetNamespace="http://foo/service">
<xsd:import namespace="http://foo/schema" schemaLocation="foo_types.xsd" />
<xsd:element name="Foo" type="s:FooRequestType" />
<xsd:element name="FooAcknowledgement" type="s:FooAcknowledgementType" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="FooRequest">
<wsdl:part name="parameter" element="tns:Foo" />
</wsdl:message>
<wsdl:message name="FooAcknowledgement">
<wsdl:part name="parameter" element="tns:FooAcknowledgement" />
</wsdl:message>
<wsdl:portType name="FooPortType">
<wsdl:operation name="Foo">
<wsdl:input message="tns:FooRequest" />
<wsdl:output message="tns:FooAcknowledgement" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FooBinding" type="tns:FooPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Foo">
<soap:operation soapAction="http://foo/serviceFoo" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Foo">
<wsdl:documentation>Foo web service</wsdl:documentation>
<wsdl:port name="FooService" binding="tns:FooBinding">
<soap:address location="http://localhost:8080/foo/services/Foo" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I've generated jaxb objects from the foo_types.xsd schema as referenced in the endpoint class above.
The issue is that when we receive soap messages in document/literal wrapped style the soap body payload would look like
<x:Foo>
<!-- elements from s:FooRequestType -->
</x:Foo>
and we are expected to respond with a soap body payload like
<x:FooAcknowledgement>
<!-- elements from s:FooAcknowledgementType -->
</x:FooAcknowledgement>
Is there anyway that the Spring-WS can handle this out of the box? We can consume and produce compliant messages with the code as it is but it seems like this might not be the right way to go about it as this style is not referenced in the spring docs at http://docs.spring.io/spring-ws/site/reference/html/tutorial.html#tutorial.xsd
The solution for us was to add the namespace and element name to the #XmlRootElement annotation via our jaxb bindings.xml, E.g.
<jaxb:bindings node="xs:complexType[#name='fooType']">
<annox:annotate target="class">
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="FooAcknowledgement" namespace="http://foo/service"/>
</annox:annotate>
</jaxb:bindings>